apptesting

package
v8.0.0-...-2960480 Latest Latest
Warning

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

Go to latest
Published: May 27, 2022 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultAcctFunds sdk.Coins = sdk.NewCoins(
	sdk.NewCoin("uosmo", sdk.NewInt(10000000000)),
	sdk.NewCoin("foo", sdk.NewInt(10000000)),
	sdk.NewCoin("bar", sdk.NewInt(10000000)),
	sdk.NewCoin("baz", sdk.NewInt(10000000)),
)

Functions

func CreateRandomAccounts

func CreateRandomAccounts(numAccts int) []sdk.AccAddress

CreateRandomAccounts is a function return a list of randomly generated AccAddresses

Types

type KeeperTestHelper

type KeeperTestHelper struct {
	suite.Suite

	App         *app.OsmosisApp
	Ctx         sdk.Context
	QueryHelper *baseapp.QueryServiceTestHelper
	TestAccs    []sdk.AccAddress
}

func (*KeeperTestHelper) AllocateRewardsToValidator

func (s *KeeperTestHelper) AllocateRewardsToValidator(valAddr sdk.ValAddress, rewardAmt sdk.Int)

func (*KeeperTestHelper) BeginNewBlock

func (s *KeeperTestHelper) BeginNewBlock(executeNextEpoch bool)

func (*KeeperTestHelper) BeginNewBlockWithProposer

func (s *KeeperTestHelper) BeginNewBlockWithProposer(executeNextEpoch bool, proposer sdk.ValAddress)

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

func (*KeeperTestHelper) EndBlock

func (s *KeeperTestHelper) EndBlock()

func (*KeeperTestHelper) FundAcc

func (s *KeeperTestHelper) FundAcc(acc sdk.AccAddress, amounts sdk.Coins)

func (*KeeperTestHelper) LockTokens

func (s *KeeperTestHelper) LockTokens(addr sdk.AccAddress, coins sdk.Coins, duration time.Duration) (lockID uint64)

func (*KeeperTestHelper) PrepareBalancerPool

func (suite *KeeperTestHelper) PrepareBalancerPool() uint64

func (*KeeperTestHelper) PrepareBalancerPoolWithPoolAsset

func (suite *KeeperTestHelper) PrepareBalancerPoolWithPoolAsset(assets []balancer.PoolAsset) uint64

func (*KeeperTestHelper) PrepareBalancerPoolWithPoolParams

func (suite *KeeperTestHelper) PrepareBalancerPoolWithPoolParams(poolParams balancer.PoolParams) uint64

func (*KeeperTestHelper) PrepareUni2PoolWithAssets

func (suite *KeeperTestHelper) PrepareUni2PoolWithAssets(asset1, asset2 sdk.Coin) uint64

Returns a Univ2 pool with the initial liquidity being the provided balances

func (*KeeperTestHelper) Setup

func (s *KeeperTestHelper) Setup()

func (*KeeperTestHelper) SetupGammPoolsWithBondDenomMultiplier

func (s *KeeperTestHelper) SetupGammPoolsWithBondDenomMultiplier(multipliers []sdk.Dec) []gammtypes.PoolI

SetupGammPoolsWithBondDenomMultiplier uses given multipliers to set initial pool supply of bond denom.

func (*KeeperTestHelper) SetupTokenFactory

func (s *KeeperTestHelper) SetupTokenFactory()

func (*KeeperTestHelper) SetupValidator

func (s *KeeperTestHelper) SetupValidator(bondStatus stakingtypes.BondStatus) sdk.ValAddress

func (*KeeperTestHelper) SwapAndSetSpotPrice

func (s *KeeperTestHelper) SwapAndSetSpotPrice(poolId uint64, fromAsset sdk.Coin, toAsset sdk.Coin) sdk.Dec

SwapAndSetSpotPrice runs a swap to set Spot price of a pool using arbitrary values returns spot price after the arbitrary swap.

Jump to

Keyboard shortcuts

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