keeper

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2022 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BatchLogicInvariantCheckFlag = false // It is only used at the development stage, and is disabled at the product level.

)

Functions

func AllInvariants

func AllInvariants(k Keeper) sdk.Invariant

AllInvariants runs all invariants of the liquidity module.

func BurningPoolCoinsInvariant

func BurningPoolCoinsInvariant(burnedPoolCoin, withdrawCoinA, withdrawCoinB, reserveCoinA, reserveCoinB, lastPoolCoinSupply sdk.Int, withdrawFeeCoins sdk.Coins)

BurningPoolCoinsInvariant checks the correct burning amount of pool coins.

func DepositInvariant

func DepositInvariant(lastReserveCoinA, lastReserveCoinB, depositCoinA, depositCoinB, afterReserveCoinA, afterReserveCoinB, refundedCoinA, refundedCoinB sdk.Int)

DepositInvariant checks after deposit amounts.

func ImmutablePoolPriceAfterWithdrawInvariant

func ImmutablePoolPriceAfterWithdrawInvariant(reserveCoinA, reserveCoinB, withdrawCoinA, withdrawCoinB, afterReserveCoinA, afterReserveCoinB sdk.Int)

ImmutablePoolPriceAfterWithdrawInvariant checks the immutable pool price after withdrawing coins.

func LiquidityPoolsEscrowAmountInvariant

func LiquidityPoolsEscrowAmountInvariant(k Keeper) sdk.Invariant

LiquidityPoolsEscrowAmountInvariant checks that outstanding unwithdrawn fees are never negative.

func MintingPoolCoinsInvariant

func MintingPoolCoinsInvariant(poolCoinTotalSupply, mintPoolCoin, depositCoinA, depositCoinB, lastReserveCoinA, lastReserveCoinB, refundedCoinA, refundedCoinB sdk.Int)

MintingPoolCoinsInvariant checks the correct ratio of minting amount of pool coins.

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the distribution MsgServer interface for the provided Keeper.

func NewQuerier

func NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier

NewQuerier creates a querier for liquidity REST endpoints

func RegisterInvariants

func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)

RegisterInvariants registers all liquidity invariants.

func WithdrawAmountInvariant

func WithdrawAmountInvariant(withdrawCoinA, withdrawCoinB, reserveCoinA, reserveCoinB, burnedPoolCoin, poolCoinSupply sdk.Int, withdrawFeeRate sdk.Dec)

WithdrawAmountInvariant checks the correct ratio of withdraw coin amounts.

func WithdrawReserveCoinsInvariant

func WithdrawReserveCoinsInvariant(withdrawCoinA, withdrawCoinB, reserveCoinA, reserveCoinB,
	afterReserveCoinA, afterReserveCoinB, afterPoolCoinTotalSupply, lastPoolCoinSupply, burnedPoolCoin sdk.Int)

WithdrawReserveCoinsInvariant checks the after withdraw amounts.

Types

type Keeper

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

Keeper of the liquidity store

func NewKeeper

func NewKeeper(cdc codec.BinaryCodec, key storetypes.StoreKey, paramSpace paramstypes.Subspace, bankKeeper types.BankKeeper, accountKeeper types.AccountKeeper, distrKeeper types.DistributionKeeper) Keeper

NewKeeper returns a liquidity keeper. It handles: - creating new ModuleAccounts for each pool ReserveAccount - sending to and from ModuleAccounts - minting, burning PoolCoins

func (Keeper) CreatePool

func (k Keeper) CreatePool(ctx sdk.Context, msg *types.MsgCreatePool) (types.Pool, error)

func (Keeper) DeleteAllReadyPoolBatchDepositMsgStates

func (k Keeper) DeleteAllReadyPoolBatchDepositMsgStates(ctx sdk.Context, poolBatch types.PoolBatch)

delete deposit batch msgs of the liquidity pool batch which has state ToBeDeleted

func (Keeper) DeleteAllReadyPoolBatchSwapMsgStates

func (k Keeper) DeleteAllReadyPoolBatchSwapMsgStates(ctx sdk.Context, poolBatch types.PoolBatch)

