testutil

package
v5.0.0-alpha1 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TestSuite

type TestSuite struct {
	suite.Suite

	App *chain.App
	Ctx sdk.Context
}

func (*TestSuite) AddLiquidity

func (s *TestSuite) AddLiquidity(ownerAddr, fromAddr sdk.AccAddress, poolId uint64, lowerPrice, upperPrice sdk.Dec, desiredAmt sdk.Coins) (position ammtypes.Position, liquidity sdk.Int, amt sdk.Coins)

func (*TestSuite) AdvanceRewardsAuctions

func (s *TestSuite) AdvanceRewardsAuctions()

func (*TestSuite) BeginBlock

func (s *TestSuite) BeginBlock(blockTimeDelta time.Duration)

func (*TestSuite) BurnShare

func (s *TestSuite) BurnShare(senderAddr sdk.AccAddress, liquidFarmId uint64, share sdk.Coin) (removedLiquidity sdk.Int, position ammtypes.Position, amt sdk.Coins)

func (*TestSuite) CancelOrder

func (s *TestSuite) CancelOrder(ordererAddr sdk.AccAddress, orderId uint64) (order exchangetypes.Order, refundedDeposit sdk.Coin)

func (*TestSuite) Collect

func (s *TestSuite) Collect(ownerAddr, toAddr sdk.AccAddress, positionId uint64, amt sdk.Coins)

func (*TestSuite) CollectibleCoins

func (s *TestSuite) CollectibleCoins(positionId uint64) (fee, farmingRewards sdk.Coins)

func (*TestSuite) CreateLiquidFarm

func (s *TestSuite) CreateLiquidFarm(poolId uint64, lowerPrice, upperPrice sdk.Dec, minBidAmt sdk.Int, feeRate sdk.Dec) (liquidFarm liquidfarmingtypes.LiquidFarm)

func (*TestSuite) CreateMarket

func (s *TestSuite) CreateMarket(creatorAddr sdk.AccAddress, baseDenom, quoteDenom string, fundFee bool) exchangetypes.Market

func (*TestSuite) CreatePool

func (s *TestSuite) CreatePool(creatorAddr sdk.AccAddress, marketId uint64, price sdk.Dec, fundFee bool) ammtypes.Pool

func (*TestSuite) CreatePrivateFarmingPlan

func (s *TestSuite) CreatePrivateFarmingPlan(creatorAddr sdk.AccAddress, description string, termAddr sdk.AccAddress, rewardAllocs []ammtypes.FarmingRewardAllocation, startTime, endTime time.Time, initialFunds sdk.Coins, fundFee bool) (plan ammtypes.FarmingPlan)

func (*TestSuite) EndBlock

func (s *TestSuite) EndBlock()

func (*TestSuite) FundAccount

func (s *TestSuite) FundAccount(
	addr sdk.AccAddress, amt sdk.Coins)

func (*TestSuite) FundedAccount

func (s *TestSuite) FundedAccount(addrNum int, amt sdk.Coins) sdk.AccAddress

func (*TestSuite) GetAllBalances

func (s *TestSuite) GetAllBalances(addr sdk.AccAddress) sdk.Coins

func (*TestSuite) GetBalance

func (s *TestSuite) GetBalance(addr sdk.AccAddress, denom string) sdk.Coin

func (*TestSuite) MintShare

func (s *TestSuite) MintShare(senderAddr sdk.AccAddress, liquidFarmId uint64, desiredAmt sdk.Coins, fund bool) (mintedShare sdk.Coin, position ammtypes.Position, liquidity sdk.Int, amt sdk.Coins)

func (*TestSuite) NextBlock

func (s *TestSuite) NextBlock()

func (*TestSuite) PlaceBatchLimitOrder

func (s *TestSuite) PlaceBatchLimitOrder(
	marketId uint64, ordererAddr sdk.AccAddress, isBuy bool, price sdk.Dec, qty sdk.Int, lifespan time.Duration) (order exchangetypes.Order)

func (*TestSuite) PlaceBid

func (s *TestSuite) PlaceBid(bidderAddr sdk.AccAddress, liquidFarmId, auctionId uint64, share sdk.Coin) (bid liquidfarmingtypes.Bid)

func (*TestSuite) PlaceLimitOrder

func (s *TestSuite) PlaceLimitOrder(
	marketId uint64, ordererAddr sdk.AccAddress, isBuy bool, price sdk.Dec, qty sdk.Int, lifespan time.Duration) (orderId uint64, order exchangetypes.Order, execQty sdk.Int, paid, received sdk.Coin)

func (*TestSuite) PlaceMarketOrder

func (s *TestSuite) PlaceMarketOrder(
	marketId uint64, ordererAddr sdk.AccAddress, isBuy bool, qty sdk.Int) (orderId uint64, execQty sdk.Int, paid, received sdk.Coin)

func (*TestSuite) RemoveLiquidity

func (s *TestSuite) RemoveLiquidity(ownerAddr, toAddr sdk.AccAddress, positionId uint64, liquidity sdk.Int) (position ammtypes.Position, amt sdk.Coins)

func (*TestSuite) SetupTest

func (s *TestSuite) SetupTest()

func (*TestSuite) SwapExactAmountIn

func (s *TestSuite) SwapExactAmountIn(
	ordererAddr sdk.AccAddress, routes []uint64, input, minOutput sdk.Coin, simulate bool) (output sdk.Coin, results []exchangetypes.SwapRouteResult)

Jump to

Keyboard shortcuts

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