keeper

package
v0.32.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QProxy    = "proxy"
	QOperator = "operator"
)

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

func NewQuerier(k Keeper) sdk.Querier

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) 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

func (k Keeper) DeactivateProxy(ctx sdk.Context, operator sdk.ValAddress) error

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) GetMinProxyBalance

func (k Keeper) GetMinProxyBalance(ctx sdk.Context) sdk.Int

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) GetParams

func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)

GetParams gets the module's parameters

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) 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) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

Logger returns the logger

func (Keeper) SetParams

func (k Keeper) SetParams(ctx sdk.Context, set types.Params)

SetParams sets the module's parameters

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL