Documentation ¶
Index ¶
- Variables
- func ExportGenesis(ctx sdk.Context, keeper Keeper) types.GenesisState
- func GetStakingSequenceKey(sequence string) []byte
- func GetValidatorKey(address []byte) []byte
- func GetValidatorMapKey(address []byte) []byte
- func HandleMsgSignerUpdate(ctx sdk.Context, msg types.MsgSignerUpdate, k Keeper, ...) sdk.Result
- func HandleMsgStakeUpdate(ctx sdk.Context, msg types.MsgStakeUpdate, k Keeper, ...) sdk.Result
- func HandleMsgValidatorExit(ctx sdk.Context, msg types.MsgValidatorExit, k Keeper, ...) sdk.Result
- func HandleMsgValidatorJoin(ctx sdk.Context, msg types.MsgValidatorJoin, k Keeper, ...) sdk.Result
- func InitGenesis(ctx sdk.Context, keeper Keeper, data types.GenesisState)
- func NewHandler(k Keeper, contractCaller helper.IContractCaller) sdk.Handler
- func NewPostTxHandler(k Keeper, contractCaller helper.IContractCaller) hmTypes.PostTxHandler
- func NewQuerier(keeper Keeper, contractCaller helper.IContractCaller) sdk.Querier
- func NewSideTxHandler(k Keeper, contractCaller helper.IContractCaller) hmTypes.SideTxHandler
- func PostHandleMsgSignerUpdate(ctx sdk.Context, k Keeper, msg types.MsgSignerUpdate, ...) sdk.Result
- func PostHandleMsgStakeUpdate(ctx sdk.Context, k Keeper, msg types.MsgStakeUpdate, ...) sdk.Result
- func PostHandleMsgValidatorExit(ctx sdk.Context, k Keeper, msg types.MsgValidatorExit, ...) sdk.Result
- func PostHandleMsgValidatorJoin(ctx sdk.Context, k Keeper, msg types.MsgValidatorJoin, ...) sdk.Result
- func SideHandleMsgSignerUpdate(ctx sdk.Context, msg types.MsgSignerUpdate, k Keeper, ...) (result abci.ResponseDeliverSideTx)
- func SideHandleMsgStakeUpdate(ctx sdk.Context, msg types.MsgStakeUpdate, k Keeper, ...) (result abci.ResponseDeliverSideTx)
- func SideHandleMsgValidatorExit(ctx sdk.Context, msg types.MsgValidatorExit, k Keeper, ...) (result abci.ResponseDeliverSideTx)
- func SideHandleMsgValidatorJoin(ctx sdk.Context, msg types.MsgValidatorJoin, k Keeper, ...) (result abci.ResponseDeliverSideTx)
- 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 (AppModule) GenerateGenesisState(simState *hmModule.SimulationState)
- func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate
- func (AppModule) Name() string
- func (am AppModule) NewHandler() sdk.Handler
- func (am AppModule) NewPostTxHandler() hmTypes.PostTxHandler
- func (am AppModule) NewQuerierHandler() sdk.Querier
- func (am AppModule) NewSideTxHandler() hmTypes.SideTxHandler
- func (AppModule) ProposalContents(simState hmModule.SimulationState) []simTypes.WeightedProposalContent
- func (AppModule) QuerierRoute() string
- func (AppModule) RandomizedParams(r *rand.Rand) []simTypes.ParamChange
- func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry)
- func (AppModule) RegisterStoreDecoder(sdr hmModule.StoreDecoderRegistry)
- func (AppModule) Route() string
- func (AppModule) WeightedOperations(_ hmModule.SimulationState) []simTypes.WeightedOperation
- 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
- func (AppModuleBasic) VerifyGenesis(bz map[string]json.RawMessage) error
- type Keeper
- func (k *Keeper) AddValidator(ctx sdk.Context, validator hmTypes.Validator) error
- func (k *Keeper) AddValidatorSigningInfo(ctx sdk.Context, valID hmTypes.ValidatorID, ...) error
- func (k Keeper) Codespace() sdk.CodespaceType
- func (k *Keeper) GetActiveValidatorInfo(ctx sdk.Context, address []byte) (validator hmTypes.Validator, err error)
- func (k *Keeper) GetAllValidators(ctx sdk.Context) (validators []*hmTypes.Validator)
- func (k *Keeper) GetCurrentProposer(ctx sdk.Context) *hmTypes.Validator
- func (k *Keeper) GetCurrentValidators(ctx sdk.Context) (validators []hmTypes.Validator)
- func (k *Keeper) GetLastUpdated(ctx sdk.Context, valID hmTypes.ValidatorID) (updatedAt string, found bool)
- func (k *Keeper) GetNextProposer(ctx sdk.Context) *hmTypes.Validator
- func (k *Keeper) GetSignerFromValidatorID(ctx sdk.Context, valID hmTypes.ValidatorID) (common.Address, bool)
- func (k *Keeper) GetSpanEligibleValidators(ctx sdk.Context) (validators []hmTypes.Validator)
- func (k *Keeper) GetStakingSequences(ctx sdk.Context) (sequences []string)
- func (k *Keeper) GetTotalPower(ctx sdk.Context) (totalPower int64)
- func (k *Keeper) GetValidatorFromValID(ctx sdk.Context, valID hmTypes.ValidatorID) (validator hmTypes.Validator, ok bool)
- func (k *Keeper) GetValidatorInfo(ctx sdk.Context, address []byte) (validator hmTypes.Validator, err error)
- func (k *Keeper) GetValidatorSet(ctx sdk.Context) (validatorSet hmTypes.ValidatorSet)
- func (k *Keeper) HasStakingSequence(ctx sdk.Context, sequence string) bool
- func (k *Keeper) IncrementAccum(ctx sdk.Context, times int)
- func (k *Keeper) IsCurrentValidatorByAddress(ctx sdk.Context, address []byte) bool
- func (k *Keeper) IterateCurrentValidatorsAndApplyFn(ctx sdk.Context, f func(validator *hmTypes.Validator) bool)
- func (k *Keeper) IterateStakingSequencesAndApplyFn(ctx sdk.Context, f func(sequence string) error)
- func (k *Keeper) IterateValidatorsAndApplyFn(ctx sdk.Context, f func(validator hmTypes.Validator) error)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k *Keeper) SetStakingSequence(ctx sdk.Context, sequence string)
- func (k *Keeper) SetValidatorIDToSignerAddr(ctx sdk.Context, valID hmTypes.ValidatorID, signerAddr hmTypes.HeimdallAddress)
- func (k *Keeper) Slash(ctx sdk.Context, valSlashingInfo hmTypes.ValidatorSlashingInfo) error
- func (k *Keeper) Unjail(ctx sdk.Context, valID hmTypes.ValidatorID)
- func (k *Keeper) UpdateSigner(ctx sdk.Context, newSigner hmTypes.HeimdallAddress, newPubkey hmTypes.PubKey, ...) error
- func (k *Keeper) UpdateValidatorSetInStore(ctx sdk.Context, newValidatorSet hmTypes.ValidatorSet) error
- type ModuleCommunicator
Constants ¶
This section is empty.
Variables ¶
var ( DefaultValue = []byte{0x01} // Value to store in CacheCheckpoint and CacheCheckpointACK & ValidatorSetChange Flag ValidatorsKey = []byte{0x21} // prefix for each key to a validator ValidatorMapKey = []byte{0x22} // prefix for each key for validator map CurrentValidatorSetKey = []byte{0x23} // Key to store current validator set StakingSequenceKey = []byte{0x24} // prefix for each key for staking sequence map )
Functions ¶
func ExportGenesis ¶
func ExportGenesis(ctx sdk.Context, keeper Keeper) types.GenesisState
ExportGenesis returns a GenesisState for a given context and keeper.
func GetStakingSequenceKey ¶
GetStakingSequenceKey returns staking sequence key
func GetValidatorKey ¶
GetValidatorKey drafts the validator key for addresses
func GetValidatorMapKey ¶
GetValidatorMapKey returns validator map
func HandleMsgSignerUpdate ¶
func HandleMsgSignerUpdate(ctx sdk.Context, msg types.MsgSignerUpdate, k Keeper, contractCaller helper.IContractCaller) sdk.Result
HandleMsgSignerUpdate handles signer update message
func HandleMsgStakeUpdate ¶
func HandleMsgStakeUpdate(ctx sdk.Context, msg types.MsgStakeUpdate, k Keeper, contractCaller helper.IContractCaller) sdk.Result
HandleMsgStakeUpdate handles stake update message
func HandleMsgValidatorExit ¶
func HandleMsgValidatorExit(ctx sdk.Context, msg types.MsgValidatorExit, k Keeper, contractCaller helper.IContractCaller) sdk.Result
HandleMsgValidatorExit handle msg validator exit
func HandleMsgValidatorJoin ¶
func HandleMsgValidatorJoin(ctx sdk.Context, msg types.MsgValidatorJoin, k Keeper, contractCaller helper.IContractCaller) sdk.Result
HandleMsgValidatorJoin msg validator join
func InitGenesis ¶
func InitGenesis(ctx sdk.Context, keeper Keeper, data types.GenesisState)
InitGenesis sets distribution information for genesis.
func NewHandler ¶
func NewHandler(k Keeper, contractCaller helper.IContractCaller) sdk.Handler
NewHandler new handler
func NewPostTxHandler ¶ added in v0.1.7
func NewPostTxHandler(k Keeper, contractCaller helper.IContractCaller) hmTypes.PostTxHandler
NewPostTxHandler returns a side handler for "bank" type messages.
func NewQuerier ¶
func NewQuerier(keeper Keeper, contractCaller helper.IContractCaller) sdk.Querier
NewQuerier returns querier for staking Rest endpoints
func NewSideTxHandler ¶ added in v0.1.7
func NewSideTxHandler(k Keeper, contractCaller helper.IContractCaller) hmTypes.SideTxHandler
NewSideTxHandler returns a side handler for "staking" type messages.
func PostHandleMsgSignerUpdate ¶ added in v0.1.7
func PostHandleMsgSignerUpdate(ctx sdk.Context, k Keeper, msg types.MsgSignerUpdate, sideTxResult abci.SideTxResultType) sdk.Result
PostHandleMsgSignerUpdate handles signer update message
func PostHandleMsgStakeUpdate ¶ added in v0.1.7
func PostHandleMsgStakeUpdate(ctx sdk.Context, k Keeper, msg types.MsgStakeUpdate, sideTxResult abci.SideTxResultType) sdk.Result
PostHandleMsgStakeUpdate handles stake update message
func PostHandleMsgValidatorExit ¶ added in v0.1.7
func PostHandleMsgValidatorExit(ctx sdk.Context, k Keeper, msg types.MsgValidatorExit, sideTxResult abci.SideTxResultType) sdk.Result
PostHandleMsgValidatorExit handle msg validator exit
func PostHandleMsgValidatorJoin ¶ added in v0.1.7
func PostHandleMsgValidatorJoin(ctx sdk.Context, k Keeper, msg types.MsgValidatorJoin, sideTxResult abci.SideTxResultType) sdk.Result
PostHandleMsgValidatorJoin msg validator join
func SideHandleMsgSignerUpdate ¶ added in v0.1.7
func SideHandleMsgSignerUpdate(ctx sdk.Context, msg types.MsgSignerUpdate, k Keeper, contractCaller helper.IContractCaller) (result abci.ResponseDeliverSideTx)
SideHandleMsgSignerUpdate handles signer update message
func SideHandleMsgStakeUpdate ¶ added in v0.1.7
func SideHandleMsgStakeUpdate(ctx sdk.Context, msg types.MsgStakeUpdate, k Keeper, contractCaller helper.IContractCaller) (result abci.ResponseDeliverSideTx)
SideHandleMsgStakeUpdate handles stake update message
func SideHandleMsgValidatorExit ¶ added in v0.1.7
func SideHandleMsgValidatorExit(ctx sdk.Context, msg types.MsgValidatorExit, k Keeper, contractCaller helper.IContractCaller) (result abci.ResponseDeliverSideTx)
SideHandleMsgValidatorExit handle side msg validator exit
func SideHandleMsgValidatorJoin ¶ added in v0.1.7
func SideHandleMsgValidatorJoin(ctx sdk.Context, msg types.MsgValidatorJoin, k Keeper, contractCaller helper.IContractCaller) (result abci.ResponseDeliverSideTx)
SideHandleMsgValidatorJoin side msg validator join
Types ¶
type AppModule ¶
type AppModule struct { AppModuleBasic // contains filtered or unexported fields }
AppModule implements an application module for the supply module.
func NewAppModule ¶
func NewAppModule(keeper Keeper, contractCaller helper.IContractCaller) AppModule
NewAppModule creates a new AppModule object
func (AppModule) BeginBlock ¶
func (AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock)
BeginBlock returns the begin blocker for the auth module.
func (AppModule) EndBlock ¶
func (AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate
EndBlock returns the end blocker for the auth module. It returns no validator updates.
func (AppModule) ExportGenesis ¶
func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage
ExportGenesis returns the exported genesis state as raw bytes for the auth module.
func (AppModule) GenerateGenesisState ¶ added in v0.1.7
func (AppModule) GenerateGenesisState(simState *hmModule.SimulationState)
GenerateGenesisState creates a randomized GenState of the Staking module
func (AppModule) InitGenesis ¶
func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate
InitGenesis performs genesis initialization for the auth module. It returns no validator updates.
func (AppModule) NewHandler ¶
NewHandler returns an sdk.Handler for the module.
func (AppModule) NewPostTxHandler ¶ added in v0.1.7
func (am AppModule) NewPostTxHandler() hmTypes.PostTxHandler
NewPostTxHandler side tx handler
func (AppModule) NewQuerierHandler ¶
NewQuerierHandler returns the auth module sdk.Querier.
func (AppModule) NewSideTxHandler ¶ added in v0.1.7
func (am AppModule) NewSideTxHandler() hmTypes.SideTxHandler
func (AppModule) ProposalContents ¶ added in v0.1.7
func (AppModule) ProposalContents(simState hmModule.SimulationState) []simTypes.WeightedProposalContent
ProposalContents doesn't return any content functions.
func (AppModule) QuerierRoute ¶
QuerierRoute returns the staking module's querier route name.
func (AppModule) RandomizedParams ¶ added in v0.1.7
func (AppModule) RandomizedParams(r *rand.Rand) []simTypes.ParamChange
RandomizedParams creates randomized param changes for the simulator.
func (AppModule) RegisterInvariants ¶
func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry)
RegisterInvariants performs a no-op.
func (AppModule) RegisterStoreDecoder ¶ added in v0.1.7
func (AppModule) RegisterStoreDecoder(sdr hmModule.StoreDecoderRegistry)
RegisterStoreDecoder registers a decoder for chainmanager module's types
func (AppModule) WeightedOperations ¶ added in v0.1.7
func (AppModule) WeightedOperations(_ hmModule.SimulationState) []simTypes.WeightedOperation
WeightedOperations doesn't return any chainmanager module operation.
type AppModuleBasic ¶
type AppModuleBasic struct{}
AppModuleBasic defines the basic application module used by the auth module.
func (AppModuleBasic) DefaultGenesis ¶
func (AppModuleBasic) DefaultGenesis() json.RawMessage
DefaultGenesis returns default genesis state as raw bytes for the auth module.
func (AppModuleBasic) GetQueryCmd ¶
func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command
GetQueryCmd returns the root query command for the auth module.
func (AppModuleBasic) GetTxCmd ¶
func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command
GetTxCmd returns the root tx command for the auth module.
func (AppModuleBasic) Name ¶
func (AppModuleBasic) Name() string
Name returns the auth module's name.
func (AppModuleBasic) RegisterCodec ¶
func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)
RegisterCodec registers the auth module's types for the given codec.
func (AppModuleBasic) RegisterRESTRoutes ¶
func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)
RegisterRESTRoutes registers the REST routes for the auth module.
func (AppModuleBasic) ValidateGenesis ¶
func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error
ValidateGenesis performs genesis state validation for the auth module.
func (AppModuleBasic) VerifyGenesis ¶
func (AppModuleBasic) VerifyGenesis(bz map[string]json.RawMessage) error
VerifyGenesis performs verification on auth module state.
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper stores all related data
func NewKeeper ¶
func NewKeeper( cdc *codec.Codec, storeKey sdk.StoreKey, paramSpace subspace.Subspace, codespace sdk.CodespaceType, chainKeeper chainmanager.Keeper, moduleCommunicator ModuleCommunicator, ) Keeper
NewKeeper create new keeper
func (*Keeper) AddValidator ¶
AddValidator adds validator indexed with address
func (*Keeper) AddValidatorSigningInfo ¶ added in v0.1.7
func (k *Keeper) AddValidatorSigningInfo(ctx sdk.Context, valID hmTypes.ValidatorID, valSigningInfo hmTypes.ValidatorSigningInfo) error
Slashing api's AddValidatorSigningInfo creates a signing info for validator
func (Keeper) Codespace ¶
func (k Keeper) Codespace() sdk.CodespaceType
Codespace returns the codespace
func (*Keeper) GetActiveValidatorInfo ¶
func (k *Keeper) GetActiveValidatorInfo(ctx sdk.Context, address []byte) (validator hmTypes.Validator, err error)
GetActiveValidatorInfo returns active validator
func (*Keeper) GetAllValidators ¶
GetAllValidators returns all validators
func (*Keeper) GetCurrentProposer ¶
GetCurrentProposer returns current proposer
func (*Keeper) GetCurrentValidators ¶
GetCurrentValidators returns all validators who are in validator set
func (*Keeper) GetLastUpdated ¶
func (k *Keeper) GetLastUpdated(ctx sdk.Context, valID hmTypes.ValidatorID) (updatedAt string, found bool)
GetLastUpdated get last updated at for validator
func (*Keeper) GetNextProposer ¶
GetNextProposer returns next proposer
func (*Keeper) GetSignerFromValidatorID ¶
func (k *Keeper) GetSignerFromValidatorID(ctx sdk.Context, valID hmTypes.ValidatorID) (common.Address, bool)
GetSignerFromValidatorID get signer address from validator ID
func (*Keeper) GetSpanEligibleValidators ¶
GetSpanEligibleValidators returns current validators who are not getting deactivated in between next span
func (*Keeper) GetStakingSequences ¶
GetStakingSequences checks if Staking already exists
func (*Keeper) GetTotalPower ¶ added in v0.1.7
func (*Keeper) GetValidatorFromValID ¶
func (k *Keeper) GetValidatorFromValID(ctx sdk.Context, valID hmTypes.ValidatorID) (validator hmTypes.Validator, ok bool)
GetValidatorFromValID returns signer from validator ID
func (*Keeper) GetValidatorInfo ¶
func (k *Keeper) GetValidatorInfo(ctx sdk.Context, address []byte) (validator hmTypes.Validator, err error)
GetValidatorInfo returns validator
func (*Keeper) GetValidatorSet ¶
func (k *Keeper) GetValidatorSet(ctx sdk.Context) (validatorSet hmTypes.ValidatorSet)
GetValidatorSet returns current Validator Set from store
func (*Keeper) HasStakingSequence ¶
HasStakingSequence checks if staking sequence already exists
func (*Keeper) IncrementAccum ¶
IncrementAccum increments accum for validator set by n times and replace validator set in store
func (*Keeper) IsCurrentValidatorByAddress ¶
IsCurrentValidatorByAddress check if validator is in current validator set by signer address
func (*Keeper) IterateCurrentValidatorsAndApplyFn ¶
func (k *Keeper) IterateCurrentValidatorsAndApplyFn(ctx sdk.Context, f func(validator *hmTypes.Validator) bool)
IterateCurrentValidatorsAndApplyFn iterate through current validators
func (*Keeper) IterateStakingSequencesAndApplyFn ¶
IterateStakingSequencesAndApplyFn interate validators and apply the given function.
func (*Keeper) IterateValidatorsAndApplyFn ¶
func (k *Keeper) IterateValidatorsAndApplyFn(ctx sdk.Context, f func(validator hmTypes.Validator) error)
IterateValidatorsAndApplyFn interate validators and apply the given function.
func (*Keeper) SetStakingSequence ¶
SetStakingSequence sets staking sequence
func (*Keeper) SetValidatorIDToSignerAddr ¶
func (k *Keeper) SetValidatorIDToSignerAddr(ctx sdk.Context, valID hmTypes.ValidatorID, signerAddr hmTypes.HeimdallAddress)
SetValidatorIDToSignerAddr sets mapping for validator ID to signer address
func (*Keeper) Slash ¶ added in v0.1.7
UpdatePower updates validator with signer and pubkey + validator => signer map
func (*Keeper) Unjail ¶ added in v0.1.7
func (k *Keeper) Unjail(ctx sdk.Context, valID hmTypes.ValidatorID)
Unjail a validator
func (*Keeper) UpdateSigner ¶
func (k *Keeper) UpdateSigner(ctx sdk.Context, newSigner hmTypes.HeimdallAddress, newPubkey hmTypes.PubKey, prevSigner hmTypes.HeimdallAddress) error
UpdateSigner updates validator with signer and pubkey + validator => signer map
func (*Keeper) UpdateValidatorSetInStore ¶
func (k *Keeper) UpdateValidatorSetInStore(ctx sdk.Context, newValidatorSet hmTypes.ValidatorSet) error
UpdateValidatorSetInStore adds validator set to store
type ModuleCommunicator ¶
type ModuleCommunicator interface { GetACKCount(ctx sdk.Context) uint64 SetCoins(ctx sdk.Context, addr hmTypes.HeimdallAddress, amt sdk.Coins) sdk.Error GetCoins(ctx sdk.Context, addr hmTypes.HeimdallAddress) sdk.Coins SendCoins(ctx sdk.Context, from hmTypes.HeimdallAddress, to hmTypes.HeimdallAddress, amt sdk.Coins) sdk.Error CreateValidatorSigningInfo(ctx sdk.Context, valID hmTypes.ValidatorID, valSigningInfo hmTypes.ValidatorSigningInfo) }
ModuleCommunicator manages different module interaction