Documentation ¶
Index ¶
- func NewQuerier(k Keeper) sdk.Querier
- type Keeper
- func (k *Keeper) BehaviourSlashFraction(ctx sdk.Context, behaviourName string) (res sdk.Dec)
- func (k *Keeper) BehaviourWindow(ctx sdk.Context, behaviourName string) (res int64)
- func (k Keeper) GetAllEvidence(ctx sdk.Context) (evidence []exported.Evidence)
- func (k Keeper) GetBehaviourParams(ctx sdk.Context, behaviourName string) (params types.BehaviourParams)
- func (k Keeper) GetEvidence(ctx sdk.Context, hash tmbytes.HexBytes) (exported.Evidence, bool)
- func (k Keeper) GetEvidenceHandler(evidenceRoute string) (types.Handler, error)
- func (k Keeper) GetValidatorBehaviour(ctx sdk.Context, behaviourName string, address sdk.ValAddress) (validatorBehaviour types.ValidatorBehaviour)
- func (k Keeper) GetValidatorBehaviourBitArray(ctx sdk.Context, behaviourName string, address sdk.ValAddress, index int64) (mis bool)
- func (k Keeper) HandleBehaviour(ctx sdk.Context, behaviourKey string, validator sdk.ValAddress, height uint64, ...)
- func (k Keeper) IterateEvidence(ctx sdk.Context, cb func(exported.Evidence) bool)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MarshalEvidence(evidenceI exported.Evidence) ([]byte, error)
- func (k *Keeper) MaxMisbehaviourCount(ctx sdk.Context, behaviourName string) (res int64)
- func (k Keeper) MustMarshalEvidence(evidence exported.Evidence) []byte
- func (k Keeper) MustUnmarshalEvidence(bz []byte) exported.Evidence
- func (k Keeper) RecordMisbehaviourVoter(ctx sdk.Context)
- func (k Keeper) SetBehaviourParams(ctx sdk.Context, behaviourName string, params types.BehaviourParams)
- func (k Keeper) SetEvidence(ctx sdk.Context, evidence exported.Evidence)
- func (k *Keeper) SetRouter(rtr types.Router)
- func (k Keeper) SetValidatorBehaviour(ctx sdk.Context, behaviourName string, address sdk.ValAddress, ...)
- func (k *Keeper) SetValidatorBehaviourBitArray(ctx sdk.Context, behaviourName string, address sdk.ValAddress, index int64, ...)
- func (k Keeper) SubmitEvidence(ctx sdk.Context, evidence exported.Evidence) sdk.Error
- func (k Keeper) UnmarshalEvidence(bz []byte) (exported.Evidence, error)
- func (k Keeper) Vote(ctx sdk.Context, voteID string, voter sdk.CUAddress, vote exported.Vote, ...) (bool, bool, []*exported.VoteItem)
- func (k Keeper) VoteWithCustomBox(ctx sdk.Context, voteID string, voter sdk.CUAddress, vote exported.Vote, ...) (bool, bool, []*exported.VoteItem)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewQuerier ¶
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper of the evidence store
func NewKeeper ¶
func NewKeeper(cdc *codec.Codec, key sdk.StoreKey, paramSpace types.ParamSubspace, stakingKeeper types.StakingKeeper) Keeper
NewKeeper creates a evidence keeper
func (*Keeper) BehaviourSlashFraction ¶
func (*Keeper) BehaviourWindow ¶
func (Keeper) GetAllEvidence ¶
GetAllEvidence returns all stored Evidence objects.
func (Keeper) GetBehaviourParams ¶
func (Keeper) GetEvidence ¶
GetEvidence retrieves Evidence by hash if it exists. If no Evidence exists for the given hash, (nil, false) is returned.
func (Keeper) GetEvidenceHandler ¶
GetEvidenceHandler returns a registered Handler for a given Evidence type. If no handler exists, an error is returned.
func (Keeper) GetValidatorBehaviour ¶
func (k Keeper) GetValidatorBehaviour(ctx sdk.Context, behaviourName string, address sdk.ValAddress) (validatorBehaviour types.ValidatorBehaviour)
func (Keeper) GetValidatorBehaviourBitArray ¶
func (Keeper) HandleBehaviour ¶
func (Keeper) IterateEvidence ¶
IterateEvidence provides an interator over all stored Evidence objects. For each Evidence object, cb will be called. If the cb returns true, the iterator will close and stop.
func (Keeper) MarshalEvidence ¶
MarshalEvidence marshals an Evidence interface. If the given type implements the Marshaler interface, it is treated as a Proto-defined message and serialized that way. Otherwise, it falls back on the internal Amino codec.
func (*Keeper) MaxMisbehaviourCount ¶
func (Keeper) MustMarshalEvidence ¶
MustMarshalEvidence attempts to encode an Evidence object and returns the raw encoded bytes. It panics on error.
func (Keeper) MustUnmarshalEvidence ¶
MustUnmarshalEvidence attempts to decode and return an Evidence object from raw encoded bytes. It panics on error.
func (Keeper) RecordMisbehaviourVoter ¶
func (Keeper) SetBehaviourParams ¶
func (Keeper) SetEvidence ¶
SetEvidence sets Evidence by hash in the module's KVStore.
func (*Keeper) SetRouter ¶
SetRouter sets the Evidence Handler router for the x/evidence module. Note, we allow the ability to set the router after the Keeper is constructed as a given Handler may need access the Keeper before being constructed. The router may only be set once and will be sealed if it's not already sealed.
func (Keeper) SetValidatorBehaviour ¶
func (k Keeper) SetValidatorBehaviour(ctx sdk.Context, behaviourName string, address sdk.ValAddress, behavior types.ValidatorBehaviour)
func (*Keeper) SetValidatorBehaviourBitArray ¶
func (Keeper) SubmitEvidence ¶
SubmitEvidence attempts to match evidence against the keepers router and execute the corresponding registered Evidence Handler. An error is returned if no registered Handler exists or if the Handler fails. Otherwise, the evidence is persisted.
func (Keeper) UnmarshalEvidence ¶
UnmarshalEvidence returns an Evidence interface from raw encoded evidence bytes of a Proto-based Evidence type. An error is returned upon decoding failure.