Documentation ¶
Overview ¶
Implements account keeper with vm storage inside to allow work with accounts from VM.
Index ¶
- func AccResToBytes(acc AccountResource) []byte
- func AddrToPathAddr(addr []byte) []byte
- func GetAccountCmd(cdc *codec.Codec) *cobra.Command
- func GetResPath() []byte
- func GetSignerAcc(ctx sdk.Context, ak VMAccountKeeper, addr sdk.AccAddress) (exported.Account, sdk.Result)
- func NewQuerier(keeper VMAccountKeeper) sdk.Querier
- type AccountResource
- type AppModule
- func (AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock)
- func (AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate
- func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage
- func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate
- func (AppModule) Name() string
- func (AppModule) NewHandler() sdk.Handler
- func (am AppModule) NewQuerierHandler() sdk.Querier
- func (AppModule) QuerierRoute() string
- func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry)
- func (AppModule) Route() string
- type AppModuleBasic
- func (AppModuleBasic) DefaultGenesis() json.RawMessage
- func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command
- func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command
- func (AppModuleBasic) Name() string
- func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)
- func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)
- func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error
- type DNCoin
- type EventHandle
- type VMAccountKeeper
- func (keeper VMAccountKeeper) GetAccount(ctx sdk.Context, addr sdk.AccAddress) exported.Account
- func (keeper VMAccountKeeper) GetAllAccounts(ctx sdk.Context) []exported.Account
- func (keeper VMAccountKeeper) RemoveAccount(ctx sdk.Context, acc exported.Account)
- func (keeper VMAccountKeeper) SetAccount(ctx sdk.Context, acc exported.Account)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccResToBytes ¶
func AccResToBytes(acc AccountResource) []byte
Convert account resource to bytes.
func GetAccountCmd ¶
GetAccountCmd returns a query account that will display the state of the account at a given address.
func GetSignerAcc ¶
func GetSignerAcc(ctx sdk.Context, ak VMAccountKeeper, addr sdk.AccAddress) (exported.Account, sdk.Result)
GetSignerAcc returns an account for a given address that is expected to sign a transaction.
func NewQuerier ¶
func NewQuerier(keeper VMAccountKeeper) sdk.Querier
creates a querier for auth REST endpoints
Types ¶
type AccountResource ¶
type AccountResource struct { Balances []DNCoin // coins. WithdrawEvents *EventHandle // receive events handler. DepositEvents *EventHandle // sent events handler. EventGenerator uint64 // event generator. }
Balances of account in case of standard lib.
func AccResFromAccount ¶
func AccResFromAccount(acc exported.Account, source *AccountResource) AccountResource
Convert acc to account resource.
type AppModule ¶
type AppModule struct { AppModuleBasic // contains filtered or unexported fields }
___________________________ app module object
func NewAppModule ¶
func NewAppModule(accountKeeper VMAccountKeeper) AppModule
NewAppModule creates a new AppModule object
func (AppModule) BeginBlock ¶
func (AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock)
module begin-block
func (AppModule) EndBlock ¶
func (AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate
module end-block
func (AppModule) ExportGenesis ¶
func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage
module export genesis
func (AppModule) InitGenesis ¶
func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate
module init-genesis
func (AppModule) NewQuerierHandler ¶
module querier
func (AppModule) RegisterInvariants ¶
func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry)
register invariants
type AppModuleBasic ¶
type AppModuleBasic struct{}
app module basics object
func (AppModuleBasic) DefaultGenesis ¶
func (AppModuleBasic) DefaultGenesis() json.RawMessage
default genesis state
func (AppModuleBasic) GetQueryCmd ¶
func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command
get the root query command of this module
func (AppModuleBasic) GetTxCmd ¶
func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command
get the root tx command of this module
func (AppModuleBasic) RegisterCodec ¶
func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)
register module codec
func (AppModuleBasic) RegisterRESTRoutes ¶
func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)
register rest routes
func (AppModuleBasic) ValidateGenesis ¶
func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error
module validate genesis
type VMAccountKeeper ¶
type VMAccountKeeper struct { *auth.AccountKeeper // contains filtered or unexported fields }
Implements account keeper with vm storage support.
func NewVMAccountKeeper ¶
func NewVMAccountKeeper(cdc *codec.Codec, key sdk.StoreKey, paramstore params.Subspace, vmKeeper common_vm.VMStorage, proto func() exported.Account) VMAccountKeeper
Create new account vm keeper.
func (VMAccountKeeper) GetAccount ¶
func (keeper VMAccountKeeper) GetAccount(ctx sdk.Context, addr sdk.AccAddress) exported.Account
Get account from storage.
func (VMAccountKeeper) GetAllAccounts ¶
func (keeper VMAccountKeeper) GetAllAccounts(ctx sdk.Context) []exported.Account
GetAllAccounts returns all accounts in the accountKeeper. as it's not calling anywhere, as it seems, we can ignore vm storage for now. todo: process all vm storage accounts and compare with standard accounts.
func (VMAccountKeeper) RemoveAccount ¶
func (keeper VMAccountKeeper) RemoveAccount(ctx sdk.Context, acc exported.Account)
Removes an account from storage. NOTE: this will cause supply invariant violation if called
func (VMAccountKeeper) SetAccount ¶
func (keeper VMAccountKeeper) SetAccount(ctx sdk.Context, acc exported.Account)
Set account in storage.