pos

package
v0.0.0-...-3ea6778 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 25, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExportGenesis

func ExportGenesis(ctx sdk.Ctx, keeper keeper.Keeper) types.GenesisState

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 NewHandler

func NewHandler(k keeper.Keeper) sdk.Handler

func QueryAccountBalance

func QueryAccountBalance(cdc *codec.Codec, tmNode rpcclient.Client, addr sdk.Address, height int64) (sdk.Int, error)

func QueryBlock

func QueryBlock(tmNode rpcclient.Client, height *int64) ([]byte, error)

func QueryChainHeight

func QueryChainHeight(tmNode rpcclient.Client) (int64, error)

get the current blockchain height

func QueryNodeStatus

func QueryNodeStatus(tmNode rpcclient.Client) (*ctypes.ResultStatus, error)

func QueryPOSParams

func QueryPOSParams(cdc *codec.Codec, tmNode rpcclient.Client, height int64) (types.Params, error)

func QuerySigningInfo

func QuerySigningInfo(cdc *codec.Codec, tmNode rpcclient.Client, height int64, address sdk.Address) (types.ValidatorSigningInfo, error)

func QueryStakedValidators

func QueryStakedValidators(cdc *codec.Codec, tmNode rpcclient.Client, height int64) (types.Validators, error)

func QuerySupply

func QuerySupply(cdc *codec.Codec, tmNode rpcclient.Client, height int64) (stakedCoins sdk.Int, unstakedCoins sdk.Int, err error)

func QueryTransaction

func QueryTransaction(tmNode rpcclient.Client, hash string) (*ctypes.ResultTx, error)

func QueryUnstakedValidators

func QueryUnstakedValidators(cdc *codec.Codec, tmNode rpcclient.Client, height int64) (types.Validators, error)

func QueryUnstakingValidators

func QueryUnstakingValidators(cdc *codec.Codec, tmNode rpcclient.Client, height int64) (types.Validators, error)

func QueryValidator

func QueryValidator(cdc *codec.Codec, tmNode rpcclient.Client, addr sdk.Address, height int64) (types.Validator, error)

func QueryValidators

func QueryValidators(cdc *codec.Codec, tmNode rpcclient.Client, height int64) (types.Validators, error)

func RawTx

func RawTx(cdc *codec.Codec, tmNode client.Client, fromAddr sdk.Address, txBytes []byte) (sdk.TxResponse, error)

func Send

func Send(cdc *codec.Codec, tmNode client.Client, keybase keys.Keybase, fromAddr, toAddr sdk.Address, passphrase string, amount sdk.Int) (*sdk.TxResponse, error)

func StakeTx

func StakeTx(cdc *codec.Codec, tmNode client.Client, keybase keys.Keybase, amount sdk.Int, kp keys.KeyPair, passphrase string) (*sdk.TxResponse, error)

func UnjailTx

func UnjailTx(cdc *codec.Codec, tmNode client.Client, keybase keys.Keybase, address sdk.Address, passphrase string) (*sdk.TxResponse, error)

func UnstakeTx

func UnstakeTx(cdc *codec.Codec, tmNode client.Client, keybase keys.Keybase, address sdk.Address, passphrase string) (*sdk.TxResponse, error)

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) Name

func (AppModule) Name() string

Name returns the staking module's name.

func (AppModule) NewHandler

func (am AppModule) NewHandler() sdk.Handler

NewHandler returns an sdk.Handler for the staking module.

func (AppModule) NewQuerierHandler

func (am AppModule) NewQuerierHandler() sdk.Querier

NewQuerierHandler returns the staking module sdk.Querier.

func (AppModule) QuerierRoute

func (AppModule) QuerierRoute() string

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.

func (AppModule) Route

func (AppModule) Route() string

Route returns the message routing key for the staking module.

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.

Directories

Path Synopsis
nolint
nolint

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL