Documentation ¶
Index ¶
- func NewMsgServerImpl(ak AccountKeeper) types.MsgServer
- type AccountKeeper
- func (ak AccountKeeper) Account(c context.Context, req *types.QueryAccountRequest) (*types.QueryAccountResponse, error)
- func (ak AccountKeeper) AccountAddressByID(c context.Context, req *types.QueryAccountAddressByIDRequest) (*types.QueryAccountAddressByIDResponse, error)
- func (ak AccountKeeper) AccountInfo(goCtx context.Context, req *types.QueryAccountInfoRequest) (*types.QueryAccountInfoResponse, error)
- func (ak AccountKeeper) Accounts(c context.Context, req *types.QueryAccountsRequest) (*types.QueryAccountsResponse, error)
- func (ak AccountKeeper) AddressBytesToString(ctx context.Context, req *types.AddressBytesToStringRequest) (*types.AddressBytesToStringResponse, error)
- func (ak AccountKeeper) AddressStringToBytes(ctx context.Context, req *types.AddressStringToBytesRequest) (*types.AddressStringToBytesResponse, error)
- func (ak AccountKeeper) Bech32Prefix(ctx context.Context, req *types.Bech32PrefixRequest) (*types.Bech32PrefixResponse, error)
- func (ak AccountKeeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (ak AccountKeeper) GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI
- func (ak AccountKeeper) GetAccountAddressByID(ctx sdk.Context, id uint64) string
- func (ak AccountKeeper) GetAllAccounts(ctx sdk.Context) (accounts []types.AccountI)
- func (ak AccountKeeper) GetAuthority() string
- func (ak AccountKeeper) GetCodec() codec.BinaryCodec
- func (ak AccountKeeper) GetModuleAccount(ctx sdk.Context, moduleName string) types.ModuleAccountI
- func (ak AccountKeeper) GetModuleAccountAndPermissions(ctx sdk.Context, moduleName string) (types.ModuleAccountI, []string)
- func (ak AccountKeeper) GetModuleAddress(moduleName string) sdk.AccAddress
- func (ak AccountKeeper) GetModuleAddressAndPermissions(moduleName string) (addr sdk.AccAddress, permissions []string)
- func (ak AccountKeeper) GetModulePermissions() map[string]types.PermissionsForAddress
- func (ak AccountKeeper) GetParams(ctx sdk.Context) (params types.Params)
- func (ak AccountKeeper) GetPubKey(ctx sdk.Context, addr sdk.AccAddress) (cryptotypes.PubKey, error)
- func (ak AccountKeeper) GetSequence(ctx sdk.Context, addr sdk.AccAddress) (uint64, error)
- func (ak AccountKeeper) HasAccount(ctx sdk.Context, addr sdk.AccAddress) bool
- func (ak AccountKeeper) HasAccountAddressByID(ctx sdk.Context, id uint64) bool
- func (ak AccountKeeper) InitGenesis(ctx sdk.Context, data types.GenesisState)
- func (ak AccountKeeper) IterateAccounts(ctx sdk.Context, cb func(account types.AccountI) (stop bool))
- func (ak AccountKeeper) Logger(ctx sdk.Context) log.Logger
- func (ak AccountKeeper) MarshalAccount(accountI types.AccountI) ([]byte, error)
- func (ak AccountKeeper) ModuleAccountByName(c context.Context, req *types.QueryModuleAccountByNameRequest) (*types.QueryModuleAccountByNameResponse, error)
- func (ak AccountKeeper) ModuleAccounts(c context.Context, req *types.QueryModuleAccountsRequest) (*types.QueryModuleAccountsResponse, error)
- func (ak AccountKeeper) NewAccount(ctx sdk.Context, acc types.AccountI) types.AccountI
- func (ak AccountKeeper) NewAccountWithAddress(ctx sdk.Context, addr sdk.AccAddress) types.AccountI
- func (ak AccountKeeper) NextAccountNumber(ctx sdk.Context) uint64
- func (ak AccountKeeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (ak AccountKeeper) RemoveAccount(ctx sdk.Context, acc types.AccountI)
- func (ak AccountKeeper) SetAccount(ctx sdk.Context, acc types.AccountI)
- func (ak AccountKeeper) SetModuleAccount(ctx sdk.Context, macc types.ModuleAccountI)
- func (ak AccountKeeper) SetParams(ctx sdk.Context, params types.Params) error
- func (ak AccountKeeper) UnmarshalAccount(bz []byte) (types.AccountI, error)
- func (ak AccountKeeper) ValidatePermissions(macc types.ModuleAccountI) error
- type AccountKeeperI
- type Migrator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMsgServerImpl ¶ added in v0.47.0
func NewMsgServerImpl(ak AccountKeeper) types.MsgServer
NewMsgServerImpl returns an implementation of the x/auth MsgServer interface.
Types ¶
type AccountKeeper ¶
type AccountKeeper struct {
// contains filtered or unexported fields
}
AccountKeeper encodes/decodes accounts using the go-amino (binary) encoding/decoding library.
func NewAccountKeeper ¶
func NewAccountKeeper( cdc codec.BinaryCodec, storeKey storetypes.StoreKey, proto func() types.AccountI, maccPerms map[string][]string, bech32Prefix string, authority string, ) AccountKeeper
NewAccountKeeper returns a new AccountKeeperI that uses go-amino to (binary) encode and decode concrete sdk.Accounts. `maccPerms` is a map that takes accounts' addresses as keys, and their respective permissions as values. This map is used to construct types.PermissionsForAddress and is used in keeper.ValidatePermissions. Permissions are plain strings, and don't have to fit into any predefined structure. This auth module does not use account permissions internally, though other modules may use auth.Keeper to access the accounts permissions map.
func (AccountKeeper) Account ¶ added in v0.40.0
func (ak AccountKeeper) Account(c context.Context, req *types.QueryAccountRequest) (*types.QueryAccountResponse, error)
Account returns account details based on address
func (AccountKeeper) AccountAddressByID ¶ added in v0.46.0
func (ak AccountKeeper) AccountAddressByID(c context.Context, req *types.QueryAccountAddressByIDRequest) (*types.QueryAccountAddressByIDResponse, error)
func (AccountKeeper) AccountInfo ¶ added in v0.47.0
func (ak AccountKeeper) AccountInfo(goCtx context.Context, req *types.QueryAccountInfoRequest) (*types.QueryAccountInfoResponse, error)
AccountInfo implements the AccountInfo query.
func (AccountKeeper) Accounts ¶ added in v0.43.0
func (ak AccountKeeper) Accounts(c context.Context, req *types.QueryAccountsRequest) (*types.QueryAccountsResponse, error)
func (AccountKeeper) AddressBytesToString ¶ added in v0.46.0
func (ak AccountKeeper) AddressBytesToString(ctx context.Context, req *types.AddressBytesToStringRequest) (*types.AddressBytesToStringResponse, error)
AddressBytesToString converts an address from bytes to string, using the keeper's bech32 prefix.
func (AccountKeeper) AddressStringToBytes ¶ added in v0.46.0
func (ak AccountKeeper) AddressStringToBytes(ctx context.Context, req *types.AddressStringToBytesRequest) (*types.AddressStringToBytesResponse, error)
AddressStringToBytes converts an address from string to bytes, using the keeper's bech32 prefix.
func (AccountKeeper) Bech32Prefix ¶ added in v0.46.0
func (ak AccountKeeper) Bech32Prefix(ctx context.Context, req *types.Bech32PrefixRequest) (*types.Bech32PrefixResponse, error)
Bech32Prefix returns the keeper internally stored bech32 prefix.
func (AccountKeeper) ExportGenesis ¶ added in v0.46.0
func (ak AccountKeeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
ExportGenesis returns a GenesisState for a given context and keeper
func (AccountKeeper) GetAccount ¶
func (ak AccountKeeper) GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI
GetAccount implements AccountKeeperI.
func (AccountKeeper) GetAccountAddressByID ¶ added in v0.46.0
func (ak AccountKeeper) GetAccountAddressByID(ctx sdk.Context, id uint64) string
GetAccountAddressById returns account address by id.
func (AccountKeeper) GetAllAccounts ¶
func (ak AccountKeeper) GetAllAccounts(ctx sdk.Context) (accounts []types.AccountI)
GetAllAccounts returns all accounts in the accountKeeper.
func (AccountKeeper) GetAuthority ¶ added in v0.47.0
func (ak AccountKeeper) GetAuthority() string
GetAuthority returns the x/auth module's authority.
func (AccountKeeper) GetCodec ¶ added in v0.40.0
func (ak AccountKeeper) GetCodec() codec.BinaryCodec
GetCodec return codec.Codec object used by the keeper
func (AccountKeeper) GetModuleAccount ¶
func (ak AccountKeeper) GetModuleAccount(ctx sdk.Context, moduleName string) types.ModuleAccountI
GetModuleAccount gets the module account from the auth account store, if the account does not exist in the AccountKeeper, then it is created.
func (AccountKeeper) GetModuleAccountAndPermissions ¶
func (ak AccountKeeper) GetModuleAccountAndPermissions(ctx sdk.Context, moduleName string) (types.ModuleAccountI, []string)
GetModuleAccountAndPermissions gets the module account from the auth account store and its registered permissions
func (AccountKeeper) GetModuleAddress ¶
func (ak AccountKeeper) GetModuleAddress(moduleName string) sdk.AccAddress
GetModuleAddress returns an address based on the module name
func (AccountKeeper) GetModuleAddressAndPermissions ¶
func (ak AccountKeeper) GetModuleAddressAndPermissions(moduleName string) (addr sdk.AccAddress, permissions []string)
GetModuleAddressAndPermissions returns an address and permissions based on the module name
func (AccountKeeper) GetModulePermissions ¶ added in v0.47.0
func (ak AccountKeeper) GetModulePermissions() map[string]types.PermissionsForAddress
GetModulePermissions fetches per-module account permissions.
func (AccountKeeper) GetParams ¶
func (ak AccountKeeper) GetParams(ctx sdk.Context) (params types.Params)
GetParams gets the auth module's parameters.
func (AccountKeeper) GetPubKey ¶
func (ak AccountKeeper) GetPubKey(ctx sdk.Context, addr sdk.AccAddress) (cryptotypes.PubKey, error)
GetPubKey Returns the PubKey of the account at address
func (AccountKeeper) GetSequence ¶
func (ak AccountKeeper) GetSequence(ctx sdk.Context, addr sdk.AccAddress) (uint64, error)
GetSequence Returns the Sequence of the account at address
func (AccountKeeper) HasAccount ¶ added in v0.45.0
func (ak AccountKeeper) HasAccount(ctx sdk.Context, addr sdk.AccAddress) bool
HasAccount implements AccountKeeperI.
func (AccountKeeper) HasAccountAddressByID ¶ added in v0.46.0
func (ak AccountKeeper) HasAccountAddressByID(ctx sdk.Context, id uint64) bool
HasAccountAddressByID checks account address exists by id.
func (AccountKeeper) InitGenesis ¶ added in v0.46.0
func (ak AccountKeeper) InitGenesis(ctx sdk.Context, data types.GenesisState)
InitGenesis - Init store state from genesis data
CONTRACT: old coins from the FeeCollectionKeeper need to be transferred through a genesis port script to the new fee collector account
func (AccountKeeper) IterateAccounts ¶
func (ak AccountKeeper) IterateAccounts(ctx sdk.Context, cb func(account types.AccountI) (stop bool))
IterateAccounts iterates over all the stored accounts and performs a callback function. Stops iteration when callback returns true.
func (AccountKeeper) Logger ¶
func (ak AccountKeeper) Logger(ctx sdk.Context) log.Logger
Logger returns a module-specific logger.
func (AccountKeeper) MarshalAccount ¶ added in v0.40.0
func (ak AccountKeeper) MarshalAccount(accountI types.AccountI) ([]byte, error)
MarshalAccount protobuf serializes an Account interface
func (AccountKeeper) ModuleAccountByName ¶ added in v0.45.10
func (ak AccountKeeper) ModuleAccountByName(c context.Context, req *types.QueryModuleAccountByNameRequest) (*types.QueryModuleAccountByNameResponse, error)
ModuleAccountByName returns module account by module name
func (AccountKeeper) ModuleAccounts ¶ added in v0.46.0
func (ak AccountKeeper) ModuleAccounts(c context.Context, req *types.QueryModuleAccountsRequest) (*types.QueryModuleAccountsResponse, error)
ModuleAccounts returns all the existing Module Accounts
func (AccountKeeper) NewAccount ¶
NewAccount sets the next account number to a given account interface
func (AccountKeeper) NewAccountWithAddress ¶
func (ak AccountKeeper) NewAccountWithAddress(ctx sdk.Context, addr sdk.AccAddress) types.AccountI
NewAccountWithAddress implements AccountKeeperI.
func (AccountKeeper) NextAccountNumber ¶ added in v0.47.0
func (ak AccountKeeper) NextAccountNumber(ctx sdk.Context) uint64
NextAccountNumber returns and increments the global account number counter. If the global account number is not set, it initializes it with value 0.
func (AccountKeeper) Params ¶ added in v0.40.0
func (ak AccountKeeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Params returns parameters of auth module
func (AccountKeeper) RemoveAccount ¶
func (ak AccountKeeper) RemoveAccount(ctx sdk.Context, acc types.AccountI)
RemoveAccount removes an account for the account mapper store. NOTE: this will cause supply invariant violation if called
func (AccountKeeper) SetAccount ¶
func (ak AccountKeeper) SetAccount(ctx sdk.Context, acc types.AccountI)
SetAccount implements AccountKeeperI.
func (AccountKeeper) SetModuleAccount ¶
func (ak AccountKeeper) SetModuleAccount(ctx sdk.Context, macc types.ModuleAccountI)
SetModuleAccount sets the module account to the auth account store
func (AccountKeeper) UnmarshalAccount ¶ added in v0.40.0
func (ak AccountKeeper) UnmarshalAccount(bz []byte) (types.AccountI, error)
UnmarshalAccount returns an Account interface from raw encoded account bytes of a Proto-based Account type
func (AccountKeeper) ValidatePermissions ¶
func (ak AccountKeeper) ValidatePermissions(macc types.ModuleAccountI) error
ValidatePermissions validates that the module account has been granted permissions within its set of allowed permissions.
type AccountKeeperI ¶ added in v0.40.0
type AccountKeeperI 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) types.AccountI // Return a new account with the next account number. Does not save the new account to the store. NewAccount(sdk.Context, types.AccountI) types.AccountI // Check if an account exists in the store. HasAccount(sdk.Context, sdk.AccAddress) bool // Retrieve an account from the store. GetAccount(sdk.Context, sdk.AccAddress) types.AccountI // Set an account in the store. SetAccount(sdk.Context, types.AccountI) // Remove an account from the store. RemoveAccount(sdk.Context, types.AccountI) // Iterate over all accounts, calling the provided function. Stop iteration when it returns true. IterateAccounts(sdk.Context, func(types.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. NextAccountNumber(sdk.Context) uint64 // GetModulePermissions fetches per-module account permissions GetModulePermissions() map[string]types.PermissionsForAddress }
AccountKeeperI is the interface contract that x/auth's keeper implements.
type Migrator ¶ added in v0.43.0
type Migrator struct {
// contains filtered or unexported fields
}
Migrator is a struct for handling in-place store migrations.
func NewMigrator ¶ added in v0.43.0
NewMigrator returns a new Migrator.
func (Migrator) Migrate1to2 ¶ added in v0.43.0
Migrate1to2 migrates from version 1 to 2.
func (Migrator) Migrate2to3 ¶ added in v0.46.0
Migrate2to3 migrates from consensus version 2 to version 3. Specifically, for each account we index the account's ID to their address.
func (Migrator) Migrate3to4 ¶ added in v0.47.0
Migrate3to4 migrates the x/auth module state from the consensus version 3 to version 4. Specifically, it takes the parameters that are currently stored and managed by the x/params modules and stores them directly into the x/auth module state.