Documentation ¶
Index ¶
- Constants
- func NewMsgServerImpl(keeper Keeper) types.MsgServiceServer
- func NewQuerier(k Keeper) sdk.Querier
- func QueryValidators(ctx sdk.Context, k Keeper) ([]byte, error)
- type Keeper
- func (k Keeper) ActivateProxy(ctx sdk.Context, operator sdk.ValAddress, proxy sdk.AccAddress) error
- func (k Keeper) CreateSnapshot(ctx sdk.Context, candidates []sdk.ValAddress, ...) (exported.Snapshot, error)
- func (k Keeper) DeactivateProxy(ctx sdk.Context, operator sdk.ValAddress) error
- func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k Keeper) GetLatestSnapshot(ctx sdk.Context) (exported.Snapshot, bool)
- func (k Keeper) GetMinProxyBalance(ctx sdk.Context) sdk.Int
- func (k Keeper) GetOperator(ctx sdk.Context, proxy sdk.AccAddress) sdk.ValAddress
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetProxy(ctx sdk.Context, operator sdk.ValAddress) (addr sdk.AccAddress, active bool)
- func (k Keeper) GetSnapshot(ctx sdk.Context, counter int64) (exported.Snapshot, bool)
- func (k Keeper) GetValidatorIllegibility(ctx sdk.Context, validator exported.SDKValidator) (exported.ValidatorIllegibility, error)
- func (k Keeper) InitGenesis(ctx sdk.Context, genState *types.GenesisState)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) SetParams(ctx sdk.Context, set types.Params)
- func (k Keeper) TakeSnapshot(ctx sdk.Context, keyRequirement tss.KeyRequirement) (exported.Snapshot, error)
Constants ¶
const ( QProxy = "proxy" QOperator = "operator" QInfo = "info" QValidators = "validators" )
Query labels
Variables ¶
This section is empty.
Functions ¶
func NewMsgServerImpl ¶
func NewMsgServerImpl(keeper Keeper) types.MsgServiceServer
NewMsgServerImpl returns an implementation of the snapshot MsgServiceServer interface for the provided Keeper.
func NewQuerier ¶
NewQuerier returns a new querier for the evm module
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper represents the snapshot keeper
func NewKeeper ¶
func NewKeeper(cdc codec.BinaryCodec, key sdk.StoreKey, paramSpace params.Subspace, staking types.StakingKeeper, bank types.BankKeeper, slasher types.Slasher, tss types.Tss) Keeper
NewKeeper creates a new keeper for the staking module
func (Keeper) ActivateProxy ¶ added in v0.9.0
func (k Keeper) ActivateProxy(ctx sdk.Context, operator sdk.ValAddress, proxy sdk.AccAddress) error
ActivateProxy registers a proxy address for a given operator, which can broadcast messages in the principal's name The proxy will be marked as active and to be included in the next snapshot by default
func (Keeper) CreateSnapshot ¶ added in v0.21.0
func (k Keeper) CreateSnapshot( ctx sdk.Context, candidates []sdk.ValAddress, filterFunc func(exported.ValidatorI) bool, weightFunc func(consensusPower sdk.Uint) sdk.Uint, threshold utils.Threshold, ) (exported.Snapshot, error)
CreateSnapshot returns a new snapshot giving each candidate its proper weight, or returns an error if the threshold cannot be met given the total weight of all validators in the system; candidates are excluded if the given filterFunc is evaluated to false or their weight is zero (NOTE: snapshot itself does not keep track of the threshold)
func (Keeper) DeactivateProxy ¶
DeactivateProxy deactivates the proxy address for a given operator
func (Keeper) ExportGenesis ¶ added in v0.9.0
func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
ExportGenesis returns the reward module's genesis state.
func (Keeper) GetLatestSnapshot ¶
GetLatestSnapshot retrieves the last created snapshot
func (Keeper) GetMinProxyBalance ¶
GetMinProxyBalance returns the minimum balance proxies must hold
func (Keeper) GetOperator ¶
func (k Keeper) GetOperator(ctx sdk.Context, proxy sdk.AccAddress) sdk.ValAddress
GetOperator returns the principal address for a given proxy address. Returns nil if not set.
func (Keeper) GetProxy ¶
func (k Keeper) GetProxy(ctx sdk.Context, operator sdk.ValAddress) (addr sdk.AccAddress, active bool)
GetProxy returns the proxy address for a given operator address. Returns nil if not set. The bool value denotes wether or not the proxy is active and to be included in the next snapshot
func (Keeper) GetSnapshot ¶
GetSnapshot retrieves a snapshot by counter, if it exists
func (Keeper) GetValidatorIllegibility ¶
func (k Keeper) GetValidatorIllegibility(ctx sdk.Context, validator exported.SDKValidator) (exported.ValidatorIllegibility, error)
GetValidatorIllegibility returns the illegibility of the given validator
func (Keeper) InitGenesis ¶ added in v0.9.0
func (k Keeper) InitGenesis(ctx sdk.Context, genState *types.GenesisState)
InitGenesis initializes the reward module's state from a given genesis state.
func (Keeper) TakeSnapshot ¶
func (k Keeper) TakeSnapshot(ctx sdk.Context, keyRequirement tss.KeyRequirement) (exported.Snapshot, error)
TakeSnapshot attempts to create a new snapshot based on the given key requirment Deprecated