Documentation ¶
Index ¶
- func ExportGenesis(ctx sdk.Ctx, keeper keeper.Keeper) types.GenesisState
- func InitGenesis(ctx sdk.Ctx, keeper keeper.Keeper, supplyKeeper types.SupplyKeeper, ...) (res []abci.ValidatorUpdate)
- func NewHandler(k keeper.Keeper) sdk.Handler
- func QueryAccountBalance(cdc *codec.Codec, tmNode rpcclient.Client, addr sdk.Address, height int64) (sdk.Int, error)
- func QueryBlock(tmNode rpcclient.Client, height *int64) ([]byte, error)
- func QueryChainHeight(tmNode rpcclient.Client) (int64, error)
- func QueryNodeStatus(tmNode rpcclient.Client) (*ctypes.ResultStatus, error)
- func QueryPOSParams(cdc *codec.Codec, tmNode rpcclient.Client, height int64) (types.Params, error)
- func QuerySigningInfo(cdc *codec.Codec, tmNode rpcclient.Client, height int64, address sdk.Address) (types.ValidatorSigningInfo, error)
- func QueryStakedValidators(cdc *codec.Codec, tmNode rpcclient.Client, height int64) (types.Validators, error)
- func QuerySupply(cdc *codec.Codec, tmNode rpcclient.Client, height int64) (stakedCoins sdk.Int, unstakedCoins sdk.Int, err error)
- func QueryTransaction(tmNode rpcclient.Client, hash string) (*ctypes.ResultTx, error)
- func QueryUnstakedValidators(cdc *codec.Codec, tmNode rpcclient.Client, height int64) (types.Validators, error)
- func QueryUnstakingValidators(cdc *codec.Codec, tmNode rpcclient.Client, height int64) (types.Validators, error)
- func QueryValidator(cdc *codec.Codec, tmNode rpcclient.Client, addr sdk.Address, height int64) (types.Validator, error)
- func QueryValidators(cdc *codec.Codec, tmNode rpcclient.Client, height int64) (types.Validators, error)
- func RawTx(cdc *codec.Codec, tmNode client.Client, fromAddr sdk.Address, txBytes []byte) (sdk.TxResponse, error)
- func Send(cdc *codec.Codec, tmNode client.Client, keybase keys.Keybase, ...) (*sdk.TxResponse, error)
- func StakeTx(cdc *codec.Codec, tmNode client.Client, keybase keys.Keybase, amount sdk.Int, ...) (*sdk.TxResponse, error)
- func UnjailTx(cdc *codec.Codec, tmNode client.Client, keybase keys.Keybase, ...) (*sdk.TxResponse, error)
- func UnstakeTx(cdc *codec.Codec, tmNode client.Client, keybase keys.Keybase, ...) (*sdk.TxResponse, error)
- func ValidateGenesis(data types.GenesisState) error
- type AppModule
- func (am AppModule) BeginBlock(ctx sdk.Ctx, req abci.RequestBeginBlock)
- func (am AppModule) EndBlock(ctx sdk.Ctx, _ abci.RequestEndBlock) []abci.ValidatorUpdate
- func (am AppModule) ExportGenesis(ctx sdk.Ctx) json.RawMessage
- func (am AppModule) InitGenesis(ctx sdk.Ctx, data json.RawMessage) []abci.ValidatorUpdate
- func (AppModule) Name() string
- func (am AppModule) NewHandler() sdk.Handler
- func (am AppModule) NewQuerierHandler() sdk.Querier
- func (AppModule) QuerierRoute() string
- func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry)
- func (AppModule) Route() string
- type AppModuleBasic
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExportGenesis ¶
ExportGenesis returns a GenesisState for a given context and keeper
func InitGenesis ¶
func InitGenesis(ctx sdk.Ctx, keeper keeper.Keeper, supplyKeeper types.SupplyKeeper, data types.GenesisState) (res []abci.ValidatorUpdate)
InitGenesis sets up the module based on the genesis state First TM block is at height 1, so state updates applied from genesis.json are in block 0.
func QueryAccountBalance ¶
func QueryChainHeight ¶
get the current blockchain height
func QueryNodeStatus ¶
func QueryNodeStatus(tmNode rpcclient.Client) (*ctypes.ResultStatus, error)
func QueryPOSParams ¶
func QuerySigningInfo ¶
func QueryStakedValidators ¶
func QuerySupply ¶
func QueryTransaction ¶
func QueryUnstakedValidators ¶
func QueryValidator ¶
func QueryValidators ¶
func ValidateGenesis ¶
func ValidateGenesis(data types.GenesisState) error
ValidateGenesis validates the provided staking genesis state to ensure the expected invariants holds. (i.e. params in correct bounds, no duplicate validators)
Types ¶
type AppModule ¶
type AppModule struct { AppModuleBasic // contains filtered or unexported fields }
AppModule implements an application module for the staking module.
func NewAppModule ¶
func NewAppModule(keeper keeper.Keeper, accountKeeper types.AccountKeeper, supplyKeeper types.SupplyKeeper) AppModule
NewAppModule creates a new AppModule object
func (AppModule) BeginBlock ¶
func (am AppModule) BeginBlock(ctx sdk.Ctx, req abci.RequestBeginBlock)
module begin-block
func (AppModule) EndBlock ¶
func (am AppModule) EndBlock(ctx sdk.Ctx, _ abci.RequestEndBlock) []abci.ValidatorUpdate
EndBlock returns the end blocker for the staking module. It returns no validator updates.
func (AppModule) ExportGenesis ¶
func (am AppModule) ExportGenesis(ctx sdk.Ctx) json.RawMessage
ExportGenesis returns the exported genesis state as raw bytes for the staking module.
func (AppModule) InitGenesis ¶
func (am AppModule) InitGenesis(ctx sdk.Ctx, data json.RawMessage) []abci.ValidatorUpdate
InitGenesis performs genesis initialization for the pos module. It returns no validator updates.
func (AppModule) NewHandler ¶
NewHandler returns an sdk.Handler for the staking module.
func (AppModule) NewQuerierHandler ¶
NewQuerierHandler returns the staking module sdk.Querier.
func (AppModule) QuerierRoute ¶
QuerierRoute returns the staking module's querier route name.
func (AppModule) RegisterInvariants ¶
func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry)
RegisterInvariants registers the staking module invariants.
type AppModuleBasic ¶
type AppModuleBasic struct{}
AppModuleBasic defines the basic application module used by the staking module.
func (AppModuleBasic) DefaultGenesis ¶
func (AppModuleBasic) DefaultGenesis() json.RawMessage
DefaultGenesis returns default genesis state as raw bytes for the staking module.
func (AppModuleBasic) Name ¶
func (AppModuleBasic) Name() string
Name returns the staking module's name.
func (AppModuleBasic) RegisterCodec ¶
func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)
RegisterCodec registers the staking module's types for the given codec.
func (AppModuleBasic) ValidateGenesis ¶
func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error
ValidateGenesis performs genesis state validation for the staking module.