delete swap batch msgs of the liquidity pool batch which has state ToBeDeleted

func (Keeper) DeleteAllReadyPoolBatchWithdrawMsgStates

func (k Keeper) DeleteAllReadyPoolBatchWithdrawMsgStates(ctx sdk.Context, poolBatch types.PoolBatch)

delete withdraw batch msgs of the liquidity pool batch which has state ToBeDeleted

func (Keeper) DeleteAndInitPoolBatches

func (k Keeper) DeleteAndInitPoolBatches(ctx sdk.Context)

DeleteAndInitPoolBatches resets batch msg states that were previously executed and deletes msg states that were marked to be deleted.

func (Keeper) DeletePool

func (k Keeper) DeletePool(ctx sdk.Context, pool types.Pool)

delete from kvstore a specific liquidityPool

func (Keeper) DeletePoolBatch

func (k Keeper) DeletePoolBatch(ctx sdk.Context, poolBatch types.PoolBatch)

DeletePoolBatch deletes batch of the pool, it used for test case

func (Keeper) DeletePoolBatchSwapMsgState

func (k Keeper) DeletePoolBatchSwapMsgState(ctx sdk.Context, poolID uint64, msgIndex uint64)

Delete swap batch msg of the liquidity pool batch, it used for test case

func (Keeper) DepositWithinBatch

func (k Keeper) DepositWithinBatch(ctx sdk.Context, msg *types.MsgDepositWithinBatch) (types.DepositMsgState, error)

In order to deal with the batch at the same time, the coins of msgs are deposited in escrow.

func (Keeper) ExecuteDeposit

func (k Keeper) ExecuteDeposit(ctx sdk.Context, msg types.DepositMsgState, batch types.PoolBatch) error

func (Keeper) ExecutePoolBatches

func (k Keeper) ExecutePoolBatches(ctx sdk.Context)

ExecutePoolBatches executes the accumulated msgs in the batch. The order is (1)swap, (2)deposit, (3)withdraw.

func (Keeper) ExecuteWithdrawal

func (k Keeper) ExecuteWithdrawal(ctx sdk.Context, msg types.WithdrawMsgState, batch types.PoolBatch) error

ExecuteWithdrawal withdraws pool coin from the liquidity pool

func (Keeper) ExportGenesis

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

ExportGenesis returns the liquidity module's genesis state.

func (Keeper) GetAllDepositMsgStates

func (k Keeper) GetAllDepositMsgStates(ctx sdk.Context) (states []types.DepositMsgState)

GetAllDepositMsgStates returns all BatchDepositMsgs for all batches.

func (Keeper) GetAllNotProcessedPoolBatchSwapMsgStates

func (k Keeper) GetAllNotProcessedPoolBatchSwapMsgStates(ctx sdk.Context, poolBatch types.PoolBatch) (states []*types.SwapMsgState)

GetAllNotProcessedPoolBatchSwapMsgStates returns All only not processed swap msgs, not executed with not succeed and not toDelete BatchSwapMsgs indexed by the liquidityPoolBatch

func (Keeper) GetAllPoolBatchDepositMsgStatesNotToBeDeleted

func (k Keeper) GetAllPoolBatchDepositMsgStatesNotToBeDeleted(ctx sdk.Context, poolBatch types.PoolBatch) (states []types.DepositMsgState)

GetAllPoolBatchDepositMsgStatesNotToBeDeleted returns all Not toDelete BatchDepositMsgs indexed by the liquidityPoolBatch

func (Keeper) GetAllPoolBatchDepositMsgs

func (k Keeper) GetAllPoolBatchDepositMsgs(ctx sdk.Context, poolBatch types.PoolBatch) (states []types.DepositMsgState)

GetAllPoolBatchDepositMsgs returns all BatchDepositMsgs indexed by the pool batch

func (Keeper) GetAllPoolBatchSwapMsgStates

func (k Keeper) GetAllPoolBatchSwapMsgStates(ctx sdk.Context, poolBatch types.PoolBatch) (states []types.SwapMsgState)

