testutil

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Suite

type Suite struct {
	suite.Suite
	Keeper swap.Keeper
	App    app.TestApp
	Ctx    sdk.Context
	// contains filtered or unexported fields
}

Suite implements a test suite for the swap module integration tests

func (*Suite) AccountBalanceDelta

func (suite *Suite) AccountBalanceDelta(acc authexported.Account, coins sdk.Coins, delta float64)

AccountBalanceDelta asserts that the coins are within delta of the account balance

func (*Suite) AccountBalanceEqual

func (suite *Suite) AccountBalanceEqual(acc authexported.Account, coins sdk.Coins)

AccountBalanceEqual asserts that the coins match the account balance

func (*Suite) AddCoinsToModule

func (suite *Suite) AddCoinsToModule(amount sdk.Coins)

AddCoinsToModule adds coins to the swap module account

func (*Suite) CreateAccount

func (suite *Suite) CreateAccount(initialBalance sdk.Coins) authexported.Account

CreateAccount creates a new account from the provided balance

func (*Suite) CreatePool

func (suite *Suite) CreatePool(reserves sdk.Coins) error

CreatePool creates a pool and stores it in state with the provided reserves

func (*Suite) CreateVestingAccount

func (suite *Suite) CreateVestingAccount(initialBalance sdk.Coins, vestingBalance sdk.Coins) authexported.Account

CreateVestingAccount creats a new vesting account from the provided balance and vesting balance

func (*Suite) EventsContains

func (suite *Suite) EventsContains(events sdk.Events, expectedEvent sdk.Event)

EventsContains asserts that the expected event is in the provided events

func (*Suite) GetAccount

func (suite *Suite) GetAccount(addr sdk.AccAddress) authexported.Account

GetAccount gets an existing account

func (*Suite) ModuleAccountBalanceDelta

func (suite *Suite) ModuleAccountBalanceDelta(coins sdk.Coins, delta float64)

ModuleAccountBalanceDelta asserts that the swap module account balance is within acceptable delta of the provided coins

func (*Suite) ModuleAccountBalanceEqual

func (suite *Suite) ModuleAccountBalanceEqual(coins sdk.Coins)

ModuleAccountBalanceEqual asserts that the swap module account balance matches the provided coins

func (*Suite) NewAccountFromAddr

func (suite *Suite) NewAccountFromAddr(addr sdk.AccAddress, balance sdk.Coins) authexported.Account

NewAccountFromAddr creates a new account from the provided address with the provided balance

func (*Suite) PoolDeleted

func (suite *Suite) PoolDeleted(denomA, denomB string)

PoolDeleted asserts that the pool does not exist

func (*Suite) PoolDepositorSharesEqual

func (suite *Suite) PoolDepositorSharesEqual(depositor sdk.AccAddress, poolID string, shares sdk.Int)

PoolDepositorSharesEqual asserts the depositor owns the shares for the provided pool

func (*Suite) PoolLiquidityDelta

func (suite *Suite) PoolLiquidityDelta(coins sdk.Coins, delta float64)

PoolLiquidityDelta asserts that the pool matching the provided coins has those reserves within delta

func (*Suite) PoolLiquidityEqual

func (suite *Suite) PoolLiquidityEqual(coins sdk.Coins)

PoolLiquidityEqual asserts that the pool matching the provided coins has those reserves

func (*Suite) PoolReservesEqual

func (suite *Suite) PoolReservesEqual(poolID string, reserves sdk.Coins)

PoolReservesEqual assets the stored pool reserves are equal to the provided reserves

func (*Suite) PoolShareTotalEqual

func (suite *Suite) PoolShareTotalEqual(poolID string, totalShares sdk.Int)

PoolShareTotalEqual asserts the total shares match the stored pool

func (*Suite) PoolShareValueDelta

func (suite *Suite) PoolShareValueDelta(depositor authexported.Account, pool swap.AllowedPool, coins sdk.Coins, delta float64)

PoolShareValueDelta asserts that the depositor shares are in state and the value is within delta of the expected coins

func (*Suite) PoolShareValueEqual

func (suite *Suite) PoolShareValueEqual(depositor authexported.Account, pool swap.AllowedPool, coins sdk.Coins)

PoolShareValueEqual asserts that the depositor shares are in state and the value matches the expected coins

func (*Suite) PoolSharesDeleted

func (suite *Suite) PoolSharesDeleted(depositor sdk.AccAddress, denomA, denomB string)

PoolSharesDeleted asserts that the pool shares have been removed

func (*Suite) RemoveCoinsFromModule

func (suite *Suite) RemoveCoinsFromModule(amount sdk.Coins)

RemoveCoinsFromModule adds coins to the swap module account

func (*Suite) SetupTest

func (suite *Suite) SetupTest()

SetupTest instantiates a new app, keepers, and sets suite state

Jump to

Keyboard shortcuts

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