Documentation ¶
Index ¶
- Constants
- func MakeTestPubKey(pk string) crypto.PubKey
- type Keeper
- func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx sdk.Context) (updates []abci.ValidatorUpdate)
- func (k Keeper) CalculateValidatorVotes(ctx sdk.Context)
- func (k Keeper) Delete(ctx sdk.Context, key []byte, prefix []byte)
- func (k Keeper) DeleteAllVotesByValidator(ctx sdk.Context, voter sdk.ValAddress) bool
- func (k Keeper) DeleteVote(ctx sdk.Context, key []byte)
- func (k Keeper) Get(ctx sdk.Context, key []byte, prefix []byte, unmarshal UnmarshalFn) (i interface{}, found bool)
- func (k Keeper) GetAll(ctx sdk.Context, prefix []byte, unmarshal UnmarshalFn) (i []interface{})
- func (k Keeper) GetAllAcceptedValidators(ctx sdk.Context) (validators []types.Validator)
- func (k Keeper) GetAllValidators(ctx sdk.Context) (validators []types.Validator)
- func (k Keeper) GetAllValidatorsAcceptedAndInSet(ctx sdk.Context) (validators []types.Validator)
- func (k Keeper) GetAllValidatorsWithCondition(ctx sdk.Context, validatorSelector ValidatorSelectorFn) (validators []types.Validator)
- func (k Keeper) GetAllVotes(ctx sdk.Context) (votes []types.Vote)
- func (k Keeper) GetAllVotesForValidator(ctx sdk.Context, name string) (votes []types.Vote)
- func (k Keeper) GetAllVotesWithCondition(ctx sdk.Context, key []byte, voteSelector VoteSelectorFn) (votes []types.Vote)
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetValidator(ctx sdk.Context, key string) (types.Validator, bool)
- func (k Keeper) GetValidatorByAddress(ctx sdk.Context, valAddress sdk.ValAddress) (types.Validator, bool)
- func (k Keeper) GetVote(ctx sdk.Context, key []byte) (types.Vote, bool)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) Set(ctx sdk.Context, key []byte, prefix []byte, i interface{})
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetValidator(ctx sdk.Context, key string, validator types.Validator)
- func (k Keeper) SetValidatorIsAccepted(ctx sdk.Context, key string, validator types.Validator, isAccepted bool)
- func (k Keeper) SetValidatorIsAcceptedAndInSet(ctx sdk.Context, key string, validator types.Validator, isAccepted bool, ...)
- func (k Keeper) SetValidatorIsInSet(ctx sdk.Context, key string, validator types.Validator, isInSet bool)
- func (k Keeper) SetVote(ctx sdk.Context, vote types.Vote)
- func (k Keeper) UnmarshalValidator(value []byte) (interface{}, bool)
- func (k Keeper) UnmarshalVote(value []byte) (interface{}, bool)
- type SelectorFn
- type UnmarshalFn
- type ValidatorSelectorFn
- type VoteSelectorFn
Constants ¶
const ( SamplePubKey = "b7a3c12dc0c8c748ab07525b701122b88bd78f600c76342d27f25e5f92444cde" SamplePubKey2 = "b7a3c12dc0c8c748ab07525b701122b88bd78f600c76342d27f25e5f92444cdf" )
const (
DefaultParamspace = types.ModuleName
)
Variables ¶
This section is empty.
Functions ¶
func MakeTestPubKey ¶
Types ¶
type Keeper ¶
Keeper of the poa store
func NewKeeper ¶
func NewKeeper(coinKeeper bank.Keeper, cdc *codec.Codec, key sdk.StoreKey, paramspace params.Subspace) Keeper
NewKeeper creates a poa keeper
func (Keeper) ApplyAndReturnValidatorSetUpdates ¶
func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx sdk.Context) (updates []abci.ValidatorUpdate)
ApplyAndReturnValidatorSetUpdates at the end of every block we update and return the validator set
func (Keeper) CalculateValidatorVotes ¶
CalculateValidatorVote happens at the start of every block to ensure no malacious actors
func (Keeper) DeleteAllVotesByValidator ¶
func (Keeper) Get ¶
func (k Keeper) Get(ctx sdk.Context, key []byte, prefix []byte, unmarshal UnmarshalFn) (i interface{}, found bool)
Get gets an item from the store by bytes
func (Keeper) GetAll ¶
func (k Keeper) GetAll(ctx sdk.Context, prefix []byte, unmarshal UnmarshalFn) (i []interface{})
GetAll values from with a prefix from the store
func (Keeper) GetAllAcceptedValidators ¶
func (Keeper) GetAllValidators ¶
func (Keeper) GetAllValidatorsAcceptedAndInSet ¶
func (Keeper) GetAllValidatorsWithCondition ¶
func (Keeper) GetAllVotesForValidator ¶
func (Keeper) GetAllVotesWithCondition ¶
func (Keeper) GetValidator ¶
func (Keeper) GetValidatorByAddress ¶
func (Keeper) SetValidator ¶
func (Keeper) SetValidatorIsAccepted ¶
func (k Keeper) SetValidatorIsAccepted(ctx sdk.Context, key string, validator types.Validator, isAccepted bool)
SetValidatorIsAccepted when the validator is accepeted into the consensus accepted is set to true
func (Keeper) SetValidatorIsAcceptedAndInSet ¶
func (k Keeper) SetValidatorIsAcceptedAndInSet(ctx sdk.Context, key string, validator types.Validator, isAccepted bool, isInSet bool)
SetValidatorIsAccepted when the validator is accepeted into the consensus accepted is set to true and is in the validator set
func (Keeper) SetValidatorIsInSet ¶
func (k Keeper) SetValidatorIsInSet(ctx sdk.Context, key string, validator types.Validator, isInSet bool)
SetValidatorIsInSet after a validator has been accepted and not added to the set we need this function
func (Keeper) UnmarshalValidator ¶
func (Keeper) UnmarshalVote ¶
type SelectorFn ¶
type SelectorFn func(interface{}) bool
SelectorFn allows an entity to be selected by certain conditions
type UnmarshalFn ¶
UnmarshalFn is a generic function to unmarshal bytes
type ValidatorSelectorFn ¶
ValidatorSelectorFn allows validators to be selected by certain conditions
type VoteSelectorFn ¶
VoteSelectorFn allows validators to be selected by certain conditions