GetAllPoolBatchSwapMsgStates returns all BatchSwapMsgs indexed by the liquidityPoolBatch

func (Keeper) GetAllPoolBatchSwapMsgStatesAsPointer

func (k Keeper) GetAllPoolBatchSwapMsgStatesAsPointer(ctx sdk.Context, poolBatch types.PoolBatch) (states []*types.SwapMsgState)

GetAllPoolBatchSwapMsgStatesAsPointer returns all BatchSwapMsgs pointer indexed by the liquidityPoolBatch

func (Keeper) GetAllPoolBatchSwapMsgStatesNotToBeDeleted

func (k Keeper) GetAllPoolBatchSwapMsgStatesNotToBeDeleted(ctx sdk.Context, poolBatch types.PoolBatch) (states []*types.SwapMsgState)

GetAllPoolBatchSwapMsgStatesNotToBeDeleted returns All only not to delete swap msgs

func (Keeper) GetAllPoolBatchWithdrawMsgStates

func (k Keeper) GetAllPoolBatchWithdrawMsgStates(ctx sdk.Context, poolBatch types.PoolBatch) (states []types.WithdrawMsgState)

GetAllPoolBatchWithdrawMsgStates returns all BatchWithdrawMsgs indexed by the liquidityPoolBatch

func (Keeper) GetAllPoolBatchWithdrawMsgStatesNotToBeDeleted

func (k Keeper) GetAllPoolBatchWithdrawMsgStatesNotToBeDeleted(ctx sdk.Context, poolBatch types.PoolBatch) (states []types.WithdrawMsgState)

GetAllPoolBatchWithdrawMsgStatesNotToBeDeleted returns all Not to delete BatchWithdrawMsgs indexed by the liquidityPoolBatch

func (Keeper) GetAllPoolBatches

func (k Keeper) GetAllPoolBatches(ctx sdk.Context) (poolBatches []types.PoolBatch)

GetAllPoolBatches returns all batches of the all existed liquidity pools

func (Keeper) GetAllPools

func (k Keeper) GetAllPools(ctx sdk.Context) (pools []types.Pool)

GetAllPools returns all liquidityPools used during genesis dump

func (Keeper) GetAllRemainingPoolBatchDepositMsgStates

func (k Keeper) GetAllRemainingPoolBatchDepositMsgStates(ctx sdk.Context, poolBatch types.PoolBatch) (states []*types.DepositMsgState)

GetAllRemainingPoolBatchDepositMsgStates returns all remaining DepositMsgStates after endblock, which are executed but not to be deleted

func (Keeper) GetAllRemainingPoolBatchSwapMsgStates

func (k Keeper) GetAllRemainingPoolBatchSwapMsgStates(ctx sdk.Context, poolBatch types.PoolBatch) (states []*types.SwapMsgState)

GetAllRemainingPoolBatchSwapMsgStates returns All only remaining after endblock swap msgs, executed but not toDelete

func (Keeper) GetAllRemainingPoolBatchWithdrawMsgStates

func (k Keeper) GetAllRemainingPoolBatchWithdrawMsgStates(ctx sdk.Context, poolBatch types.PoolBatch) (states []*types.WithdrawMsgState)

GetAllRemainingPoolBatchWithdrawMsgStates returns All only remaining BatchWithdrawMsgs after endblock, executed but not toDelete

func (Keeper) GetAllSwapMsgStates

func (k Keeper) GetAllSwapMsgStates(ctx sdk.Context) (states []types.SwapMsgState)

GetAllSwapMsgStates returns all BatchSwapMsgs of all batches

func (Keeper) GetAllWithdrawMsgStates

func (k Keeper) GetAllWithdrawMsgStates(ctx sdk.Context) (states []types.WithdrawMsgState)

GetAllWithdrawMsgStates returns all BatchWithdrawMsgs for all batches

func (Keeper) GetCircuitBreakerEnabled

func (k Keeper) GetCircuitBreakerEnabled(ctx sdk.Context) (enabled bool)

GetCircuitBreakerEnabled returns circuit breaker enabled param from the paramspace.

func (Keeper) GetNextPoolID

func (k Keeper) GetNextPoolID(ctx sdk.Context) uint64

GetNextPoolID returns next pool id for new pool, using index of latest pool id

func (Keeper) GetNextPoolIDWithUpdate

func (k Keeper) GetNextPoolIDWithUpdate(ctx sdk.Context) uint64

GetNextPoolIDWithUpdate returns and increments the global Pool ID counter. If the global account number is not set, it initializes it with value 0.

func (Keeper) GetParams

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

GetParams gets the parameters for the liquidity module.

func (Keeper) GetPool

func (k Keeper) GetPool(ctx sdk.Context, poolID uint64) (pool types.Pool, found bool)

GetPool reads from kvstore and returns a specific pool

func (Keeper) GetPoolBatch

func (k Keeper) GetPoolBatch(ctx sdk.Context, poolID uint64) (poolBatch types.PoolBatch, found bool)

GetPoolBatch returns a specific pool batch

func (Keeper) GetPoolBatchDepositMsgState

func (k Keeper) GetPoolBatchDepositMsgState(ctx sdk.Context, poolID, msgIndex uint64) (state types.DepositMsgState, found bool)

GetPoolBatchDepositMsgState returns a specific DepositMsgState

func (Keeper) GetPoolBatchSwapMsgState

func (k Keeper) GetPoolBatchSwapMsgState(ctx sdk.Context, poolID, msgIndex uint64) (state types.SwapMsgState, found bool)

return a specific SwapMsgState given the pool_id with the msg_index

func (Keeper) GetPoolBatchWithdrawMsgState

func (k Keeper) GetPoolBatchWithdrawMsgState(ctx sdk.Context, poolID, msgIndex uint64) (state types.WithdrawMsgState, found bool)

return a specific liquidityPoolBatchWithdrawMsg

func (Keeper) GetPoolByReserveAccIndex

func (k Keeper) GetPoolByReserveAccIndex(ctx sdk.Context, reserveAcc sdk.AccAddress) (pool types.Pool, found bool)

GetPoolByReserveAccIndex reads from kvstore and return a specific liquidityPool indexed by given reserve account

func (Keeper) GetPoolCoinTotal

func (k Keeper) GetPoolCoinTotal(ctx sdk.Context, pool types.Pool) sdk.Coin

GetPoolCoinTotal returns total supply of pool coin of the pool in form of sdk.Coin

func (Keeper) GetPoolCoinTotalSupply

func (k Keeper) GetPoolCoinTotalSupply(ctx sdk.Context, pool types.Pool) sdk.Int

GetPoolCoinTotalSupply returns total supply of pool coin of the pool in form of sdk.Int

func (Keeper) GetPoolMetaData

func (k Keeper) GetPoolMetaData(ctx sdk.Context, pool types.Pool) types.PoolMetadata

GetPoolMetaData returns metadata of the pool

func (Keeper) GetPoolRecord

func (k Keeper) GetPoolRecord(ctx sdk.Context, pool types.Pool) (types.PoolRecord, bool)

GetPoolRecord returns the liquidity pool record with the given pool information

func (Keeper) GetReserveCoins

func (k Keeper) GetReserveCoins(ctx sdk.Context, pool types.Pool) (reserveCoins sdk.Coins)

GetReserveCoins returns reserve coins from the liquidity pool

func (Keeper) HoldEscrow

func (k Keeper) HoldEscrow(ctx sdk.Context, depositor sdk.AccAddress, depositCoins sdk.Coins) error

HoldEscrow sends coins to the module account for an escrow.

func (Keeper) InitGenesis

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

InitGenesis initializes the liquidity module's state from a given genesis state.

func (Keeper) InitNextPoolBatch

func (k Keeper) InitNextPoolBatch(ctx sdk.Context, poolBatch types.PoolBatch) error

InitNextPoolBatch re-initializes the batch and increases the batch index.

func (Keeper) IsDepletedPool

func (k Keeper) IsDepletedPool(ctx sdk.Context, pool types.Pool) bool

