Documentation ¶
Index ¶
- type Suite
- func (suite *Suite) AccountBalanceEqual(addr sdk.AccAddress, coins sdk.Coins)
- func (suite *Suite) AccountBalanceOfEqual(addr sdk.AccAddress, denom string, amount sdkmath.Int)
- func (suite *Suite) AccountSpendableBalanceEqual(addr sdk.AccAddress, amount sdk.Coins)
- func (suite *Suite) AddCoinsToModule(module string, amount sdk.Coins)
- func (suite *Suite) CreateAccountWithAddress(addr sdk.AccAddress, initialBalance sdk.Coins) authtypes.AccountI
- func (suite *Suite) CreateDelegation(valAddr sdk.ValAddress, delegator sdk.AccAddress, amount sdkmath.Int) sdk.Dec
- func (suite *Suite) CreateNewUnbondedValidator(addr sdk.ValAddress, selfDelegation sdkmath.Int) stakingtypes.Validator
- func (suite *Suite) CreateVault(vaultDenom string, vaultStrategies earntypes.StrategyTypes, ...)
- func (suite *Suite) CreateVestingAccountWithAddress(addr sdk.AccAddress, initialBalance sdk.Coins, vestingBalance sdk.Coins) authtypes.AccountI
- func (suite *Suite) DelegationBalanceInDeltaBelow(valAddr sdk.ValAddress, delegator sdk.AccAddress, expected, delta sdkmath.Int) bool
- func (suite *Suite) DelegationBalanceLessThan(valAddr sdk.ValAddress, delegator sdk.AccAddress, max sdkmath.Int) bool
- func (suite *Suite) DelegationSharesEqual(valAddr sdk.ValAddress, delegator sdk.AccAddress, shares sdk.Dec) bool
- func (suite *Suite) EventsContains(events sdk.Events, expectedEvent sdk.Event)
- func (suite *Suite) NewBondCoin(amount sdkmath.Int) sdk.Coin
- func (suite *Suite) NewBondCoins(amount sdkmath.Int) sdk.Coins
- func (suite *Suite) QueryBank_SpendableBalance(user sdk.AccAddress) sdk.Coins
- func (suite *Suite) QueryEarn_VaultValue(depositor sdk.AccAddress, vaultDenom string) earntypes.DepositResponse
- func (suite *Suite) QueryStaking_Delegation(valAddr sdk.ValAddress, delegator sdk.AccAddress) stakingtypes.DelegationResponse
- func (suite *Suite) SetSavingsSupportedDenoms(denoms []string)
- func (suite *Suite) SetupTest()
- func (suite *Suite) SlashValidator(addr sdk.ValAddress, slashFraction sdk.Dec)
- func (suite *Suite) UnbondingDelegationInDeltaBelow(valAddr sdk.ValAddress, delegator sdk.AccAddress, expected, delta sdkmath.Int) bool
- func (suite *Suite) VaultAccountSharesEqual(acc sdk.AccAddress, shares earntypes.VaultShares)
- func (suite *Suite) VaultAccountValueEqual(acc sdk.AccAddress, coin sdk.Coin)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Suite ¶
type Suite struct { suite.Suite App app.TestApp Ctx sdk.Context Keeper keeper.Keeper BankKeeper bankkeeper.Keeper StakingKeeper *stakingkeeper.Keeper EarnKeeper earnkeeper.Keeper }
Test suite used for all keeper tests
func (*Suite) AccountBalanceEqual ¶
func (suite *Suite) AccountBalanceEqual(addr sdk.AccAddress, coins sdk.Coins)
AccountBalanceEqual checks if an account has the specified coins.
func (*Suite) AccountBalanceOfEqual ¶
AccountBalanceOfEqual checks if an account has the specified amount of one denom.
func (*Suite) AccountSpendableBalanceEqual ¶
func (suite *Suite) AccountSpendableBalanceEqual(addr sdk.AccAddress, amount sdk.Coins)
AccountSpendableBalanceEqual checks if an account has the specified coins unlocked.
func (*Suite) AddCoinsToModule ¶
AddCoinsToModule adds coins to the a module account, creating it if it doesn't exist.
func (*Suite) CreateAccountWithAddress ¶
func (suite *Suite) CreateAccountWithAddress(addr sdk.AccAddress, initialBalance sdk.Coins) authtypes.AccountI
CreateAccount creates a new account from the provided balance and address
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 earntypes.StrategyTypes, isPrivateVault bool, allowedDepositors []sdk.AccAddress, )
CreateVault adds a new earn vault to the earn keeper parameters
func (*Suite) CreateVestingAccountWithAddress ¶
func (suite *Suite) CreateVestingAccountWithAddress(addr sdk.AccAddress, initialBalance sdk.Coins, vestingBalance sdk.Coins) authtypes.AccountI
CreateVestingAccount creates a new vesting account. `vestingBalance` should be a fraction of `initialBalance`.
func (*Suite) DelegationBalanceInDeltaBelow ¶
func (suite *Suite) DelegationBalanceInDeltaBelow(valAddr sdk.ValAddress, delegator sdk.AccAddress, expected, delta sdkmath.Int) bool
DelegationBalanceInDeltaBelow checks if a delegation's staked token balance is between `expected` and `expected - delta` inclusive. It treats not found delegations as having zero shares.
func (*Suite) DelegationBalanceLessThan ¶
func (suite *Suite) DelegationBalanceLessThan(valAddr sdk.ValAddress, delegator sdk.AccAddress, max sdkmath.Int) bool
DelegationBalanceLessThan checks if a delegation's staked token balance is less the specified amount. It treats not found delegations as having zero shares.
func (*Suite) DelegationSharesEqual ¶
func (suite *Suite) DelegationSharesEqual(valAddr sdk.ValAddress, delegator sdk.AccAddress, shares sdk.Dec) bool
DelegationSharesEqual checks if a delegation has the specified shares. It expects delegations with zero shares to not be stored in state.
func (*Suite) EventsContains ¶
EventsContains asserts that the expected event is in the provided events
func (*Suite) NewBondCoin ¶
NewBondCoin creates a Coin with the current staking denom.
func (*Suite) NewBondCoins ¶
NewBondCoins creates Coins with the current staking denom.
func (*Suite) QueryBank_SpendableBalance ¶
func (suite *Suite) QueryBank_SpendableBalance(user sdk.AccAddress) sdk.Coins
func (*Suite) QueryEarn_VaultValue ¶
func (suite *Suite) QueryEarn_VaultValue(depositor sdk.AccAddress, vaultDenom string) earntypes.DepositResponse
func (*Suite) QueryStaking_Delegation ¶
func (suite *Suite) QueryStaking_Delegation(valAddr sdk.ValAddress, delegator sdk.AccAddress) stakingtypes.DelegationResponse
func (*Suite) SetSavingsSupportedDenoms ¶
SetSavingsSupportedDenoms overwrites the list of supported denoms in the savings module params.
func (*Suite) SlashValidator ¶
func (suite *Suite) SlashValidator(addr sdk.ValAddress, slashFraction sdk.Dec)
SlashValidator burns tokens staked in a validator. new_tokens = old_tokens * (1-slashFraction)
func (*Suite) UnbondingDelegationInDeltaBelow ¶
func (suite *Suite) UnbondingDelegationInDeltaBelow(valAddr sdk.ValAddress, delegator sdk.AccAddress, expected, delta sdkmath.Int) bool
UnbondingDelegationInDeltaBelow checks if the total balance in an unbonding delegation is between `expected` and `expected - delta` inclusive.
func (*Suite) VaultAccountSharesEqual ¶
func (suite *Suite) VaultAccountSharesEqual(acc sdk.AccAddress, shares earntypes.VaultShares)
VaultAccountSharesEqual asserts that the vault account shares match the provided values.
func (*Suite) VaultAccountValueEqual ¶
func (suite *Suite) VaultAccountValueEqual(acc sdk.AccAddress, coin sdk.Coin)
VaultAccountValueEqual asserts that the vault account value matches the provided coin amount.