Documentation
¶
Index ¶
- Constants
- Variables
- func ParamKeyTable() subspace.KeyTable
- func RegisterCodec(cdc *codec.Codec)
- func SetGenesisStateToAppState(appState map[string]json.RawMessage, validators []*hmTypes.Validator, ...) (map[string]json.RawMessage, error)
- func ValidateGenesis(data GenesisState) error
- type GenesisState
- type GenesisValidator
- type MsgSignerUpdate
- func (msg MsgSignerUpdate) GetLogIndex() uint64
- func (msg MsgSignerUpdate) GetNonce() uint64
- func (msg MsgSignerUpdate) GetSideSignBytes() []byte
- func (msg MsgSignerUpdate) GetSignBytes() []byte
- func (msg MsgSignerUpdate) GetSigners() []sdk.AccAddress
- func (msg MsgSignerUpdate) GetTxHash() types.IrisHash
- func (msg MsgSignerUpdate) Route() string
- func (msg MsgSignerUpdate) Type() string
- func (msg MsgSignerUpdate) ValidateBasic() sdk.Error
- type MsgStakeUpdate
- func (msg MsgStakeUpdate) GetLogIndex() uint64
- func (msg MsgStakeUpdate) GetNonce() uint64
- func (msg MsgStakeUpdate) GetSideSignBytes() []byte
- func (msg MsgStakeUpdate) GetSignBytes() []byte
- func (msg MsgStakeUpdate) GetSigners() []sdk.AccAddress
- func (msg MsgStakeUpdate) GetTxHash() types.IrisHash
- func (msg MsgStakeUpdate) Route() string
- func (msg MsgStakeUpdate) Type() string
- func (msg MsgStakeUpdate) ValidateBasic() sdk.Error
- type MsgValidatorExit
- func (msg MsgValidatorExit) GetLogIndex() uint64
- func (msg MsgValidatorExit) GetNonce() uint64
- func (msg MsgValidatorExit) GetSideSignBytes() []byte
- func (msg MsgValidatorExit) GetSignBytes() []byte
- func (msg MsgValidatorExit) GetSigners() []sdk.AccAddress
- func (msg MsgValidatorExit) GetTxHash() types.IrisHash
- func (msg MsgValidatorExit) Route() string
- func (msg MsgValidatorExit) Type() string
- func (msg MsgValidatorExit) ValidateBasic() sdk.Error
- type MsgValidatorJoin
- func (msg MsgValidatorJoin) GetLogIndex() uint64
- func (msg MsgValidatorJoin) GetNonce() uint64
- func (msg MsgValidatorJoin) GetSideSignBytes() []byte
- func (msg MsgValidatorJoin) GetSignBytes() []byte
- func (msg MsgValidatorJoin) GetSigners() []sdk.AccAddress
- func (msg MsgValidatorJoin) GetTxHash() types.IrisHash
- func (msg MsgValidatorJoin) Route() string
- func (msg MsgValidatorJoin) Type() string
- func (msg MsgValidatorJoin) ValidateBasic() sdk.Error
- type QueryProposerParams
- type QuerySignerParams
- type QueryStakingSequenceParams
- type QueryValidatorParams
- type QueryValidatorStatusParams
Constants ¶
const ( // ModuleName is the name of the module ModuleName = "staking" // StoreKey is the store key string for zena StoreKey = ModuleName // RouterKey is the message route for zena RouterKey = ModuleName // QuerierRoute is the querier route for zena QuerierRoute = ModuleName // DefaultParamspace default name for parameter store DefaultParamspace = ModuleName // DefaultValPower default validator power DefaultValPower = 10 )
const ( QueryCurrentValidatorSet = "current-validator-set" QuerySigner = "signer" QueryValidator = "validator" QueryValidatorStatus = "validator-status" QueryProposer = "proposer" QueryTotalValidatorPower = "total-val-power" QueryCurrentProposer = "current-proposer" QueryProposerBonusPercent = "proposer-bonus-percent" QueryStakingSequence = "staking-sequence" QueryMilestoneProposer = "milestone-proposer" )
query endpoints supported by the staking Querier
const ( // DefaultProposerBonusPercent - Proposer Signer Reward Ratio DefaultProposerBonusPercent = int64(10) )
Variables ¶
var ( EventTypeNewProposer = "new-proposer" EventTypeValidatorJoin = "validator-join" EventTypeSignerUpdate = "signer-update" EventTypeStakeUpdate = "stake-update" EventTypeValidatorExit = "validator-exit" AttributeKeySigner = "signer" AttributeKeyDeactivationEpoch = "deactivation-epoch" AttributeKeyActivationEpoch = "activation-epoch" AttributeKeyValidatorID = "validator-id" AttributeKeyValidatorNonce = "validator-nonce" AttributeKeyUpdatedAt = "updated-at" AttributeValueCategory = ModuleName )
Checkpoint tags
var ModuleCdc *codec.Codec
ModuleCdc generic sealed codec to be used throughout module
var ParamStoreKeyProposerBonusPercent = []byte("proposerbonuspercent")
ParamStoreKeyProposerBonusPercent - Store's Key for Reward amount
Functions ¶
func ParamKeyTable ¶
ParamKeyTable type declaration for parameters
func RegisterCodec ¶
func SetGenesisStateToAppState ¶
func SetGenesisStateToAppState(appState map[string]json.RawMessage, validators []*hmTypes.Validator, currentValSet hmTypes.ValidatorSet) (map[string]json.RawMessage, error)
SetGenesisStateToAppState sets state into app state
func ValidateGenesis ¶
func ValidateGenesis(data GenesisState) error
ValidateGenesis performs basic validation of zena genesis data returning an error for any failed validation criteria.
Types ¶
type GenesisState ¶
type GenesisState struct {
Validators []*hmTypes.Validator `json:"validators" yaml:"validators"`
CurrentValSet hmTypes.ValidatorSet `json:"current_val_set" yaml:"current_val_set"`
StakingSequences []string `json:"staking_sequences" yaml:"staking_sequences"`
}
GenesisState is the checkpoint state that must be provided at genesis.
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
DefaultGenesisState returns a default genesis state
func GetGenesisStateFromAppState ¶
func GetGenesisStateFromAppState(appState map[string]json.RawMessage) GenesisState
GetGenesisStateFromAppState returns staking GenesisState given raw application genesis state
func NewGenesisState ¶
func NewGenesisState( validators []*hmTypes.Validator, currentValSet hmTypes.ValidatorSet, stakingSequences []string, ) GenesisState
NewGenesisState creates a new genesis state.
type GenesisValidator ¶
type GenesisValidator struct {
ID hmTypes.ValidatorID `json:"id"`
StartEpoch uint64 `json:"start_epoch"`
EndEpoch uint64 `json:"end_epoch"`
Nonce uint64 `json:"nonce"`
Power uint64 `json:"power"` // aka Amount
PubKey hmTypes.PubKey `json:"pub_key"`
Signer hmTypes.IrisAddress `json:"signer"`
}
GenesisValidator genesis validator
func (*GenesisValidator) IrisValidator ¶
func (v *GenesisValidator) IrisValidator() hmTypes.Validator
IrisValidator converts genesis validator validator to Iris validator
type MsgSignerUpdate ¶
type MsgSignerUpdate struct {
From hmTypes.IrisAddress `json:"from"`
ID hmTypes.ValidatorID `json:"id"`
NewSignerPubKey hmTypes.PubKey `json:"pubKey"`
TxHash hmTypes.IrisHash `json:"tx_hash"`
LogIndex uint64 `json:"log_index"`
BlockNumber uint64 `json:"block_number"`
Nonce uint64 `json:"nonce"`
}
MsgSignerUpdate signer update struct TODO add old signer sig check
func NewMsgSignerUpdate ¶
func (MsgSignerUpdate) GetLogIndex ¶
func (msg MsgSignerUpdate) GetLogIndex() uint64
GetLogIndex Returns log index
func (MsgSignerUpdate) GetNonce ¶
func (msg MsgSignerUpdate) GetNonce() uint64
GetNonce Returns nonce
func (MsgSignerUpdate) GetSideSignBytes ¶
func (msg MsgSignerUpdate) GetSideSignBytes() []byte
GetSideSignBytes returns side sign bytes
func (MsgSignerUpdate) GetSignBytes ¶
func (msg MsgSignerUpdate) GetSignBytes() []byte
func (MsgSignerUpdate) GetSigners ¶
func (msg MsgSignerUpdate) GetSigners() []sdk.AccAddress
func (MsgSignerUpdate) GetTxHash ¶
func (msg MsgSignerUpdate) GetTxHash() types.IrisHash
GetTxHash Returns tx hash
func (MsgSignerUpdate) Route ¶
func (msg MsgSignerUpdate) Route() string
func (MsgSignerUpdate) Type ¶
func (msg MsgSignerUpdate) Type() string
func (MsgSignerUpdate) ValidateBasic ¶
func (msg MsgSignerUpdate) ValidateBasic() sdk.Error
type MsgStakeUpdate ¶
type MsgStakeUpdate struct {
From hmTypes.IrisAddress `json:"from"`
ID hmTypes.ValidatorID `json:"id"`
NewAmount sdk.Int `json:"amount"`
TxHash hmTypes.IrisHash `json:"tx_hash"`
LogIndex uint64 `json:"log_index"`
BlockNumber uint64 `json:"block_number"`
Nonce uint64 `json:"nonce"`
}
MsgStakeUpdate represents stake update
func NewMsgStakeUpdate ¶
func NewMsgStakeUpdate(from hmTypes.IrisAddress, id uint64, newAmount sdk.Int, txhash hmTypes.IrisHash, logIndex uint64, blockNumber uint64, nonce uint64) MsgStakeUpdate
NewMsgStakeUpdate represents stake update
func (MsgStakeUpdate) GetLogIndex ¶
func (msg MsgStakeUpdate) GetLogIndex() uint64
GetLogIndex Returns log index
func (MsgStakeUpdate) GetSideSignBytes ¶
func (msg MsgStakeUpdate) GetSideSignBytes() []byte
GetSideSignBytes returns side sign bytes
func (MsgStakeUpdate) GetSignBytes ¶
func (msg MsgStakeUpdate) GetSignBytes() []byte
func (MsgStakeUpdate) GetSigners ¶
func (msg MsgStakeUpdate) GetSigners() []sdk.AccAddress
func (MsgStakeUpdate) GetTxHash ¶
func (msg MsgStakeUpdate) GetTxHash() types.IrisHash
GetTxHash Returns tx hash
func (MsgStakeUpdate) Route ¶
func (msg MsgStakeUpdate) Route() string
func (MsgStakeUpdate) Type ¶
func (msg MsgStakeUpdate) Type() string
func (MsgStakeUpdate) ValidateBasic ¶
func (msg MsgStakeUpdate) ValidateBasic() sdk.Error
type MsgValidatorExit ¶
type MsgValidatorExit struct {
From hmTypes.IrisAddress `json:"from"`
ID hmTypes.ValidatorID `json:"id"`
DeactivationEpoch uint64 `json:"deactivationEpoch"`
TxHash hmTypes.IrisHash `json:"tx_hash"`
LogIndex uint64 `json:"log_index"`
BlockNumber uint64 `json:"block_number"`
Nonce uint64 `json:"nonce"`
}
func NewMsgValidatorExit ¶
func NewMsgValidatorExit(from hmTypes.IrisAddress, id uint64, deactivationEpoch uint64, txhash hmTypes.IrisHash, logIndex uint64, blockNumber uint64, nonce uint64) MsgValidatorExit
func (MsgValidatorExit) GetLogIndex ¶
func (msg MsgValidatorExit) GetLogIndex() uint64
GetLogIndex Returns log index
func (MsgValidatorExit) GetNonce ¶
func (msg MsgValidatorExit) GetNonce() uint64
GetNonce Returns nonce
func (MsgValidatorExit) GetSideSignBytes ¶
func (msg MsgValidatorExit) GetSideSignBytes() []byte
GetSideSignBytes returns side sign bytes
func (MsgValidatorExit) GetSignBytes ¶
func (msg MsgValidatorExit) GetSignBytes() []byte
func (MsgValidatorExit) GetSigners ¶
func (msg MsgValidatorExit) GetSigners() []sdk.AccAddress
func (MsgValidatorExit) GetTxHash ¶
func (msg MsgValidatorExit) GetTxHash() types.IrisHash
GetTxHash Returns tx hash
func (MsgValidatorExit) Route ¶
func (msg MsgValidatorExit) Route() string
func (MsgValidatorExit) Type ¶
func (msg MsgValidatorExit) Type() string
func (MsgValidatorExit) ValidateBasic ¶
func (msg MsgValidatorExit) ValidateBasic() sdk.Error
type MsgValidatorJoin ¶
type MsgValidatorJoin struct {
From hmTypes.IrisAddress `json:"from"`
ID hmTypes.ValidatorID `json:"id"`
ActivationEpoch uint64 `json:"activationEpoch"`
Amount sdk.Int `json:"amount"`
SignerPubKey hmTypes.PubKey `json:"pub_key"`
TxHash hmTypes.IrisHash `json:"tx_hash"`
LogIndex uint64 `json:"log_index"`
BlockNumber uint64 `json:"block_number"`
Nonce uint64 `json:"nonce"`
}
func NewMsgValidatorJoin ¶
func NewMsgValidatorJoin( from hmTypes.IrisAddress, id uint64, activationEpoch uint64, amount sdk.Int, pubkey hmTypes.PubKey, txhash hmTypes.IrisHash, logIndex uint64, blockNumber uint64, nonce uint64, ) MsgValidatorJoin
NewMsgValidatorJoin creates new validator-join
func (MsgValidatorJoin) GetLogIndex ¶
func (msg MsgValidatorJoin) GetLogIndex() uint64
GetLogIndex Returns log index
func (MsgValidatorJoin) GetNonce ¶
func (msg MsgValidatorJoin) GetNonce() uint64
GetNonce Returns nonce
func (MsgValidatorJoin) GetSideSignBytes ¶
func (msg MsgValidatorJoin) GetSideSignBytes() []byte
GetSideSignBytes returns side sign bytes
func (MsgValidatorJoin) GetSignBytes ¶
func (msg MsgValidatorJoin) GetSignBytes() []byte
func (MsgValidatorJoin) GetSigners ¶
func (msg MsgValidatorJoin) GetSigners() []sdk.AccAddress
func (MsgValidatorJoin) GetTxHash ¶
func (msg MsgValidatorJoin) GetTxHash() types.IrisHash
GetTxHash Returns tx hash
func (MsgValidatorJoin) Route ¶
func (msg MsgValidatorJoin) Route() string
func (MsgValidatorJoin) Type ¶
func (msg MsgValidatorJoin) Type() string
func (MsgValidatorJoin) ValidateBasic ¶
func (msg MsgValidatorJoin) ValidateBasic() sdk.Error
type QueryProposerParams ¶
type QueryProposerParams struct {
Times uint64 `json:"times"`
}
QueryProposerParams defines the params for querying val status.
func NewQueryProposerParams ¶
func NewQueryProposerParams(times uint64) QueryProposerParams
NewQueryProposerParams creates a new instance of QueryProposerParams.
type QuerySignerParams ¶
type QuerySignerParams struct {
SignerAddress []byte `json:"signer_address"`
}
QuerySignerParams defines the params for querying by address
func NewQuerySignerParams ¶
func NewQuerySignerParams(signerAddress []byte) QuerySignerParams
NewQuerySignerParams creates a new instance of QuerySignerParams.
type QueryStakingSequenceParams ¶
QueryStakingSequenceParams defines the params for querying an account Sequence.
func NewQueryStakingSequenceParams ¶
func NewQueryStakingSequenceParams(txHash string, logIndex uint64) QueryStakingSequenceParams
NewQueryStakingSequenceParams creates a new instance of QueryStakingSequenceParams.
type QueryValidatorParams ¶
type QueryValidatorParams struct {
ValidatorID types.ValidatorID `json:"validator_id"`
}
QueryValidatorParams defines the params for querying val status.
func NewQueryValidatorParams ¶
func NewQueryValidatorParams(validatorID types.ValidatorID) QueryValidatorParams
NewQueryValidatorParams creates a new instance of QueryValidatorParams.
type QueryValidatorStatusParams ¶
type QueryValidatorStatusParams struct {
SignerAddress []byte
}
QueryValidatorStatusParams defines the params for querying val status.
func NewQueryValidatorStatusParams ¶
func NewQueryValidatorStatusParams(signerAddress []byte) QueryValidatorStatusParams
NewQueryValidatorStatusParams creates a new instance of QueryValidatorStatusParams.