testutil

package
v5.0.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertEqual

func AssertEqual(t *testing.T, exp, got any)

Types

type TestSuite

type TestSuite struct {
	suite.Suite

	App *chain.App
	Ctx sdk.Context
}

func (*TestSuite) AddLiquidity

func (s *TestSuite) AddLiquidity(ownerAddr 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) AssertEqual

func (s *TestSuite) AssertEqual(exp, got any)

func (*TestSuite) BeginBlock

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

func (*TestSuite) BurnShare

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

func (*TestSuite) CancelAllOrders

func (s *TestSuite) CancelAllOrders(ordererAddr sdk.AccAddress, marketId uint64) (orders []exchangetypes.Order)

func (*TestSuite) CancelOrder

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

func (*TestSuite) CheckEvent

func (s *TestSuite) CheckEvent(evtType proto.Message, attrs map[string][]byte)

func (*TestSuite) Collect

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

func (*TestSuite) CollectibleCoins

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

func (*TestSuite) CreateMarket

func (s *TestSuite) CreateMarket(baseDenom, quoteDenom string) exchangetypes.Market

func (*TestSuite) CreatePool

func (s *TestSuite) CreatePool(marketId uint64, price sdk.Dec) 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) CreatePublicFarmingPlan

func (s *TestSuite) CreatePublicFarmingPlan(description string, farmingPoolAddr sdk.AccAddress, termAddr sdk.AccAddress, rewardAllocs []ammtypes.FarmingRewardAllocation, startTime, endTime time.Time) (plan ammtypes.FarmingPlan)

func (*TestSuite) CreatePublicPosition

func (s *TestSuite) CreatePublicPosition(poolId uint64, lowerPrice, upperPrice sdk.Dec, minBidAmt sdk.Int, feeRate sdk.Dec) (publicPosition liquidammtypes.PublicPosition)

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, publicPositionId 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, qty sdk.Dec, lifespan time.Duration) (order exchangetypes.Order)

func (*TestSuite) PlaceBid

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

func (*TestSuite) PlaceLimitOrder

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

func (*TestSuite) PlaceMMBatchLimitOrder

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

func (*TestSuite) PlaceMMLimitOrder

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

func (*TestSuite) PlaceMarketOrder

func (s *TestSuite) PlaceMarketOrder(
	marketId uint64, ordererAddr sdk.AccAddress, isBuy bool, qty sdk.Dec) (orderId uint64, res exchangetypes.ExecuteOrderResult)

func (*TestSuite) RemoveLiquidity

func (s *TestSuite) RemoveLiquidity(ownerAddr 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.DecCoin, simulate bool) (output sdk.DecCoin, results []exchangetypes.SwapRouteResult)

Jump to

Keyboard shortcuts

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