IsDepletedPool returns true if the pool is depleted.

func (Keeper) IsPoolCoinDenom

func (k Keeper) IsPoolCoinDenom(ctx sdk.Context, denom string) bool

IsPoolCoinDenom returns true if the denom is a valid pool coin denom.

func (Keeper) IterateAllDepositMsgStates

func (k Keeper) IterateAllDepositMsgStates(ctx sdk.Context, cb func(state types.DepositMsgState) (stop bool))

IterateAllDepositMsgStates iterate through all of the DepositMsgState of all batches

func (Keeper) IterateAllPoolBatchDepositMsgStates

func (k Keeper) IterateAllPoolBatchDepositMsgStates(ctx sdk.Context, poolBatch types.PoolBatch, cb func(state types.DepositMsgState) (stop bool))

IterateAllPoolBatchDepositMsgStates iterate through all of the DepositMsgStates in the batch

func (Keeper) IterateAllPoolBatchSwapMsgStates

func (k Keeper) IterateAllPoolBatchSwapMsgStates(ctx sdk.Context, poolBatch types.PoolBatch, cb func(state types.SwapMsgState) (stop bool))

IterateAllPoolBatchSwapMsgStates iterate through all of the LiquidityPoolBatchSwapMsgs

func (Keeper) IterateAllPoolBatchWithdrawMsgStates

func (k Keeper) IterateAllPoolBatchWithdrawMsgStates(ctx sdk.Context, poolBatch types.PoolBatch, cb func(state types.WithdrawMsgState) (stop bool))

IterateAllPoolBatchWithdrawMsgStates iterate through all of the LiquidityPoolBatchWithdrawMsgs

func (Keeper) IterateAllPoolBatches

func (k Keeper) IterateAllPoolBatches(ctx sdk.Context, cb func(poolBatch types.PoolBatch) (stop bool))

IterateAllPoolBatches iterate through all of the pool batches

func (Keeper) IterateAllPools

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

IterateAllPools iterate through all of the liquidityPools

func (Keeper) IterateAllSwapMsgStates

func (k Keeper) IterateAllSwapMsgStates(ctx sdk.Context, cb func(state types.SwapMsgState) (stop bool))

IterateAllSwapMsgStates iterate through all of the SwapMsgState of all batches

func (Keeper) IterateAllWithdrawMsgStates

func (k Keeper) IterateAllWithdrawMsgStates(ctx sdk.Context, cb func(state types.WithdrawMsgState) (stop bool))

IterateAllWithdrawMsgStates iterate through all of the WithdrawMsgState of all batches

func (Keeper) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

Logger returns a module-specific logger.

func (Keeper) MintAndSendPoolCoin

func (k Keeper) MintAndSendPoolCoin(ctx sdk.Context, pool types.Pool, srcAddr, creatorAddr sdk.AccAddress, depositCoins sdk.Coins) (sdk.Coin, error)

func (Keeper) RefundDeposit

func (k Keeper) RefundDeposit(ctx sdk.Context, batchMsg types.DepositMsgState, batch types.PoolBatch) error

RefundDeposit refunds deposit amounts to the depositor

func (Keeper) RefundWithdrawal

func (k Keeper) RefundWithdrawal(ctx sdk.Context, batchMsg types.WithdrawMsgState, batch types.PoolBatch) error

RefundWithdrawal refunds pool coin of the liquidity pool to the withdrawer

func (Keeper) ReleaseEscrow

func (k Keeper) ReleaseEscrow(ctx sdk.Context, withdrawer sdk.AccAddress, withdrawCoins sdk.Coins) error

If batch messages have expired or have not been processed, coins that were deposited with this function are refunded to the escrow.

func (Keeper) ReleaseEscrowForMultiSend

func (k Keeper) ReleaseEscrowForMultiSend(withdrawer sdk.AccAddress, withdrawCoins sdk.Coins) (
	banktypes.Input, banktypes.Output, error)

Generate inputs and outputs to treat escrow refunds atomically.

func (Keeper) SetParams

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

SetParams sets the parameters for the liquidity module.

