-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
expected_keepers.go
39 lines (28 loc) · 1.46 KB
/
expected_keepers.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package types
import (
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
)
type AccountKeeper interface {
// Return a new account with the next account number and the specified address. Does not save the new account to the store.
NewAccountWithAddress(sdk.Context, sdk.AccAddress) authtypes.AccountI
// Return a new account with the next account number. Does not save the new account to the store.
NewAccount(sdk.Context, authtypes.AccountI) authtypes.AccountI
// Retrieve an account from the store.
GetAccount(sdk.Context, sdk.AccAddress) authtypes.AccountI
// Set an account in the store.
SetAccount(sdk.Context, authtypes.AccountI)
// Remove an account from the store.
RemoveAccount(sdk.Context, authtypes.AccountI)
// Iterate over all accounts, calling the provided function. Stop iteraiton when it returns false.
IterateAccounts(sdk.Context, func(authtypes.AccountI) bool)
// Fetch the public key of an account at a specified address
GetPubKey(sdk.Context, sdk.AccAddress) (cryptotypes.PubKey, error)
// Fetch the sequence of an account at a specified address.
GetSequence(sdk.Context, sdk.AccAddress) (uint64, error)
// Fetch the next account number, and increment the internal counter.
GetNextAccountNumber(sdk.Context) uint64
GetModuleAddress(moduleName string) sdk.AccAddress
GetModuleAccount(ctx sdk.Context, moduleName string) authtypes.ModuleAccountI
}