keeper

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewQueryServerImpl

func NewQueryServerImpl(k Keeper) types.QueryServer

NewQueryServerImpl returns an implementation of the QueryServer interface for the provided Keeper.

Types

type Keeper

type Keeper struct {
	Schema collections.Schema
	Params collections.Item[types.Params]
	// (token,validator) => locking, it's used for updating power when the token weight is updated
	Locking collections.Map[collections.Pair[string, sdktypes.ConsAddress], math.Int]
	// (power,validator) => int64(power), it's used for getting validators of top-k power
	PowerRanking collections.KeySet[collections.Pair[uint64, sdktypes.ConsAddress]]
	ValidatorSet collections.Map[sdktypes.ConsAddress, uint64]
	Validators   collections.Map[sdktypes.ConsAddress, types.Validator]
	Tokens       collections.Map[string, types.Token]
	Threshold    collections.Item[types.Threshold]
	Slashed      collections.Map[string, math.Int]
	EthTxNonce   collections.Sequence
	RewardPool   collections.Item[types.RewardPool]
	EthTxQueue   collections.Item[types.EthTxQueue]
	UnlockQueue  collections.Map[time.Time, types.Unlocks]
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	addressCodec address.Codec,
	storeService store.KVStoreService,
	accountKeeper types.AccountKeeper,
	logger log.Logger,
) Keeper

func (Keeper) ActiveValidators

func (k Keeper) ActiveValidators(ctx context.Context) ([]cmttypes.GenesisValidator, error)

func (Keeper) BeginBlocker

func (k Keeper) BeginBlocker(ctx context.Context) error

func (Keeper) Claim

func (k Keeper) Claim(ctx context.Context, reqs []*goattypes.ClaimRequest) error

func (*Keeper) Create

func (k *Keeper) Create(ctx context.Context, req []*goattypes.CreateRequest) error

func (Keeper) DequeueLockingModuleTx

func (k Keeper) DequeueLockingModuleTx(ctx context.Context) ([]*ethtypes.Transaction, error)

func (Keeper) DequeueMatureUnlocks

func (k Keeper) DequeueMatureUnlocks(ctx context.Context) error

func (Keeper) DistributeReward

func (k Keeper) DistributeReward(ctx context.Context) error

func (Keeper) EndBlocker

func (k Keeper) EndBlocker(ctx context.Context) ([]abci.ValidatorUpdate, error)

func (Keeper) HandleEvidences

func (k Keeper) HandleEvidences(ctx context.Context) error

func (Keeper) HandleVoteInfos

func (k Keeper) HandleVoteInfos(ctx context.Context) error

func (Keeper) Lock

func (k Keeper) Lock(ctx context.Context, reqs []*goattypes.LockRequest) error

func (Keeper) Logger

func (k Keeper) Logger() log.Logger

Logger returns a module-specific logger.

func (Keeper) ProcessLockingRequest

func (k Keeper) ProcessLockingRequest(ctx context.Context, reqs goattypes.LockingRequests) error

func (Keeper) Unlock

func (k Keeper) Unlock(ctx context.Context, reqs []*goattypes.UnlockRequest) error

func (Keeper) UpdateRewardPool

func (k Keeper) UpdateRewardPool(ctx context.Context, gas []*goattypes.GasRequest, grants []*goattypes.GrantRequest) error

func (Keeper) UpdateTokens

func (k Keeper) UpdateTokens(ctx context.Context, weights []*goattypes.UpdateTokenWeightRequest, thresholds []*goattypes.UpdateTokenThresholdRequest) error

Jump to

Keyboard shortcuts

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