func (Keeper) SetPool

func (k Keeper) SetPool(ctx sdk.Context, pool types.Pool)

SetPool sets to kvstore a specific pool

func (Keeper) SetPoolAtomic

func (k Keeper) SetPoolAtomic(ctx sdk.Context, pool types.Pool) types.Pool

SetPoolAtomic sets pool with set global pool id index +1 and index by reserveAcc

func (Keeper) SetPoolBatch

func (k Keeper) SetPoolBatch(ctx sdk.Context, poolBatch types.PoolBatch)

SetPoolBatch sets batch of the pool, with current state

func (Keeper) SetPoolBatchDepositMsgState

func (k Keeper) SetPoolBatchDepositMsgState(ctx sdk.Context, poolID uint64, state types.DepositMsgState)

SetPoolBatchDepositMsgState sets deposit msg state of the pool batch, with current state

func (Keeper) SetPoolBatchDepositMsgStates

func (k Keeper) SetPoolBatchDepositMsgStates(ctx sdk.Context, poolID uint64, states []types.DepositMsgState)

SetPoolBatchDepositMsgStates sets deposit batch msgs of the pool batch, with current state

func (Keeper) SetPoolBatchDepositMsgStatesByPointer

func (k Keeper) SetPoolBatchDepositMsgStatesByPointer(ctx sdk.Context, poolID uint64, states []*types.DepositMsgState)

SetPoolBatchDepositMsgStatesByPointer sets deposit batch msgs of the pool batch, with current state using pointers

func (Keeper) SetPoolBatchSwapMsgState

func (k Keeper) SetPoolBatchSwapMsgState(ctx sdk.Context, poolID uint64, state types.SwapMsgState)

set swap batch msg of the liquidity pool batch, with current state

func (Keeper) SetPoolBatchSwapMsgStates

func (k Keeper) SetPoolBatchSwapMsgStates(ctx sdk.Context, poolID uint64, states []types.SwapMsgState)

set swap batch msgs of the liquidity pool batch, with current state

func (Keeper) SetPoolBatchSwapMsgStatesByPointer

func (k Keeper) SetPoolBatchSwapMsgStatesByPointer(ctx sdk.Context, poolID uint64, states []*types.SwapMsgState)

set swap batch msgs of the liquidity pool batch, with current state using pointers

func (Keeper) SetPoolBatchWithdrawMsgState

func (k Keeper) SetPoolBatchWithdrawMsgState(ctx sdk.Context, poolID uint64, state types.WithdrawMsgState)

set withdraw batch msg of the liquidity pool batch, with current state

func (Keeper) SetPoolBatchWithdrawMsgStates

func (k Keeper) SetPoolBatchWithdrawMsgStates(ctx sdk.Context, poolID uint64, states []types.WithdrawMsgState)

set withdraw batch msgs of the pool batch, with current state

func (Keeper) SetPoolBatchWithdrawMsgStatesByPointer

func (k Keeper) SetPoolBatchWithdrawMsgStatesByPointer(ctx sdk.Context, poolID uint64, states []*types.WithdrawMsgState)

set withdraw batch msgs of the liquidity pool batch, with current state using pointers

func (Keeper) SetPoolByReserveAccIndex

func (k Keeper) SetPoolByReserveAccIndex(ctx sdk.Context, pool types.Pool)

SetPoolByReserveAccIndex sets Index by ReserveAcc for pool duplication check

func (Keeper) SetPoolRecord

func (k Keeper) SetPoolRecord(ctx sdk.Context, record types.PoolRecord) types.PoolRecord

SetPoolRecord stores liquidity pool states

func (Keeper) ValidateGenesis

func (k Keeper) ValidateGenesis(ctx sdk.Context, genState types.GenesisState) error

ValidateGenesis validates the liquidity module's genesis state.

func (Keeper) ValidateMsgCreatePool

func (k Keeper) ValidateMsgCreatePool(ctx sdk.Context, msg *types.MsgCreatePool) error

func (Keeper) ValidateMsgDepositWithinBatch

