Documentation
¶
Index ¶
- func RegisterInvariants(ir sdk.InvariantRegistry, keeper *Keeper)
- func UniquePoolsInvariant(k *Keeper) sdk.Invariant
- func ValidPoolsInvariant(k *Keeper) sdk.Invariant
- type Keeper
- func (k *Keeper) CreateOrGetPoolByDenom(ctx sdk.Context, denom string) (types.Pool, error)
- func (k *Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k *Keeper) GetNextPoolID(ctx sdk.Context) (poolID uint32, err error)
- func (k *Keeper) GetParams(ctx sdk.Context) (p types.Params)
- func (k *Keeper) GetPool(ctx sdk.Context, id uint32) (types.Pool, bool)
- func (k *Keeper) GetPoolByDenom(ctx sdk.Context, denom string) (types.Pool, bool)
- func (k *Keeper) GetPools(ctx sdk.Context) []types.Pool
- func (k *Keeper) InitGenesis(ctx sdk.Context, data *types.GenesisState)
- func (k *Keeper) IteratePools(ctx sdk.Context, cb func(pool types.Pool) (stop bool))
- func (k *Keeper) Logger(ctx sdk.Context) log.Logger
- func (k *Keeper) PoolByDenom(ctx context.Context, request *types.QueryPoolByDenomRequest) (*types.QueryPoolResponse, error)
- func (k *Keeper) PoolById(ctx context.Context, request *types.QueryPoolByIdRequest) (*types.QueryPoolResponse, error)
- func (k *Keeper) Pools(ctx context.Context, request *types.QueryPoolsRequest) (*types.QueryPoolsResponse, error)
- func (k *Keeper) SavePool(ctx sdk.Context, pool types.Pool) error
- func (k *Keeper) SetNextPoolID(ctx sdk.Context, poolID uint32)
- func (k *Keeper) SetParams(ctx sdk.Context, params types.Params)
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 ¶
UniquePoolsInvariant checks that there are no duplicated pools for the same denom
func ValidPoolsInvariant ¶
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 ¶
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 ¶
GetNextPoolID returns the next pool ID to be used when registering a new Pool
func (*Keeper) GetPool ¶
GetPool retrieves the pool with the given ID from the store. If the pool does not exist, false is returned instead
func (*Keeper) GetPoolByDenom ¶
GetPoolByDenom returns the pool for the given denom if it exists. If the pool does not exist, false is returned instead
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 ¶
IteratePools iterates over the pools in the store and performs a callback function
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 ¶
func (k *Keeper) PoolById(ctx context.Context, request *types.QueryPoolByIdRequest) (*types.QueryPoolResponse, error)
PoolById implements the Query/PoolById gRPC method
func (*Keeper) Pools ¶
func (k *Keeper) Pools(ctx context.Context, request *types.QueryPoolsRequest) (*types.QueryPoolsResponse, error)
Pools implements the Query/Pools gRPC method
func (*Keeper) SetNextPoolID ¶
SetNextPoolID sets the next pool ID to be used when registering a new Pool