Documentation
¶
Index ¶
- func NewMsgServerImpl(keeper *Keeper) types.MsgServer
- func NewQueryServer(k *Keeper) types.QueryServer
- func NewSideMsgServerImpl(keeper *Keeper) sidetxs.SideMsgServer
- type Keeper
- func (k *Keeper) AddValidator(ctx context.Context, validator types.Validator) error
- func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx context.Context) (updates []abci.ValidatorUpdate, err error)
- func (k *Keeper) DoesValIdExist(ctx context.Context, valID uint64) (bool, error)
- func (k *Keeper) EndBlocker(ctx context.Context) ([]abci.ValidatorUpdate, error)
- func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k *Keeper) GetActiveValidatorInfo(ctx context.Context, address string) (validator types.Validator, err error)
- func (k *Keeper) GetAllValidators(ctx context.Context) (validators []*types.Validator)
- func (k *Keeper) GetCurrentProposer(ctx context.Context) *types.Validator
- func (k *Keeper) GetCurrentValidators(ctx context.Context) (validators []types.Validator)
- func (k Keeper) GetLastBlockTxs(ctx sdk.Context) (types.LastBlockTxs, error)
- func (k *Keeper) GetLastUpdated(ctx context.Context, valID uint64) (updatedAt string, err error)
- func (k *Keeper) GetMilestoneCurrentProposer(ctx context.Context) *types.Validator
- func (k *Keeper) GetMilestoneValidatorSet(ctx context.Context) (validatorSet types.ValidatorSet, err error)
- func (k *Keeper) GetNextProposer(ctx context.Context) *types.Validator
- func (k *Keeper) GetPreviousBlockValidatorSet(ctx context.Context) (validatorSet types.ValidatorSet, err error)
- func (k *Keeper) GetSignerFromValidatorID(ctx context.Context, valID uint64) (string, error)
- func (k *Keeper) GetSpanEligibleValidators(ctx context.Context) (validators []types.Validator)
- func (k *Keeper) GetStakingSequences(ctx context.Context) (sequences []string, err error)
- func (k *Keeper) GetTotalPower(ctx context.Context) (totalPower int64, err error)
- func (k *Keeper) GetValIdFromAddress(ctx context.Context, address string) (uint64, error)
- func (k *Keeper) GetValidatorFromValID(ctx context.Context, valID uint64) (validator types.Validator, err error)
- func (k *Keeper) GetValidatorInfo(ctx context.Context, address string) (validator types.Validator, err error)
- func (k *Keeper) GetValidatorSet(ctx context.Context) (validatorSet types.ValidatorSet, err error)
- func (k *Keeper) HasStakingSequence(ctx context.Context, sequence string) bool
- func (k *Keeper) IncrementAccum(ctx context.Context, times int) error
- func (k Keeper) InitGenesis(ctx context.Context, data *types.GenesisState) []abci.ValidatorUpdate
- func (k *Keeper) IsCurrentValidatorByAddress(ctx context.Context, address string) bool
- func (k Keeper) IterateCurrentValidatorsAndApplyFn(ctx context.Context, f func(validator types.Validator) bool) error
- func (k *Keeper) IterateStakingSequencesAndApplyFn(ctx context.Context, f func(sequence string) error) (e error)
- func (k *Keeper) IterateValidatorsAndApplyFn(ctx context.Context, f func(validator types.Validator) error)
- func (k Keeper) Logger(ctx context.Context) log.Logger
- func (k *Keeper) MilestoneIncrementAccum(ctx context.Context, times int)
- func (k *Keeper) PanicIfSetupIsIncomplete()
- func (k *Keeper) SetCheckpointKeeper(checkpointKeeper types.CheckpointKeeper)
- func (k Keeper) SetLastBlockTxs(ctx sdk.Context, txs [][]byte) error
- func (k *Keeper) SetStakingSequence(ctx context.Context, sequence string) error
- func (k *Keeper) SetValidatorIDToSignerAddr(ctx context.Context, valID uint64, signerAddr string)
- func (k *Keeper) UpdateMilestoneValidatorSetInStore(ctx context.Context, newValidatorSet types.ValidatorSet) error
- func (k *Keeper) UpdatePreviousBlockValidatorSetInStore(ctx context.Context, newValidatorSet types.ValidatorSet) error
- func (k *Keeper) UpdateSigner(ctx context.Context, newSigner string, newPubKey []byte, prevSigner string) error
- func (k *Keeper) UpdateValidatorSetInStore(ctx context.Context, newValidatorSet types.ValidatorSet) error
- func (k *Keeper) ValidatorAddressCodec() addresscodec.Codec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the staking MsgServer interface for the provided Keeper.
func NewQueryServer ¶
func NewQueryServer(k *Keeper) types.QueryServer
NewQueryServer creates a new querier for stake clients. It uses the underlying keeper and its contractCaller to interact with Ethereum chain.
func NewSideMsgServerImpl ¶
func NewSideMsgServerImpl(keeper *Keeper) sidetxs.SideMsgServer
NewSideMsgServerImpl returns an implementation of the staking MsgServer interface for the provided Keeper.
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper stores all stake related data
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, storeService storetypes.KVStoreService, bankKeeper types.BankKeeper, cmKeeper cmKeeper.Keeper, validatorAddressCodec addresscodec.Codec, contractCaller helper.IContractCaller, ) Keeper
NewKeeper creates a new stake Keeper instance
func (*Keeper) AddValidator ¶
AddValidator adds validator indexed with address
func (Keeper) ApplyAndReturnValidatorSetUpdates ¶
func (*Keeper) DoesValIdExist ¶
DoesValIdExist checks if validator ID exists in store
func (*Keeper) EndBlocker ¶
EndBlocker called at the end of every block, and returns validator updates
func (Keeper) ExportGenesis ¶
func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
ExportGenesis returns a GenesisState for the given stake context and keeper. The GenesisState will contain the validators and the staking sequences
func (*Keeper) GetActiveValidatorInfo ¶
func (k *Keeper) GetActiveValidatorInfo(ctx context.Context, address string) (validator types.Validator, err error)
GetActiveValidatorInfo returns active validator
func (*Keeper) GetAllValidators ¶
GetAllValidators returns all validators
func (*Keeper) GetCurrentProposer ¶
GetCurrentProposer returns the current proposer from the validator set
func (*Keeper) GetCurrentValidators ¶
GetCurrentValidators returns all validators who are in validator set
func (Keeper) GetLastBlockTxs ¶
GetLastBlockTxs gets the last block's txs from the store
func (*Keeper) GetLastUpdated ¶
GetLastUpdated get last updated at for validator
func (*Keeper) GetMilestoneCurrentProposer ¶
GetMilestoneCurrentProposer returns current proposer
func (*Keeper) GetMilestoneValidatorSet ¶
func (k *Keeper) GetMilestoneValidatorSet(ctx context.Context) (validatorSet types.ValidatorSet, err error)
GetMilestoneValidatorSet returns current milestone Validator Set from store
func (*Keeper) GetNextProposer ¶
GetNextProposer returns next proposer
func (*Keeper) GetPreviousBlockValidatorSet ¶
func (k *Keeper) GetPreviousBlockValidatorSet(ctx context.Context) (validatorSet types.ValidatorSet, err error)
GetPreviousBlockValidatorSet returns the previous block's validator set from store
func (*Keeper) GetSignerFromValidatorID ¶
GetSignerFromValidatorID gets the signer address from the validator id
func (*Keeper) GetSpanEligibleValidators ¶
GetSpanEligibleValidators returns current validators who are not getting deactivated in between next span
func (*Keeper) GetStakingSequences ¶
GetStakingSequences returns all the sequences appended together
func (*Keeper) GetTotalPower ¶
func (*Keeper) GetValIdFromAddress ¶
GetValIdFromAddress returns a validator's id given its address string
func (*Keeper) GetValidatorFromValID ¶
func (k *Keeper) GetValidatorFromValID(ctx context.Context, valID uint64) (validator types.Validator, err error)
GetValidatorFromValID returns signer from validator ID
func (*Keeper) GetValidatorInfo ¶
func (k *Keeper) GetValidatorInfo(ctx context.Context, address string) (validator types.Validator, err error)
GetValidatorInfo returns the validator info given its address
func (*Keeper) GetValidatorSet ¶
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) InitGenesis ¶
func (k Keeper) InitGenesis(ctx context.Context, data *types.GenesisState) []abci.ValidatorUpdate
InitGenesis sets validator information for genesis in x/stake module
func (*Keeper) IsCurrentValidatorByAddress ¶
IsCurrentValidatorByAddress check if validator is in current validator set by signer address
func (Keeper) IterateCurrentValidatorsAndApplyFn ¶
func (k Keeper) IterateCurrentValidatorsAndApplyFn(ctx context.Context, f func(validator types.Validator) bool) error
IterateCurrentValidatorsAndApplyFn iterate through current validators
func (*Keeper) IterateStakingSequencesAndApplyFn ¶
func (k *Keeper) IterateStakingSequencesAndApplyFn(ctx context.Context, f func(sequence string) error) (e error)
IterateStakingSequencesAndApplyFn iterates staking sequences and applies the given function.
func (*Keeper) IterateValidatorsAndApplyFn ¶
func (k *Keeper) IterateValidatorsAndApplyFn(ctx context.Context, f func(validator types.Validator) error)
IterateValidatorsAndApplyFn iterate validators and apply the given function.
func (*Keeper) MilestoneIncrementAccum ¶
MilestoneIncrementAccum increments accum for milestone validator set by n times and replace validator set in store
func (*Keeper) PanicIfSetupIsIncomplete ¶
func (k *Keeper) PanicIfSetupIsIncomplete()
PanicIfSetupIsIncomplete panics if the setup is incomplete, meaning that the checkpointKeeper is not set
func (*Keeper) SetCheckpointKeeper ¶
func (k *Keeper) SetCheckpointKeeper(checkpointKeeper types.CheckpointKeeper)
SetCheckpointKeeper sets the checkpoint keeper in the stake keeper This solves the circular dependency between the two keepers The setupComplete flag is set to true after the checkpoint keeper is set, otherwise all the functions will panic
func (Keeper) SetLastBlockTxs ¶
SetLastBlockTxs sets the last block's txs in the store
func (*Keeper) SetStakingSequence ¶
SetStakingSequence sets staking sequence
func (*Keeper) SetValidatorIDToSignerAddr ¶
SetValidatorIDToSignerAddr sets mapping for validator ID to signer address
func (*Keeper) UpdateMilestoneValidatorSetInStore ¶
func (k *Keeper) UpdateMilestoneValidatorSetInStore(ctx context.Context, newValidatorSet types.ValidatorSet) error
UpdateMilestoneValidatorSetInStore adds milestone validator set to store
func (*Keeper) UpdatePreviousBlockValidatorSetInStore ¶
func (k *Keeper) UpdatePreviousBlockValidatorSetInStore(ctx context.Context, newValidatorSet types.ValidatorSet) error
UpdatePreviousBlockValidatorSetInStore adds previous block's validator set to store
func (*Keeper) UpdateSigner ¶
func (k *Keeper) UpdateSigner(ctx context.Context, newSigner string, newPubKey []byte, prevSigner string) error
UpdateSigner updates validator fields in store
func (*Keeper) UpdateValidatorSetInStore ¶
func (k *Keeper) UpdateValidatorSetInStore(ctx context.Context, newValidatorSet types.ValidatorSet) error
UpdateValidatorSetInStore adds validator set to store
func (*Keeper) ValidatorAddressCodec ¶
func (k *Keeper) ValidatorAddressCodec() addresscodec.Codec
ValidatorAddressCodec return the validator address codec