func (k Keeper) ValidateMsgDepositWithinBatch(ctx sdk.Context, msg types.MsgDepositWithinBatch) error

ValidateMsgDepositWithinBatch validates MsgDepositWithinBatch

func (Keeper) ValidateMsgWithdrawWithinBatch

func (k Keeper) ValidateMsgWithdrawWithinBatch(ctx sdk.Context, msg types.MsgWithdrawWithinBatch) error

ValidateMsgWithdrawWithinBatch validates MsgWithdrawWithinBatch

func (Keeper) ValidatePool

func (k Keeper) ValidatePool(ctx sdk.Context, pool *types.Pool) error

ValidatePool validates logic for liquidity pool after set or before export

func (Keeper) ValidatePoolMetadata

func (k Keeper) ValidatePoolMetadata(ctx sdk.Context, pool *types.Pool, metaData *types.PoolMetadata) error

ValidatePoolMetadata validates logic for liquidity pool metadata

func (Keeper) ValidatePoolRecord

func (k Keeper) ValidatePoolRecord(ctx sdk.Context, record types.PoolRecord) error

ValidatePoolRecord validates liquidity pool record after init or after export

func (Keeper) WithdrawWithinBatch

func (k Keeper) WithdrawWithinBatch(ctx sdk.Context, msg *types.MsgWithdrawWithinBatch) (types.WithdrawMsgState, error)

In order to deal with the batch at the same time, the coins of msgs are deposited in escrow.

type Migrator

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

Migrator is a struct for handling in-place store migrations.

func NewMigrator

func NewMigrator(keeper Keeper) Migrator

NewMigrator returns a new Migrator.

func (Migrator) Migrate1to2

func (m Migrator) Migrate1to2(ctx sdk.Context) error

Migrate1to2 migrates from version 1 to 2.

type Querier

type Querier struct {
	Keeper
}

Querier is used as Keeper will have duplicate methods if used directly, and gRPC names take precedence over keeper.

func (Querier) LiquidityPool

LiquidityPool queries a liquidity pool with the given pool id.

func (Querier) LiquidityPoolBatch

LiquidityPoolBatch queries a liquidity pool batch with the given pool id.

func (Querier) LiquidityPoolByPoolCoinDenom

LiquidityPool queries a liquidity pool with the given pool coin denom.

func (Querier) LiquidityPoolByReserveAcc

LiquidityPool queries a liquidity pool with the given reserve account address.

func (Querier) LiquidityPools

Pools queries all liquidity pools currently existed with each liquidity pool with batch and metadata.

func (Querier) MakeQueryLiquidityPoolResponse

func (k Querier) MakeQueryLiquidityPoolResponse(pool types.Pool) (*types.QueryLiquidityPoolResponse, error)

MakeQueryLiquidityPoolResponse wraps MakeQueryLiquidityPoolResponse.

func (Querier) MakeQueryLiquidityPoolsResponse

func (k Querier) MakeQueryLiquidityPoolsResponse(pools types.Pools) (*[]types.QueryLiquidityPoolResponse, error)

MakeQueryLiquidityPoolsResponse wraps a list of QueryLiquidityPoolResponses.

func (Querier) Params

Params queries params of liquidity module.

func (Querier) PoolBatchDepositMsg

PoolBatchDepositMsg queries the pool batch deposit message with the msg_index of the liquidity pool.

func (Querier) PoolBatchDepositMsgs

PoolBatchDepositMsgs queries all pool batch deposit messages of the liquidity pool.

func (Querier) PoolBatchSwapMsg

PoolBatchSwapMsg queries the pool batch swap message with the message index of the liquidity pool.

func (Querier) PoolBatchSwapMsgs

PoolBatchSwapMsgs queries all pool batch swap messages of the liquidity pool.

func (Querier) PoolBatchWithdrawMsg

PoolBatchWithdrawMsg queries the pool batch withdraw message with the msg_index of the liquidity pool.

func (Querier) PoolBatchWithdrawMsgs

PoolBatchWithdrawMsgs queries all pool batch withdraw messages of the liquidity pool.

Jump to

Keyboard shortcuts

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