keeper

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterInvariants

func RegisterInvariants(ir sdk.InvariantRegistry, keeper *Keeper)

RegisterInvariants registers all pools module invariants

func UniquePoolsInvariant

func UniquePoolsInvariant(k *Keeper) sdk.Invariant

UniquePoolsInvariant checks that there are no duplicated pools for the same denom

func ValidPoolsInvariant

func ValidPoolsInvariant(k *Keeper) sdk.Invariant

ValidPoolsInvariant checks that all the pools are valid

Types

type Keeper

type Keeper struct {
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(cdc codec.Codec,
	storeService corestoretypes.KVStoreService,
	accountKeeper types.AccountKeeper,
) *Keeper

func (*Keeper) AfterPoolCreated

func (k *Keeper) AfterPoolCreated(ctx context.Context, poolID uint32) error

func (*Keeper) CreateOrGetPoolByDenom

func (k *Keeper) CreateOrGetPoolByDenom(ctx context.Context, denom string) (types.Pool, error)

CreateOrGetPoolByDenom creates a new pool for the given denom if it does not exist. If the pool already exists, no action is taken. In both cases, the pool is returned.

func (*Keeper) ExportGenesis

func (k *Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState

ExportGenesis returns a new GenesisState instance containing the information currently present inside the store

func (*Keeper) GetNextPoolID

func (k *Keeper) GetNextPoolID(ctx context.Context) (poolID uint32, err error)

GetNextPoolID returns the next pool ID to be used when registering a new Pool

func (*Keeper) GetPool

func (k *Keeper) GetPool(ctx context.Context, id uint32) (types.Pool, bool, error)

GetPool retrieves the pool with the given ID from the store. If the pool does not exist, false is returned instead

func (*Keeper) GetPoolByDenom

func (k *Keeper) GetPoolByDenom(ctx context.Context, denom string) (types.Pool, bool, error)

GetPoolByDenom returns the pool for the given denom if it exists. If the pool does not exist, false is returned instead

func (*Keeper) GetPools

func (k *Keeper) GetPools(ctx context.Context) ([]types.Pool, error)

GetPools returns the list of stored pools

func (*Keeper) InitGenesis

func (k *Keeper) InitGenesis(ctx sdk.Context, data *types.GenesisState) error

InitGenesis initializes the genesis store using the provided data

func (*Keeper) IsPoolAddress

func (k *Keeper) IsPoolAddress(ctx context.Context, address string) (bool, error)

IsPoolAddress returns true if the provided address is the address where the users' asset are kept when they perform a pool restaking.

func (*Keeper) IteratePools

func (k *Keeper) IteratePools(ctx context.Context, cb func(pool types.Pool) (stop bool, err error)) error

IteratePools iterates over the pools in the store and performs a callback function

func (*Keeper) Logger

func (k *Keeper) Logger(ctx context.Context) log.Logger

Logger returns a module-specific logger.

func (*Keeper) PoolByDenom

func (k *Keeper) PoolByDenom(ctx context.Context, request *types.QueryPoolByDenomRequest) (*types.QueryPoolResponse, error)

PoolByDenom implements the Query/PoolByDenom gRPC method

func (*Keeper) PoolByID

PoolByID implements the Query/PoolById gRPC method

func (*Keeper) Pools

Pools implements the Query/Pools gRPC method

func (*Keeper) SavePool

func (k *Keeper) SavePool(ctx context.Context, pool types.Pool) error

SavePool stores the given pool inside the store

func (*Keeper) SetHooks

func (k *Keeper) SetHooks(rs types.PoolsHooks) *Keeper

SetHooks allows to set the pools hooks

func (*Keeper) SetNextPoolID

func (k *Keeper) SetNextPoolID(ctx context.Context, poolID uint32) error

SetNextPoolID sets the next pool ID to be used when registering a new Pool

Jump to

Keyboard shortcuts

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