examples

package
v2.16.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountKeeper

type AccountKeeper struct {
	AccountNumber collections.Sequence
	Accounts      collections.Map[sdk.AccAddress, types.BaseAccount]
	Params        collections.Item[types.Params]
}

func NewAccountKeeper

func NewAccountKeeper(sk storagetypes.StoreKey, cdc codec.BinaryCodec) *AccountKeeper

func (AccountKeeper) AccountsBetween

func (k AccountKeeper) AccountsBetween(ctx sdk.Context, start, end sdk.AccAddress) []types.BaseAccount

func (AccountKeeper) AllAccounts

func (k AccountKeeper) AllAccounts(ctx sdk.Context) []types.BaseAccount

func (AccountKeeper) AllAddresses

func (k AccountKeeper) AllAddresses(ctx sdk.Context) []sdk.AccAddress

func (AccountKeeper) CreateAccount

func (k AccountKeeper) CreateAccount(ctx sdk.Context, pubKey crypto.PubKey)

func (AccountKeeper) GetAccount

func (k AccountKeeper) GetAccount(ctx sdk.Context, addr sdk.AccAddress) (types.BaseAccount, error)

type StakingKeeper

type StakingKeeper struct {
	Delegations collections.Map[collections.Pair[sdk.ValAddress, sdk.AccAddress], types.Delegation]
}

func NewStakingKeeper

func NewStakingKeeper(sk storagetypes.StoreKey, cdc codec.BinaryCodec) *StakingKeeper

func (StakingKeeper) CreateDelegation

func (k StakingKeeper) CreateDelegation(ctx sdk.Context, val sdk.ValAddress, del sdk.AccAddress)

func (StakingKeeper) GetDelegation

func (k StakingKeeper) GetDelegation(ctx sdk.Context, val sdk.ValAddress, del sdk.AccAddress) (types.Delegation, error)

func (StakingKeeper) GetValidatorDelegations

func (k StakingKeeper) GetValidatorDelegations(ctx sdk.Context, val sdk.ValAddress) []types.Delegation

func (StakingKeeper) GetValidatorDelegationsBetween

func (k StakingKeeper) GetValidatorDelegationsBetween(ctx sdk.Context, val sdk.ValAddress, start sdk.AccAddress, end sdk.AccAddress) []types.Delegation

type StakingKeeper2

type StakingKeeper2 struct {
	Validators collections.IndexedMap[sdk.ValAddress, types.Validator, ValidatorIndexes]
}

func NewStakingKeeper2

func NewStakingKeeper2(sk storagetypes.StoreKey, cdc codec.BinaryCodec) *StakingKeeper2

func (StakingKeeper2) CreateValidator

func (k StakingKeeper2) CreateValidator(ctx sdk.Context, val types.Validator)

func (StakingKeeper2) GetValidatorsByConsAddress

func (k StakingKeeper2) GetValidatorsByConsAddress(ctx sdk.Context, consAddr sdk.ConsAddress) []types.Validator

type ValidatorIndexes

type ValidatorIndexes struct {
	// ConsensusAddress defines an Index of the validator structure which allows us
	// to get validators by their ConsensusAddress.
	ConsensusAddress collections.MultiIndex[sdk.ConsAddress, sdk.ValAddress, types.Validator]
}

ValidatorIndexes defines the indexes for the Validator IndexedMap. This structure just defines and groups together the indexes associated with a value of the IndexedMap.

func (ValidatorIndexes) IndexerList

IndexerList implements the collections.IndexersProvider interface. It consists on simply returning the list of the indexes (we have only one ConsensusAddress)

Jump to

Keyboard shortcuts

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