testutil

package
v0.23.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TestBkavaDenoms = []string{
	"bkava-kavavaloper15gqc744d05xacn4n6w2furuads9fu4pqn6zxlu",
	"bkava-kavavaloper15qdefkmwswysgg4qxgqpqr35k3m49pkx8yhpte",
	"bkava-kavavaloper1ypjp0m04pyp73hwgtc0dgkx0e9rrydeckewa42",
}

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

	// Strategy Keepers
	HardKeeper    hardkeeper.Keeper
	SavingsKeeper savingskeeper.Keeper
}

Suite implements a test suite for the earn 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 earn module account

func (*Suite) CreateAccount

func (suite *Suite) CreateAccount(initialBalance sdk.Coins, index int) authtypes.AccountI

CreateAccount creates a new account from the provided balance, using index to create different new addresses.

func (*Suite) CreateDelegation

func (suite *Suite) CreateDelegation(valAddr sdk.ValAddress, delegator sdk.AccAddress, amount sdkmath.Int) sdk.Dec

CreateDelegation delegates tokens to a validator.

func (*Suite) CreateNewUnbondedValidator

func (suite *Suite) CreateNewUnbondedValidator(addr sdk.ValAddress, selfDelegation sdkmath.Int) stakingtypes.Validator

CreateNewUnbondedValidator creates a new validator in the staking module. New validators are unbonded until the end blocker is run.

func (*Suite) CreateVault

func (suite *Suite) CreateVault(
	vaultDenom string,
	vaultStrategies types.StrategyTypes,
	isPrivateVault bool,
	allowedDepositors []sdk.AccAddress,
)

CreateVault adds a new vault to the keeper parameters

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) HardDepositAmountEqual

func (suite *Suite) HardDepositAmountEqual(expected sdk.Coins)

HardDepositAmountEqual asserts that the hard deposit amount matches the provided values.

func (*Suite) ModuleAccountBalanceEqual

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

ModuleAccountBalanceEqual asserts that the earn 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) NewBondCoin

func (suite *Suite) NewBondCoin(amount sdkmath.Int) sdk.Coin

NewBondCoin creates a Coin with the current staking denom.

func (*Suite) RemoveCoinsFromModule

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

RemoveCoinsFromModule removes coins to the earn module account

func (*Suite) SavingsDepositAmountEqual

func (suite *Suite) SavingsDepositAmountEqual(expected sdk.Coins)

SavingsDepositAmountEqual asserts that the savings deposit amount matches the provided values.

func (*Suite) SetupTest

func (suite *Suite) SetupTest()

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

func (*Suite) VaultAccountSharesEqual

func (suite *Suite) VaultAccountSharesEqual(accs []sdk.AccAddress, supplies []sdk.Coins)

VaultAccountSharesEqual asserts that the vault account shares match the provided values.

func (*Suite) VaultTotalSharesEqual

func (suite *Suite) VaultTotalSharesEqual(expected types.VaultShares)

VaultTotalSharesEqual asserts that the vault total shares match the provided values.

func (*Suite) VaultTotalValuesEqual

func (suite *Suite) VaultTotalValuesEqual(expected sdk.Coins)

VaultTotalValuesEqual asserts that the vault total values match the provided values.

Jump to

Keyboard shortcuts

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