keeper

package
v1.1.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 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, storeKey storetypes.StoreKey, accountKeeper types.AccountKeeper) *Keeper

func (*Keeper) CreateOrGetPoolByDenom

func (k *Keeper) CreateOrGetPoolByDenom(ctx sdk.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 sdk.Context) (poolID uint32, err error)

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

func (*Keeper) GetParams

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

GetParams returns the module parameters

func (*Keeper) GetPool

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

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 sdk.Context, denom string) (types.Pool, bool)

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 sdk.Context) []types.Pool

GetPools returns the list of stored pools

func (*Keeper) InitGenesis

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

InitGenesis initializes the genesis store using the provided data

func (*Keeper) IteratePools

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

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

func (*Keeper) Logger

func (k *Keeper) Logger(ctx sdk.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 sdk.Context, pool types.Pool) error

SavePool stores the given pool inside the store

func (*Keeper) SetNextPoolID

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

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

func (*Keeper) SetParams

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

SetParams sets module parameters

Jump to

Keyboard shortcuts

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