Documentation ¶
Index ¶
- Constants
- Variables
- func CreateRandomAccounts(numAccts int) []sdk.AccAddress
- func GenerateTestAddrs() (string, string)
- func SkipIfWSL(t *testing.T)
- func TestMessageAuthzSerialization(t *testing.T, msg sdk.Msg)
- type ConcentratedKeeperTestHelper
- func (s *ConcentratedKeeperTestHelper) LowerUpperPricesToTick(lowerPrice, upperPrice osmomath.Dec, tickSpacing uint64) (int64, int64)
- func (s *ConcentratedKeeperTestHelper) PreparePoolWithCustSpread(spread osmomath.Dec) types.ConcentratedPoolExtension
- func (s *ConcentratedKeeperTestHelper) SetupAndFundSwapTest()
- func (s *ConcentratedKeeperTestHelper) SetupDefaultPosition(poolId uint64)
- func (s *ConcentratedKeeperTestHelper) SetupPosition(poolId uint64, owner sdk.AccAddress, providedCoins sdk.Coins, ...) (osmomath.Dec, uint64)
- func (s *ConcentratedKeeperTestHelper) SetupSecondPosition(test ConcentratedSwapTest, pool types.ConcentratedPoolExtension)
- func (s *ConcentratedKeeperTestHelper) SetupTest()
- type ConcentratedSwapTest
- type KeeperTestHelper
- func (s *KeeperTestHelper) AllocateRewardsToValidator(valAddr sdk.ValAddress, rewardAmt osmomath.Int)
- func (s *KeeperTestHelper) AssertEventEmitted(ctx sdk.Context, eventTypeExpected string, numEventsExpected int)
- func (s *KeeperTestHelper) BeginNewBlock(executeNextEpoch bool)
- func (s *KeeperTestHelper) BeginNewBlockWithProposer(executeNextEpoch bool, proposer sdk.ValAddress)
- func (s *KeeperTestHelper) BuildTx(txBuilder client.TxBuilder, msgs []sdk.Msg, sigV2 signing.SignatureV2, ...) authsigning.Tx
- func (s *KeeperTestHelper) CalcAmoutOfTokenToGetTargetPrice(ctx sdk.Context, pool gammtypes.CFMMPoolI, targetSpotPrice osmomath.Dec, ...) (amountTrade osmomath.Dec)
- func (s *KeeperTestHelper) Commit()
- func (s *KeeperTestHelper) CreateConcentratedPoolsAndFullRangePosition(poolDenoms [][]string)
- func (s *KeeperTestHelper) CreateConcentratedPoolsAndFullRangePositionWithSpreadFactor(poolDenoms [][]string, spreadFactor []osmomath.Dec)
- func (s *KeeperTestHelper) CreateFullRangePosition(pool types.ConcentratedPoolExtension, coins sdk.Coins) (uint64, osmomath.Dec)
- func (s *KeeperTestHelper) CreatePoolFromType(poolType poolmanagertypes.PoolType) uint64
- func (s *KeeperTestHelper) CreatePoolFromTypeWithCoins(poolType poolmanagertypes.PoolType, coins sdk.Coins) uint64
- func (s *KeeperTestHelper) CreatePoolFromTypeWithCoinsAndSpreadFactor(poolType poolmanagertypes.PoolType, coins sdk.Coins, spreadFactor osmomath.Dec) uint64
- func (s *KeeperTestHelper) CreateTestContext() sdk.Context
- func (s *KeeperTestHelper) CreateTestContextWithMultiStore() (sdk.Context, sdk.CommitMultiStore)
- func (s *KeeperTestHelper) EndBlock()
- func (s *KeeperTestHelper) ExecuteUpgradeFeeTokenProposal(feeToken string, poolId uint64) error
- func (s *KeeperTestHelper) ExtractAttributes(event sdk.Event) map[string]string
- func (s *KeeperTestHelper) FindEvent(events []sdk.Event, name string) sdk.Event
- func (s *KeeperTestHelper) FundAcc(acc sdk.AccAddress, amounts sdk.Coins)
- func (s *KeeperTestHelper) FundModuleAcc(moduleName string, amounts sdk.Coins)
- func (s *KeeperTestHelper) GetContractCode(contractName string) []byte
- func (s *KeeperTestHelper) GetContractCodeCustomProject(contractName string, projectName string, path string) []byte
- func (s *KeeperTestHelper) GetDefaultTransmuterInstantiateMsgBytes() []byte
- func (s *KeeperTestHelper) GetTransmuterInstantiateMsgBytes(poolAssetDenoms []string) []byte
- func (s *KeeperTestHelper) IncreaseVolumeForPools(poolIDs []uint64, volumesForEachPool []osmomath.Int)
- func (s *KeeperTestHelper) JoinTransmuterPool(lpAddress sdk.AccAddress, poolId uint64, coins sdk.Coins)
- func (s *KeeperTestHelper) LockTokens(addr sdk.AccAddress, coins sdk.Coins, duration time.Duration) (lockID uint64)
- func (s *KeeperTestHelper) LockTokensNoFund(addr sdk.AccAddress, coins sdk.Coins, duration time.Duration) (lockID uint64)
- func (s *KeeperTestHelper) MintCoins(coins sdk.Coins)
- func (s *KeeperTestHelper) ModifySpotPrice(poolID uint64, targetSpotPrice osmomath.Dec, baseDenom string)
- func (s *KeeperTestHelper) PrepareAllSupportedPools() SupportedPoolAndGaugeInfo
- func (s *KeeperTestHelper) PrepareAllSupportedPoolsCustomProject(projectName, transmuterPath string) SupportedPoolAndGaugeInfo
- func (s *KeeperTestHelper) PrepareBalancerPool() uint64
- func (s *KeeperTestHelper) PrepareBalancerPoolWithCoins(coins ...sdk.Coin) uint64
- func (s *KeeperTestHelper) PrepareBalancerPoolWithCoinsAndWeights(coins sdk.Coins, weights []int64) uint64
- func (s *KeeperTestHelper) PrepareBalancerPoolWithPoolParams(poolParams balancer.PoolParams) uint64
- func (s *KeeperTestHelper) PrepareBasicStableswapPool() uint64
- func (s *KeeperTestHelper) PrepareConcentratedPool() types.ConcentratedPoolExtension
- func (s *KeeperTestHelper) PrepareConcentratedPoolWithCoins(denom1, denom2 string) types.ConcentratedPoolExtension
- func (s *KeeperTestHelper) PrepareConcentratedPoolWithCoinsAndFullRangePosition(denom1, denom2 string) types.ConcentratedPoolExtension
- func (s *KeeperTestHelper) PrepareConcentratedPoolWithCoinsAndLockedFullRangePosition(denom1, denom2 string) (types.ConcentratedPoolExtension, uint64, uint64)
- func (s *KeeperTestHelper) PrepareCosmWasmPool() cosmwasmpooltypes.CosmWasmExtension
- func (s *KeeperTestHelper) PrepareCustomBalancerPool(assets []balancer.PoolAsset, params balancer.PoolParams) uint64
- func (s *KeeperTestHelper) PrepareCustomBalancerPoolFromCoins(coins sdk.Coins, params balancer.PoolParams) uint64
- func (s *KeeperTestHelper) PrepareCustomConcentratedPool(owner sdk.AccAddress, denom0, denom1 string, tickSpacing uint64, ...) types.ConcentratedPoolExtension
- func (s *KeeperTestHelper) PrepareCustomTransmuterPool(owner sdk.AccAddress, denoms []string) cosmwasmpooltypes.CosmWasmExtension
- func (s *KeeperTestHelper) PrepareCustomTransmuterPoolCustomProject(owner sdk.AccAddress, denoms []string, projectName, byteCodePath string) cosmwasmpooltypes.CosmWasmExtension
- func (s *KeeperTestHelper) PrepareImbalancedStableswapPool() uint64
- func (s *KeeperTestHelper) PrepareMultipleBalancerPools(poolsToCreate uint16) []uint64
- func (s *KeeperTestHelper) PrepareMultipleConcentratedPools(poolsToCreate uint16) []uint64
- func (s *KeeperTestHelper) RequireDecCoinsSlice(expected, actual []sdk.DecCoins)
- func (s *KeeperTestHelper) Reset()
- func (s *KeeperTestHelper) RunBasicExit(poolId uint64)
- func (s *KeeperTestHelper) RunBasicJoin(poolId uint64)
- func (s *KeeperTestHelper) RunBasicSwap(poolId uint64)
- func (s *KeeperTestHelper) RunMsg(msg sdk.Msg) (*sdk.Result, error)
- func (s *KeeperTestHelper) RunTestCaseWithoutStateUpdates(name string, cb func(t *testing.T))
- func (s *KeeperTestHelper) SetEpochStartTime()
- func (s *KeeperTestHelper) Setup()
- func (s *KeeperTestHelper) SetupConcentratedLiquidityDenomsAndPoolCreation()
- func (s *KeeperTestHelper) SetupGammPoolsWithBondDenomMultiplier(multipliers []osmomath.Dec) []gammtypes.CFMMPoolI
- func (s *KeeperTestHelper) SetupMultipleValidators(numValidator int) []string
- func (s *KeeperTestHelper) SetupTestForInitGenesis()
- func (s *KeeperTestHelper) SetupTxFeeAnteHandlerAndChargeFee(clientCtx client.Context, minGasPrices sdk.DecCoins, gasRequested uint64, ...) error
- func (s *KeeperTestHelper) SetupValidator(bondStatus stakingtypes.BondStatus) sdk.ValAddress
- func (s *KeeperTestHelper) SetupVolumeForPools(poolIDs []uint64, volumesForEachPool []osmomath.Int, ...)
- func (s *KeeperTestHelper) SetupWithCustomChainId(chainId string)
- func (s *KeeperTestHelper) SetupWithLevelDb() func()
- func (s *KeeperTestHelper) SkipIfWSL()
- func (s *KeeperTestHelper) StateNotAltered()
- func (s *KeeperTestHelper) StoreCosmWasmPoolContractCode(contractName string) uint64
- func (s *KeeperTestHelper) StoreCosmWasmPoolContractCodeCustomProject(contractName, projectName, byteCodePath string) uint64
- func (s *KeeperTestHelper) SuperfluidDelegateToDefaultVal(sender sdk.AccAddress, poolId uint64, lockId uint64) error
- func (s *KeeperTestHelper) SuperfluidDelegateToVal(sender sdk.AccAddress, poolId uint64, lockId uint64, valAddr string) error
- func (s *KeeperTestHelper) SwapAndSetSpotPrice(poolId uint64, fromAsset sdk.Coin, toAsset sdk.Coin) osmomath.BigDec
- func (s *KeeperTestHelper) ValidateGroupExists(gaugeID uint64)
- func (s *KeeperTestHelper) WithdrawFullRangePosition(pool types.ConcentratedPoolExtension, positionId uint64, ...)
- type SecondConcentratedPosition
- type SupportedPoolAndGaugeInfo
Constants ¶
const ( DefaultTransmuterDenomA = "axlusdc" DefaultTransmuterDenomB = "gravusdc" TransmuterContractName = "transmuter" TransmuterMigrateContractName = "transmuter_migrate" DefaultCodeId = 1 )
const ( BAR = "bar" BAZ = "baz" FOO = "foo" STAKE = "stake" )
Variables ¶
var ( WBTC = "ibc/D1542AA8762DB13087D8364F3EA6509FD6F009A34F00426AF9E4F9FA85CBBF1F" DefaultTickSpacing = uint64(100) DefaultLowerPrice = osmomath.NewDec(4545) DefaultLowerTick = int64(30545000) DefaultUpperPrice = osmomath.NewDec(5500) DefaultUpperTick = int64(31500000) DefaultCurrPrice = osmomath.NewDec(5000) DefaultCurrTick int64 = 31000000 DefaultCurrSqrtPrice = func() osmomath.BigDec { curSqrtPrice, _ := osmomath.MonotonicSqrt(DefaultCurrPrice) return osmomath.BigDecFromDec(curSqrtPrice) }() PerUnitLiqScalingFactor = osmomath.NewDec(1e15).MulMut(osmomath.NewDec(1e12)) DefaultSpreadRewardAccumCoins = sdk.NewDecCoins(sdk.NewDecCoinFromDec("foo", osmomath.NewDec(50).MulTruncate(PerUnitLiqScalingFactor))) DefaultCoinAmount = osmomath.NewInt(1000000000000000000) // Default tokens and amounts ETH = "eth" DefaultAmt0 = osmomath.NewInt(1000000) DefaultAmt0Expected = osmomath.NewInt(998976) DefaultCoin0 = sdk.NewCoin(ETH, DefaultAmt0) USDC = "usdc" DefaultAmt1 = osmomath.NewInt(5000000000) DefaultAmt1Expected = osmomath.NewInt(5000000000) DefaultCoin1 = sdk.NewCoin(USDC, DefaultAmt1) DefaultCoins = sdk.NewCoins(DefaultCoin0, DefaultCoin1) // Both of the following liquidity values are calculated in x/concentrated-liquidity/python/swap_test.py DefaultLiquidityAmt = osmomath.MustNewDecFromStr("1517882343.751510417627556287") FullRangeLiquidityAmt = osmomath.MustNewDecFromStr("70710678.118654752941000000") EmptyCoins = sdk.DecCoins(nil) // Various sqrt estimates Sqrt4994 = osmomath.MustNewDecFromStr("70.668238976219012614") // swap out given in test cases SwapOutGivenInCases = map[string]ConcentratedSwapTest{ "single position within one tick: usdc -> eth": { TokenIn: sdk.NewCoin("usdc", osmomath.NewInt(42000000)), TokenOutDenom: "eth", PriceLimit: osmomath.NewBigDec(5004), SpreadFactor: osmomath.ZeroDec(), ExpectedTokenIn: sdk.NewCoin("usdc", osmomath.NewInt(42000000)), ExpectedTokenOut: sdk.NewCoin("eth", osmomath.NewInt(8396)), ExpectedTick: 31003913, ExpectedSqrtPrice: osmomath.MustNewBigDecFromStr("70.738348247484497718514800000003600626"), }, "single position within one tick: usdc -> eth, with zero price limit": { TokenIn: sdk.NewCoin("usdc", osmomath.NewInt(42000000)), TokenOutDenom: "eth", PriceLimit: osmomath.ZeroBigDec(), SpreadFactor: osmomath.ZeroDec(), ExpectedTokenIn: sdk.NewCoin("usdc", osmomath.NewInt(42000000)), ExpectedTokenOut: sdk.NewCoin("eth", osmomath.NewInt(8396)), ExpectedTick: 31003913, ExpectedSqrtPrice: osmomath.MustNewBigDecFromStr("70.738348247484497718514800000003600626"), }, "single position within one tick: eth -> usdc": { TokenIn: sdk.NewCoin("eth", osmomath.NewInt(13370)), TokenOutDenom: "usdc", PriceLimit: osmomath.NewBigDec(4993), SpreadFactor: osmomath.ZeroDec(), ExpectedTokenIn: sdk.NewCoin("eth", osmomath.NewInt(13370)), ExpectedTokenOut: sdk.NewCoin("usdc", osmomath.NewInt(66808388)), ExpectedTick: 30993777, ExpectedSqrtPrice: osmomath.MustNewBigDecFromStr("70.666663910857144332134093938182290274"), }, "single position within one tick: eth -> usdc, with zero price limit": { TokenIn: sdk.NewCoin("eth", osmomath.NewInt(13370)), TokenOutDenom: "usdc", PriceLimit: osmomath.ZeroBigDec(), SpreadFactor: osmomath.ZeroDec(), ExpectedTokenIn: sdk.NewCoin("eth", osmomath.NewInt(13370)), ExpectedTokenOut: sdk.NewCoin("usdc", osmomath.NewInt(66808388)), ExpectedTick: 30993777, ExpectedSqrtPrice: osmomath.MustNewBigDecFromStr("70.666663910857144332134093938182290274"), }, "two positions within one tick: usdc -> eth": { TokenIn: sdk.NewCoin("usdc", osmomath.NewInt(42000000)), TokenOutDenom: "eth", PriceLimit: osmomath.NewBigDec(5002), SpreadFactor: osmomath.ZeroDec(), SecondPositionLowerPrice: DefaultLowerPrice, SecondPositionUpperPrice: DefaultUpperPrice, ExpectedTokenIn: sdk.NewCoin("usdc", osmomath.NewInt(42000000)), ExpectedTokenOut: sdk.NewCoin("eth", osmomath.NewInt(8398)), ExpectedTick: 31001956, ExpectedSqrtPrice: osmomath.MustNewBigDecFromStr("70.724513183069625079757400000001800313"), PoolLiqAmount0: osmomath.NewInt(1000000).MulRaw(2), PoolLiqAmount1: osmomath.NewInt(5000000000).MulRaw(2), }, "two positions within one tick: eth -> usdc": { TokenIn: sdk.NewCoin("eth", osmomath.NewInt(13370)), TokenOutDenom: "usdc", PriceLimit: osmomath.NewBigDec(4996), SpreadFactor: osmomath.ZeroDec(), SecondPositionLowerPrice: DefaultLowerPrice, SecondPositionUpperPrice: DefaultUpperPrice, ExpectedTokenIn: sdk.NewCoin("eth", osmomath.NewInt(13370)), ExpectedTokenOut: sdk.NewCoin("usdc", osmomath.NewInt(66829187)), ExpectedTick: 30996887, ExpectedSqrtPrice: osmomath.MustNewBigDecFromStr("70.688664163408836320215015370847179540"), PoolLiqAmount0: osmomath.NewInt(1000000).MulRaw(2), PoolLiqAmount1: osmomath.NewInt(5000000000).MulRaw(2), }, "two positions with consecutive price ranges: usdc -> eth": { TokenIn: sdk.NewCoin("usdc", osmomath.NewInt(10000000000)), TokenOutDenom: "eth", PriceLimit: osmomath.NewBigDec(6255), SpreadFactor: osmomath.ZeroDec(), SecondPositionLowerPrice: osmomath.NewDec(5500), SecondPositionUpperPrice: osmomath.NewDec(6250), ExpectedTokenIn: sdk.NewCoin("usdc", osmomath.NewInt(10000000000)), ExpectedTokenOut: sdk.NewCoin("eth", osmomath.NewInt(1820630)), ExpectedTick: 32105414, ExpectedSqrtPrice: osmomath.MustNewBigDecFromStr("78.137149196095607130096044752300452857"), ExpectedSecondLowerTickSpreadRewardGrowth: SecondConcentratedPosition{TickIndex: 322500, ExpectedSpreadRewardGrowth: EmptyCoins}, ExpectedSecondUpperTickSpreadRewardGrowth: SecondConcentratedPosition{TickIndex: 315000, ExpectedSpreadRewardGrowth: EmptyCoins}, NewLowerPrice: osmomath.NewDec(5500), NewUpperPrice: osmomath.NewDec(6250), }, "two positions with consecutive price ranges: eth -> usdc": { TokenIn: sdk.NewCoin("eth", osmomath.NewInt(2000000)), TokenOutDenom: "usdc", PriceLimit: osmomath.NewBigDec(3900), SpreadFactor: osmomath.ZeroDec(), SecondPositionLowerPrice: osmomath.NewDec(4000), SecondPositionUpperPrice: osmomath.NewDec(4545), ExpectedTokenIn: sdk.NewCoin("eth", osmomath.NewInt(2000000)), ExpectedTokenOut: sdk.NewCoin("usdc", osmomath.NewInt(9103422788)), ExpectedTick: 30095166, ExpectedSqrtPrice: osmomath.MustNewBigDecFromStr("63.993489023323078692803734142129673908"), ExpectedLowerTickSpreadRewardGrowth: DefaultSpreadRewardAccumCoins.MulDec(osmomath.NewDec(2)), ExpectedUpperTickSpreadRewardGrowth: DefaultSpreadRewardAccumCoins.MulDec(osmomath.NewDec(2)), ExpectedSecondLowerTickSpreadRewardGrowth: SecondConcentratedPosition{TickIndex: 300000, ExpectedSpreadRewardGrowth: EmptyCoins}, ExpectedSecondUpperTickSpreadRewardGrowth: SecondConcentratedPosition{TickIndex: 305450, ExpectedSpreadRewardGrowth: EmptyCoins}, NewLowerPrice: osmomath.NewDec(4000), NewUpperPrice: osmomath.NewDec(4545), }, "two positions with partially overlapping price ranges: usdc -> eth": { TokenIn: sdk.NewCoin("usdc", osmomath.NewInt(10000000000)), TokenOutDenom: "eth", PriceLimit: osmomath.NewBigDec(6056), SpreadFactor: osmomath.ZeroDec(), SecondPositionLowerPrice: osmomath.NewDec(5001), SecondPositionUpperPrice: osmomath.NewDec(6250), ExpectedTokenIn: sdk.NewCoin("usdc", osmomath.NewInt(10000000000)), ExpectedTokenOut: sdk.NewCoin("eth", osmomath.NewInt(1864161)), ExpectedTick: 32055919, ExpectedSqrtPrice: osmomath.MustNewBigDecFromStr("77.819789636800169393792766394158739007"), ExpectedLowerTickSpreadRewardGrowth: DefaultSpreadRewardAccumCoins, ExpectedUpperTickSpreadRewardGrowth: DefaultSpreadRewardAccumCoins, ExpectedSecondLowerTickSpreadRewardGrowth: SecondConcentratedPosition{TickIndex: 310010, ExpectedSpreadRewardGrowth: EmptyCoins}, ExpectedSecondUpperTickSpreadRewardGrowth: SecondConcentratedPosition{TickIndex: 322500, ExpectedSpreadRewardGrowth: EmptyCoins}, NewLowerPrice: osmomath.NewDec(5001), NewUpperPrice: osmomath.NewDec(6250), }, "two positions with partially overlapping price ranges, not utilizing full liquidity of second position: usdc -> eth": { TokenIn: sdk.NewCoin("usdc", osmomath.NewInt(8500000000)), TokenOutDenom: "eth", PriceLimit: osmomath.NewBigDec(6056), SpreadFactor: osmomath.ZeroDec(), SecondPositionLowerPrice: osmomath.NewDec(5001), SecondPositionUpperPrice: osmomath.NewDec(6250), ExpectedTokenIn: sdk.NewCoin("usdc", osmomath.NewInt(8500000000)), ExpectedTokenOut: sdk.NewCoin("eth", osmomath.NewInt(1609138)), ExpectedLowerTickSpreadRewardGrowth: DefaultSpreadRewardAccumCoins, ExpectedUpperTickSpreadRewardGrowth: DefaultSpreadRewardAccumCoins, ExpectedSecondLowerTickSpreadRewardGrowth: SecondConcentratedPosition{TickIndex: 310010, ExpectedSpreadRewardGrowth: EmptyCoins}, ExpectedSecondUpperTickSpreadRewardGrowth: SecondConcentratedPosition{TickIndex: 322500, ExpectedSpreadRewardGrowth: EmptyCoins}, ExpectedTick: 31712695, ExpectedSqrtPrice: osmomath.MustNewBigDecFromStr("75.582373164412551492069079174313215667"), NewLowerPrice: osmomath.NewDec(5001), NewUpperPrice: osmomath.NewDec(6250), }, "two positions with partially overlapping price ranges: eth -> usdc": { TokenIn: sdk.NewCoin("eth", osmomath.NewInt(2000000)), TokenOutDenom: "usdc", PriceLimit: osmomath.NewBigDec(4128), SpreadFactor: osmomath.ZeroDec(), SecondPositionLowerPrice: osmomath.NewDec(4000), SecondPositionUpperPrice: osmomath.NewDec(4999), ExpectedTokenIn: sdk.NewCoin("eth", osmomath.NewInt(2000000)), ExpectedTokenOut: sdk.NewCoin("usdc", osmomath.NewInt(9321276930)), ExpectedTick: 30129083, ExpectedSqrtPrice: osmomath.MustNewBigDecFromStr("64.257943794993248953756640624575523292"), ExpectedLowerTickSpreadRewardGrowth: DefaultSpreadRewardAccumCoins.MulDec(osmomath.NewDec(2)), ExpectedUpperTickSpreadRewardGrowth: DefaultSpreadRewardAccumCoins.MulDec(osmomath.NewDec(2)), ExpectedSecondLowerTickSpreadRewardGrowth: SecondConcentratedPosition{TickIndex: 300000, ExpectedSpreadRewardGrowth: EmptyCoins}, ExpectedSecondUpperTickSpreadRewardGrowth: SecondConcentratedPosition{TickIndex: 309990, ExpectedSpreadRewardGrowth: EmptyCoins}, NewLowerPrice: osmomath.NewDec(4000), NewUpperPrice: osmomath.NewDec(4999), }, "two positions with partially overlapping price ranges, not utilizing full liquidity of second position: eth -> usdc": { TokenIn: sdk.NewCoin("eth", osmomath.NewInt(1800000)), TokenOutDenom: "usdc", PriceLimit: osmomath.NewBigDec(4128), SpreadFactor: osmomath.ZeroDec(), SecondPositionLowerPrice: osmomath.NewDec(4000), SecondPositionUpperPrice: osmomath.NewDec(4999), ExpectedTokenIn: sdk.NewCoin("eth", osmomath.NewInt(1800000)), ExpectedTokenOut: sdk.NewCoin("usdc", osmomath.NewInt(8479320318)), ExpectedTick: 30292059, ExpectedSqrtPrice: osmomath.MustNewBigDecFromStr("65.513815285481060959469337552596846421"), ExpectedLowerTickSpreadRewardGrowth: DefaultSpreadRewardAccumCoins.MulDec(osmomath.NewDec(2)), ExpectedUpperTickSpreadRewardGrowth: DefaultSpreadRewardAccumCoins.MulDec(osmomath.NewDec(2)), ExpectedSecondLowerTickSpreadRewardGrowth: SecondConcentratedPosition{TickIndex: 300000, ExpectedSpreadRewardGrowth: EmptyCoins}, ExpectedSecondUpperTickSpreadRewardGrowth: SecondConcentratedPosition{TickIndex: 309990, ExpectedSpreadRewardGrowth: EmptyCoins}, NewLowerPrice: osmomath.NewDec(4000), NewUpperPrice: osmomath.NewDec(4999), }, "two sequential positions with a gap": { TokenIn: sdk.NewCoin("usdc", osmomath.NewInt(10000000000)), TokenOutDenom: "eth", PriceLimit: osmomath.NewBigDec(6106), SpreadFactor: osmomath.ZeroDec(), SecondPositionLowerPrice: osmomath.NewDec(5501), SecondPositionUpperPrice: osmomath.NewDec(6250), ExpectedTokenIn: sdk.NewCoin("usdc", osmomath.NewInt(10000000000)), ExpectedTokenOut: sdk.NewCoin("eth", osmomath.NewInt(1820545)), ExpectedTick: 32105555, ExpectedSqrtPrice: osmomath.MustNewBigDecFromStr("78.138055169663761658508234345605157554"), ExpectedLowerTickSpreadRewardGrowth: DefaultSpreadRewardAccumCoins, ExpectedUpperTickSpreadRewardGrowth: DefaultSpreadRewardAccumCoins, ExpectedSecondLowerTickSpreadRewardGrowth: SecondConcentratedPosition{TickIndex: 315010, ExpectedSpreadRewardGrowth: EmptyCoins}, ExpectedSecondUpperTickSpreadRewardGrowth: SecondConcentratedPosition{TickIndex: 322500, ExpectedSpreadRewardGrowth: EmptyCoins}, NewLowerPrice: osmomath.NewDec(5501), NewUpperPrice: osmomath.NewDec(6250), }, "single position within one tick, trade completes but slippage protection interrupts trade early: eth -> usdc": { TokenIn: sdk.NewCoin("eth", osmomath.NewInt(13370)), TokenOutDenom: "usdc", PriceLimit: osmomath.NewBigDec(4994), SpreadFactor: osmomath.ZeroDec(), ExpectedTokenIn: sdk.NewCoin("eth", osmomath.NewInt(12892)), ExpectedTokenOut: sdk.NewCoin("usdc", osmomath.NewInt(64417624)), ExpectedTick: func() int64 { tick, _ := clmath.SqrtPriceToTickRoundDownSpacing(osmomath.BigDecFromDec(Sqrt4994), DefaultTickSpacing) return tick }(), ExpectedSqrtPrice: osmomath.BigDecFromDec(osmomath.MustMonotonicSqrt(osmomath.NewDec(4994))), }, } )
var ( SecondaryDenom = "uion" SecondaryAmount = osmomath.NewInt(100000000) )
var DefaultAcctFunds sdk.Coins = sdk.NewCoins( sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(10000000000)), sdk.NewCoin(FOO, osmomath.NewInt(10000000000)), sdk.NewCoin(BAR, osmomath.NewInt(10000000000)), sdk.NewCoin(BAZ, osmomath.NewInt(10000000000)), )
var DefaultPoolAssets = []balancer.PoolAsset{ { Weight: osmomath.NewInt(100), Token: sdk.NewCoin(FOO, osmomath.NewInt(5000000)), }, { Weight: osmomath.NewInt(200), Token: sdk.NewCoin(BAR, osmomath.NewInt(5000000)), }, { Weight: osmomath.NewInt(300), Token: sdk.NewCoin(BAZ, osmomath.NewInt(5000000)), }, { Weight: osmomath.NewInt(400), Token: sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(5000000)), }, }
Functions ¶
func CreateRandomAccounts ¶
func CreateRandomAccounts(numAccts int) []sdk.AccAddress
CreateRandomAccounts is a function return a list of randomly generated AccAddresses
func GenerateTestAddrs ¶
Types ¶
type ConcentratedKeeperTestHelper ¶
type ConcentratedKeeperTestHelper struct { KeeperTestHelper Clk *cl.Keeper AuthorizedUptimes []time.Duration }
func (*ConcentratedKeeperTestHelper) LowerUpperPricesToTick ¶
func (*ConcentratedKeeperTestHelper) PreparePoolWithCustSpread ¶
func (s *ConcentratedKeeperTestHelper) PreparePoolWithCustSpread(spread osmomath.Dec) types.ConcentratedPoolExtension
func (*ConcentratedKeeperTestHelper) SetupAndFundSwapTest ¶
func (s *ConcentratedKeeperTestHelper) SetupAndFundSwapTest()
func (*ConcentratedKeeperTestHelper) SetupDefaultPosition ¶
func (s *ConcentratedKeeperTestHelper) SetupDefaultPosition(poolId uint64)
func (*ConcentratedKeeperTestHelper) SetupPosition ¶
func (*ConcentratedKeeperTestHelper) SetupSecondPosition ¶
func (s *ConcentratedKeeperTestHelper) SetupSecondPosition(test ConcentratedSwapTest, pool types.ConcentratedPoolExtension)
func (*ConcentratedKeeperTestHelper) SetupTest ¶
func (s *ConcentratedKeeperTestHelper) SetupTest()
type ConcentratedSwapTest ¶
type ConcentratedSwapTest struct { // Specific to swap out given in. TokenIn sdk.Coin TokenOutDenom string // Specific to swap in given out. TokenOut sdk.Coin TokenInDenom string // Shared. PriceLimit osmomath.BigDec SpreadFactor osmomath.Dec SecondPositionLowerPrice osmomath.Dec SecondPositionUpperPrice osmomath.Dec ExpectedTokenIn sdk.Coin ExpectedTokenOut sdk.Coin ExpectedTick int64 ExpectedSqrtPrice osmomath.BigDec ExpectedLowerTickSpreadRewardGrowth sdk.DecCoins ExpectedUpperTickSpreadRewardGrowth sdk.DecCoins ExpectedSpreadRewardGrowthAccumulatorValue osmomath.Dec // since we use different values for the seondary position's tick, save (tick, expectedSpreadRewardGrowth) tuple ExpectedSecondLowerTickSpreadRewardGrowth SecondConcentratedPosition ExpectedSecondUpperTickSpreadRewardGrowth SecondConcentratedPosition NewLowerPrice osmomath.Dec NewUpperPrice osmomath.Dec PoolLiqAmount0 osmomath.Int PoolLiqAmount1 osmomath.Int ExpectErr bool }
Defines a concentrated liquidity swap test case.
type KeeperTestHelper ¶
type KeeperTestHelper struct { suite.Suite App *app.OsmosisApp Ctx sdk.Context QueryHelper *baseapp.QueryServiceTestHelper TestAccs []sdk.AccAddress // contains filtered or unexported fields }
func (*KeeperTestHelper) AllocateRewardsToValidator ¶
func (s *KeeperTestHelper) AllocateRewardsToValidator(valAddr sdk.ValAddress, rewardAmt osmomath.Int)
AllocateRewardsToValidator allocates reward tokens to a distribution module then allocates rewards to the validator address.
func (*KeeperTestHelper) AssertEventEmitted ¶
func (s *KeeperTestHelper) AssertEventEmitted(ctx sdk.Context, eventTypeExpected string, numEventsExpected int)
AssertEventEmitted asserts that ctx's event manager has emitted the given number of events of the given type.
func (*KeeperTestHelper) BeginNewBlock ¶
func (s *KeeperTestHelper) BeginNewBlock(executeNextEpoch bool)
BeginNewBlock starts a new block.
func (*KeeperTestHelper) BeginNewBlockWithProposer ¶
func (s *KeeperTestHelper) BeginNewBlockWithProposer(executeNextEpoch bool, proposer sdk.ValAddress)
BeginNewBlockWithProposer begins a new block with a proposer.
func (*KeeperTestHelper) BuildTx ¶
func (s *KeeperTestHelper) BuildTx( txBuilder client.TxBuilder, msgs []sdk.Msg, sigV2 signing.SignatureV2, memo string, txFee sdk.Coins, gasLimit uint64, ) authsigning.Tx
BuildTx builds a transaction.
func (*KeeperTestHelper) CalcAmoutOfTokenToGetTargetPrice ¶
func (*KeeperTestHelper) Commit ¶
func (s *KeeperTestHelper) Commit()
CreateTestContext creates a test context.
func (*KeeperTestHelper) CreateConcentratedPoolsAndFullRangePosition ¶
func (s *KeeperTestHelper) CreateConcentratedPoolsAndFullRangePosition(poolDenoms [][]string)
createConcentratedPoolsFromCoins creates CL pools from given sets of coins (with zero swap fees). Where element 1 of the input corresponds to the first pool created, element 2 to the second pool created etc.
func (*KeeperTestHelper) CreateConcentratedPoolsAndFullRangePositionWithSpreadFactor ¶
func (s *KeeperTestHelper) CreateConcentratedPoolsAndFullRangePositionWithSpreadFactor(poolDenoms [][]string, spreadFactor []osmomath.Dec)
createConcentratedPoolsFromCoinsWithSpreadFactor creates CL pools from given sets of coins and respective swap fees. Where element 1 of the input corresponds to the first pool created, element 2 to the second pool created etc.
func (*KeeperTestHelper) CreateFullRangePosition ¶
func (s *KeeperTestHelper) CreateFullRangePosition(pool types.ConcentratedPoolExtension, coins sdk.Coins) (uint64, osmomath.Dec)
CreateFullRangePosition creates a full range position and returns position id and the liquidity created.
func (*KeeperTestHelper) CreatePoolFromType ¶
func (s *KeeperTestHelper) CreatePoolFromType(poolType poolmanagertypes.PoolType) uint64
CreatePoolFromType creates a basic pool of the given type for testing.
func (*KeeperTestHelper) CreatePoolFromTypeWithCoins ¶
func (s *KeeperTestHelper) CreatePoolFromTypeWithCoins(poolType poolmanagertypes.PoolType, coins sdk.Coins) uint64
CreatePoolFromTypeWithCoins creates a pool with the given type and initialized with the given coins.
func (*KeeperTestHelper) CreatePoolFromTypeWithCoinsAndSpreadFactor ¶
func (s *KeeperTestHelper) CreatePoolFromTypeWithCoinsAndSpreadFactor(poolType poolmanagertypes.PoolType, coins sdk.Coins, spreadFactor osmomath.Dec) uint64
CreatePoolFromTypeWithCoinsAndSpreadFactor creates a pool with given type, initialized with the given coins as initial liquidity and spread factor.
func (*KeeperTestHelper) CreateTestContext ¶
func (s *KeeperTestHelper) CreateTestContext() sdk.Context
CreateTestContext creates a test context.
func (*KeeperTestHelper) CreateTestContextWithMultiStore ¶
func (s *KeeperTestHelper) CreateTestContextWithMultiStore() (sdk.Context, sdk.CommitMultiStore)
CreateTestContextWithMultiStore creates a test context and returns it together with multi store.
func (*KeeperTestHelper) EndBlock ¶
func (s *KeeperTestHelper) EndBlock()
EndBlock ends the block, and runs commit
func (*KeeperTestHelper) ExecuteUpgradeFeeTokenProposal ¶
func (s *KeeperTestHelper) ExecuteUpgradeFeeTokenProposal(feeToken string, poolId uint64) error
func (*KeeperTestHelper) ExtractAttributes ¶
func (s *KeeperTestHelper) ExtractAttributes(event sdk.Event) map[string]string
func (*KeeperTestHelper) FundAcc ¶
func (s *KeeperTestHelper) FundAcc(acc sdk.AccAddress, amounts sdk.Coins)
FundAcc funds target address with specified amount.
func (*KeeperTestHelper) FundModuleAcc ¶
func (s *KeeperTestHelper) FundModuleAcc(moduleName string, amounts sdk.Coins)
FundModuleAcc funds target modules with specified amount.
func (*KeeperTestHelper) GetContractCode ¶
func (s *KeeperTestHelper) GetContractCode(contractName string) []byte
func (*KeeperTestHelper) GetContractCodeCustomProject ¶
func (s *KeeperTestHelper) GetContractCodeCustomProject(contractName string, projectName string, path string) []byte
GetContractCode returns the contract code for the given contract name. Assumes that the contract code is stored under x/cosmwasmpool/bytecode.
func (*KeeperTestHelper) GetDefaultTransmuterInstantiateMsgBytes ¶
func (s *KeeperTestHelper) GetDefaultTransmuterInstantiateMsgBytes() []byte
GetDefaultTransmuterInstantiateMsgBytes returns the default instantiate message for the transmuter contract with DefaultTransmuterDenomA and DefaultTransmuterDenomB as the pool asset denoms.
func (*KeeperTestHelper) GetTransmuterInstantiateMsgBytes ¶
func (s *KeeperTestHelper) GetTransmuterInstantiateMsgBytes(poolAssetDenoms []string) []byte
GetTransmuterInstantiateMsgBytes returns the instantiate message for the transmuter contract with the given pool asset denoms.
func (*KeeperTestHelper) IncreaseVolumeForPools ¶
func (s *KeeperTestHelper) IncreaseVolumeForPools(poolIDs []uint64, volumesForEachPool []osmomath.Int)
initializes or increases the volumes for the given pools
func (*KeeperTestHelper) JoinTransmuterPool ¶
func (s *KeeperTestHelper) JoinTransmuterPool(lpAddress sdk.AccAddress, poolId uint64, coins sdk.Coins)
JoinTransmuterPool joins the given pool with the given coins from the given address.
func (*KeeperTestHelper) LockTokens ¶
func (s *KeeperTestHelper) LockTokens(addr sdk.AccAddress, coins sdk.Coins, duration time.Duration) (lockID uint64)
LockTokens funds an account, locks tokens and returns a lockID.
func (*KeeperTestHelper) LockTokensNoFund ¶
func (s *KeeperTestHelper) LockTokensNoFund(addr sdk.AccAddress, coins sdk.Coins, duration time.Duration) (lockID uint64)
LockTokensNoFund locks tokens and returns a lockID.
func (*KeeperTestHelper) MintCoins ¶
func (s *KeeperTestHelper) MintCoins(coins sdk.Coins)
func (*KeeperTestHelper) ModifySpotPrice ¶
func (s *KeeperTestHelper) ModifySpotPrice(poolID uint64, targetSpotPrice osmomath.Dec, baseDenom string)
Modify spotprice of a pool to target spotprice
func (*KeeperTestHelper) PrepareAllSupportedPools ¶
func (s *KeeperTestHelper) PrepareAllSupportedPools() SupportedPoolAndGaugeInfo
PrepareAllSupportedPools creates all supported pools and returns their IDs. Additionally, attaches an internal gauge ID for each pool.
func (*KeeperTestHelper) PrepareAllSupportedPoolsCustomProject ¶
func (s *KeeperTestHelper) PrepareAllSupportedPoolsCustomProject(projectName, transmuterPath string) SupportedPoolAndGaugeInfo
PrepareAllSupportedPoolsCustomProject creates all supported pools and returns their IDs. Additionally, attaches an internal gauge ID for each pool. Allows the flexibility of being used from outside the Osmosis repository by providing custom project name and transmuter bytecode path.
func (*KeeperTestHelper) PrepareBalancerPool ¶
func (s *KeeperTestHelper) PrepareBalancerPool() uint64
PrepareBalancerPool returns a Balancer pool's pool-ID with pool params set in PrepareBalancerPoolWithPoolParams.
func (*KeeperTestHelper) PrepareBalancerPoolWithCoins ¶
func (s *KeeperTestHelper) PrepareBalancerPoolWithCoins(coins ...sdk.Coin) uint64
PrepareBalancerPoolWithCoins returns a balancer pool consisted of given coins with equal weight.
func (*KeeperTestHelper) PrepareBalancerPoolWithCoinsAndWeights ¶
func (s *KeeperTestHelper) PrepareBalancerPoolWithCoinsAndWeights(coins sdk.Coins, weights []int64) uint64
PrepareBalancerPoolWithCoins returns a balancer pool PrepareBalancerPoolWithCoinsAndWeights returns a balancer pool consisted of given coins with the specified weights.
func (*KeeperTestHelper) PrepareBalancerPoolWithPoolParams ¶
func (s *KeeperTestHelper) PrepareBalancerPoolWithPoolParams(poolParams balancer.PoolParams) uint64
PrepareBalancerPoolWithPoolParams sets up a Balancer pool with poolParams. Uses default pool assets.
func (*KeeperTestHelper) PrepareBasicStableswapPool ¶
func (s *KeeperTestHelper) PrepareBasicStableswapPool() uint64
func (*KeeperTestHelper) PrepareConcentratedPool ¶
func (s *KeeperTestHelper) PrepareConcentratedPool() types.ConcentratedPoolExtension
PrepareConcentratedPool sets up an eth usdc concentrated liquidity pool with a tick spacing of 100, no liquidity and zero spread factor.
func (*KeeperTestHelper) PrepareConcentratedPoolWithCoins ¶
func (s *KeeperTestHelper) PrepareConcentratedPoolWithCoins(denom1, denom2 string) types.ConcentratedPoolExtension
PrepareConcentratedPoolWithCoins sets up a concentrated liquidity pool with custom denoms.
func (*KeeperTestHelper) PrepareConcentratedPoolWithCoinsAndFullRangePosition ¶
func (s *KeeperTestHelper) PrepareConcentratedPoolWithCoinsAndFullRangePosition(denom1, denom2 string) types.ConcentratedPoolExtension
PrepareConcentratedPoolWithCoinsAndFullRangePosition sets up a concentrated liquidity pool with custom denoms. It also creates a full range position.
func (*KeeperTestHelper) PrepareConcentratedPoolWithCoinsAndLockedFullRangePosition ¶
func (s *KeeperTestHelper) PrepareConcentratedPoolWithCoinsAndLockedFullRangePosition(denom1, denom2 string) (types.ConcentratedPoolExtension, uint64, uint64)
PrepareConcentratedPoolWithCoinsAndLockedFullRangePosition sets up a concentrated liquidity pool with custom denoms. It also creates a full range position and locks it for 14 days.
func (*KeeperTestHelper) PrepareCosmWasmPool ¶
func (s *KeeperTestHelper) PrepareCosmWasmPool() cosmwasmpooltypes.CosmWasmExtension
PrepareCosmWasmPool sets up a cosmwasm pool with the default parameters.
func (*KeeperTestHelper) PrepareCustomBalancerPool ¶
func (s *KeeperTestHelper) PrepareCustomBalancerPool(assets []balancer.PoolAsset, params balancer.PoolParams) uint64
PrepareCustomBalancerPool sets up a Balancer pool with an array of assets and given parameters
func (*KeeperTestHelper) PrepareCustomBalancerPoolFromCoins ¶
func (s *KeeperTestHelper) PrepareCustomBalancerPoolFromCoins(coins sdk.Coins, params balancer.PoolParams) uint64
PrepareCustomBalancerPoolFromCoins sets up a Balancer pool with an array of coins and given parameters The coins are converted to pool assets where each asset has a weight of 1.
func (*KeeperTestHelper) PrepareCustomConcentratedPool ¶
func (s *KeeperTestHelper) PrepareCustomConcentratedPool(owner sdk.AccAddress, denom0, denom1 string, tickSpacing uint64, spreadFactor osmomath.Dec) types.ConcentratedPoolExtension
PrepareCustomConcentratedPool sets up a concentrated liquidity pool with the custom parameters.
func (*KeeperTestHelper) PrepareCustomTransmuterPool ¶
func (s *KeeperTestHelper) PrepareCustomTransmuterPool(owner sdk.AccAddress, denoms []string) cosmwasmpooltypes.CosmWasmExtension
PrepareCustomTransmuterPool sets up a transmuter pool with the default parameters assuming that the transmuter contract is stored under x/cosmwasmpool/bytecode in the Osmosis repository.
func (*KeeperTestHelper) PrepareCustomTransmuterPoolCustomProject ¶
func (s *KeeperTestHelper) PrepareCustomTransmuterPoolCustomProject(owner sdk.AccAddress, denoms []string, projectName, byteCodePath string) cosmwasmpooltypes.CosmWasmExtension
PrepareCustomTransmuterPoolCustomProject sets up a transmuter pool with the custom parameters. Gives flexibility for the helper to be reused outside of the Osmosis repository by providing custom project name and bytecode path.
func (*KeeperTestHelper) PrepareImbalancedStableswapPool ¶
func (s *KeeperTestHelper) PrepareImbalancedStableswapPool() uint64
func (*KeeperTestHelper) PrepareMultipleBalancerPools ¶
func (s *KeeperTestHelper) PrepareMultipleBalancerPools(poolsToCreate uint16) []uint64
PrepareMultipleBalancerPools returns X Balancer pool's with X being provided by the user.
func (*KeeperTestHelper) PrepareMultipleConcentratedPools ¶
func (s *KeeperTestHelper) PrepareMultipleConcentratedPools(poolsToCreate uint16) []uint64
PrepareMultipleConcentratedPools returns X cl pool's with X being provided by the user.
func (*KeeperTestHelper) RequireDecCoinsSlice ¶
func (s *KeeperTestHelper) RequireDecCoinsSlice(expected, actual []sdk.DecCoins)
RequireDecCoinsSlice compares two slices of DecCoins
func (*KeeperTestHelper) Reset ¶
func (s *KeeperTestHelper) Reset()
resets the test environment requires that all commits go through helpers in s. On first reset, will instantiate a new app, with caching enabled. NOTE: If you are using ABCI methods, usage of Reset vs Setup has not been well tested. It is believed to work, but if you get an odd error, try changing the call to this for setup to sanity check. what's supposed to happen is a new setup call, and reset just does that in such a case.
func (*KeeperTestHelper) RunBasicExit ¶
func (s *KeeperTestHelper) RunBasicExit(poolId uint64)
func (*KeeperTestHelper) RunBasicJoin ¶
func (s *KeeperTestHelper) RunBasicJoin(poolId uint64)
func (*KeeperTestHelper) RunBasicSwap ¶
func (s *KeeperTestHelper) RunBasicSwap(poolId uint64)
func (*KeeperTestHelper) RunTestCaseWithoutStateUpdates ¶
func (s *KeeperTestHelper) RunTestCaseWithoutStateUpdates(name string, cb func(t *testing.T))
RunTestCaseWithoutStateUpdates runs the testcase as a callback with the given name. Does not persist any state changes. This is useful when test suite uses common state setup but desures each test case to be run in isolation.
func (*KeeperTestHelper) SetEpochStartTime ¶
func (s *KeeperTestHelper) SetEpochStartTime()
func (*KeeperTestHelper) Setup ¶
func (s *KeeperTestHelper) Setup()
Setup sets up basic environment for suite (App, Ctx, and test accounts) preserves the caching enabled/disabled state.
func (*KeeperTestHelper) SetupConcentratedLiquidityDenomsAndPoolCreation ¶
func (s *KeeperTestHelper) SetupConcentratedLiquidityDenomsAndPoolCreation()
SetupConcentratedLiquidityDenomsAndPoolCreation sets up the default authorized quote denoms. Additionally, enables permissionless pool creation. This is to overwrite the default params set in concentrated liquidity genesis to account for the test cases that used various denoms before the authorized quote denoms were introduced.
func (*KeeperTestHelper) SetupGammPoolsWithBondDenomMultiplier ¶
func (s *KeeperTestHelper) SetupGammPoolsWithBondDenomMultiplier(multipliers []osmomath.Dec) []gammtypes.CFMMPoolI
SetupGammPoolsWithBondDenomMultiplier uses given multipliers to set initial pool supply of bond denom.
func (*KeeperTestHelper) SetupMultipleValidators ¶
func (s *KeeperTestHelper) SetupMultipleValidators(numValidator int) []string
SetupMultipleValidators setups "numValidator" validators and returns their address in string
func (*KeeperTestHelper) SetupTestForInitGenesis ¶
func (s *KeeperTestHelper) SetupTestForInitGenesis()
func (*KeeperTestHelper) SetupTxFeeAnteHandlerAndChargeFee ¶
func (*KeeperTestHelper) SetupValidator ¶
func (s *KeeperTestHelper) SetupValidator(bondStatus stakingtypes.BondStatus) sdk.ValAddress
SetupValidator sets up a validator and returns the ValAddress.
func (*KeeperTestHelper) SetupVolumeForPools ¶
func (s *KeeperTestHelper) SetupVolumeForPools(poolIDs []uint64, volumesForEachPool []osmomath.Int, poolIDToVolumeMap map[uint64]math.Int)
sets up the volume for the pools in the group mutates poolIDToVolumeMap
func (*KeeperTestHelper) SetupWithCustomChainId ¶
func (s *KeeperTestHelper) SetupWithCustomChainId(chainId string)
func (*KeeperTestHelper) SetupWithLevelDb ¶
func (s *KeeperTestHelper) SetupWithLevelDb() func()
func (*KeeperTestHelper) SkipIfWSL ¶
func (s *KeeperTestHelper) SkipIfWSL()
func (*KeeperTestHelper) StateNotAltered ¶
func (s *KeeperTestHelper) StateNotAltered()
StateNotAltered validates that app state is not altered. Fails if it is.
func (*KeeperTestHelper) StoreCosmWasmPoolContractCode ¶
func (s *KeeperTestHelper) StoreCosmWasmPoolContractCode(contractName string) uint64
StoreCosmWasmPoolContractCode stores the cosmwasm pool contract code in the wasm keeper and returns the code id. contractName is the name of the contract file in the x/cosmwasmpool/bytecode directory without the .wasm extension.
func (*KeeperTestHelper) StoreCosmWasmPoolContractCodeCustomProject ¶
func (s *KeeperTestHelper) StoreCosmWasmPoolContractCodeCustomProject(contractName, projectName, byteCodePath string) uint64
StoreCosmWasmPoolContractCodeCustomProject stores the cosmwasm pool contract code in the wasm keeper and returns the code id. contractName is the name of the contract file in the x/cosmwasmpool/bytecode directory without the .wasm extension. It has the flexibility of being used from outside the Osmosis repository by providing custom project name and bytecode path.
func (*KeeperTestHelper) SuperfluidDelegateToDefaultVal ¶
func (s *KeeperTestHelper) SuperfluidDelegateToDefaultVal(sender sdk.AccAddress, poolId uint64, lockId uint64) error
func (*KeeperTestHelper) SuperfluidDelegateToVal ¶
func (s *KeeperTestHelper) SuperfluidDelegateToVal(sender sdk.AccAddress, poolId uint64, lockId uint64, valAddr string) error
func (*KeeperTestHelper) SwapAndSetSpotPrice ¶
func (s *KeeperTestHelper) SwapAndSetSpotPrice(poolId uint64, fromAsset sdk.Coin, toAsset sdk.Coin) osmomath.BigDec
SwapAndSetSpotPrice runs a swap to set Spot price of a pool using arbitrary values returns spot price after the arbitrary swap.
func (*KeeperTestHelper) ValidateGroupExists ¶
func (s *KeeperTestHelper) ValidateGroupExists(gaugeID uint64)
validates that Group and group Gauge exist
func (*KeeperTestHelper) WithdrawFullRangePosition ¶
func (s *KeeperTestHelper) WithdrawFullRangePosition(pool types.ConcentratedPoolExtension, positionId uint64, liquidityToRemove osmomath.Dec)
WithdrawFullRangePosition withdraws given liquidity from a position specified by id.
type SupportedPoolAndGaugeInfo ¶
type SupportedPoolAndGaugeInfo struct { ConcentratedPoolID uint64 BalancerPoolID uint64 StableSwapPoolID uint64 CosmWasmPoolID uint64 ConcentratedGaugeID uint64 BalancerGaugeID uint64 StableSwapGaugeID uint64 }
Defines IDs for all supported Osmosis pools. Additionally, encapsulates an internal gauge ID for each pool. This struct is initialized and returned by PrepareAllSupportedPools().