testutil

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: Apache-2.0 Imports: 17 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        keeper.Keeper
	App           app.TestApp
	Ctx           sdk.Context
	BankKeeper    BankKeeper.Keeper
	AccountKeeper authkeeper.AccountKeeper
}

Suite implements a test suite for the swap module integration tests

func (*Suite) AccountBalanceEqual

func (suite *Suite) AccountBalanceEqual(addr sdk.AccAddress, 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) authtypes.AccountI

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) authtypes.AccountI

CreateVestingAccount creates 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) GetEvents

func (suite *Suite) GetEvents() sdk.Events

GetEvents returns emitted events on the sdk context

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) authtypes.AccountI

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 sdkmath.Int)

PoolDepositorSharesEqual asserts the depositor owns the shares for the provided pool

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 sdkmath.Int)

PoolShareTotalEqual asserts the total shares match the stored pool

func (*Suite) PoolShareValueEqual

func (suite *Suite) PoolShareValueEqual(depositor authtypes.AccountI, pool types.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 removes 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