testutil

package
v0.21.0-rc.7 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecMsgCreatePool

func ExecMsgCreatePool(
	t *testing.T,
	clientCtx client.Context,
	owner fmt.Stringer,
	tokenWeights string,
	initialDeposit string,
	swapFee string,
	exitFee string,
	poolType string,
	amplification string,
	extraArgs ...string,
) (testutil.BufferWriter, error)

ExecMsgCreatePool broadcast a pool creation message.

func ExecMsgExitPool

func ExecMsgExitPool(
	clientCtx client.Context,
	poolId uint64,
	sender fmt.Stringer,
	poolSharesOut string,
	extraArgs ...string,
) (testutil.BufferWriter, error)

ExecMsgExitPool broadcast an exit pool message.

func ExecMsgJoinPool

func ExecMsgJoinPool(
	clientCtx client.Context,
	poolId uint64,
	sender fmt.Stringer,
	tokensIn string,
	useAllCoins string,
	extraArgs ...string,
) (testutil.BufferWriter, error)

ExecMsgJoinPool broadcast a join pool message.

func ExecMsgSwapAssets

func ExecMsgSwapAssets(
	clientCtx client.Context,
	poolId uint64,
	sender fmt.Stringer,
	tokenIn string,
	tokenOutDenom string,
	extraArgs ...string,
) (testutil.BufferWriter, error)

ExecMsgSwapAssets broadcast a swap assets message.

func ExtractPoolIDFromCreatePoolResponse

func ExtractPoolIDFromCreatePoolResponse(codec codec.Codec, out testutil.BufferWriter) (uint64, error)

ExtractPoolIDFromCreatePoolResponse extracts the created PoolID from a MsgCreatePool command.

func WhitelistGenesisAssets

func WhitelistGenesisAssets(state app.GenesisState, assets []string) app.GenesisState

WhitelistGenesisAssets given a testapp.GenesisState includes the whitelisted assets into spot Whitelisted assets.

Types

type IntegrationTestSuite

type IntegrationTestSuite struct {
	suite.Suite
	// contains filtered or unexported fields
}

func NewIntegrationTestSuite

func NewIntegrationTestSuite(homeDir string, cfg testutilcli.Config) *IntegrationTestSuite

func (*IntegrationTestSuite) FundAccount

func (s *IntegrationTestSuite) FundAccount(recipient sdk.Address, tokens sdk.Coins)

FundAccount Adds tokens from val[0] to a recipient address.

args:

  • recipient: the recipient address
  • tokens: the amount of tokens to transfer

func (*IntegrationTestSuite) NewAccount

func (s *IntegrationTestSuite) NewAccount(uid string) (addr sdk.AccAddress)

NewAccount Creates a new account and returns the address.

args:

  • uid: a unique identifier to ensure duplicate accounts are not created

ret:

  • addr: the address of the new account

func (*IntegrationTestSuite) SetupSuite

func (s *IntegrationTestSuite) SetupSuite()

func (*IntegrationTestSuite) TearDownSuite

func (s *IntegrationTestSuite) TearDownSuite()

func (*IntegrationTestSuite) TestCreatePoolCmd

func (s *IntegrationTestSuite) TestCreatePoolCmd()

func (*IntegrationTestSuite) TestCreatePoolCmd_Errors

func (s *IntegrationTestSuite) TestCreatePoolCmd_Errors()

func (*IntegrationTestSuite) TestCreatePoolStableSwapCmd_Errors

func (s *IntegrationTestSuite) TestCreatePoolStableSwapCmd_Errors()

func (*IntegrationTestSuite) TestGetCmdTotalLiquidity

func (s *IntegrationTestSuite) TestGetCmdTotalLiquidity()

func (*IntegrationTestSuite) TestNewExitPoolCmd

func (s *IntegrationTestSuite) TestNewExitPoolCmd()

func (*IntegrationTestSuite) TestNewExitStablePoolCmd

func (s *IntegrationTestSuite) TestNewExitStablePoolCmd()

func (*IntegrationTestSuite) TestNewJoinPoolCmd

func (s *IntegrationTestSuite) TestNewJoinPoolCmd()

func (*IntegrationTestSuite) TestNewJoinStablePoolCmd

func (s *IntegrationTestSuite) TestNewJoinStablePoolCmd()

func (*IntegrationTestSuite) TestSwapAssets

func (s *IntegrationTestSuite) TestSwapAssets()

func (*IntegrationTestSuite) TestSwapStableAssets

func (s *IntegrationTestSuite) TestSwapStableAssets()

Jump to

Keyboard shortcuts

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