testutil

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStandardMoneyMarket

func NewStandardMoneyMarket(denom string) hardtypes.MoneyMarket

Types

type IncentiveGenesisBuilder

type IncentiveGenesisBuilder struct {
	types.GenesisState
	// contains filtered or unexported fields
}

IncentiveGenesisBuilder is a tool for creating an incentive genesis state. Helper methods add values onto a default genesis state. All methods are immutable and return updated copies of the builder.

func NewIncentiveGenesisBuilder

func NewIncentiveGenesisBuilder() IncentiveGenesisBuilder

func (IncentiveGenesisBuilder) Build

func (builder IncentiveGenesisBuilder) Build() types.GenesisState

func (IncentiveGenesisBuilder) BuildMarshalled

func (builder IncentiveGenesisBuilder) BuildMarshalled(cdc codec.JSONCodec) app.GenesisState

func (IncentiveGenesisBuilder) WithGenesisTime

func (builder IncentiveGenesisBuilder) WithGenesisTime(time time.Time) IncentiveGenesisBuilder

func (IncentiveGenesisBuilder) WithInitializedBorrowRewardPeriod

func (builder IncentiveGenesisBuilder) WithInitializedBorrowRewardPeriod(period types.MultiRewardPeriod) IncentiveGenesisBuilder

WithInitializedBorrowRewardPeriod sets the genesis time as the previous accumulation time for the specified period. This can be helpful in tests. With no prev time set, the first block accrues no rewards as it just sets the prev time to the current.

func (IncentiveGenesisBuilder) WithInitializedDelegatorRewardPeriod

func (builder IncentiveGenesisBuilder) WithInitializedDelegatorRewardPeriod(period types.MultiRewardPeriod) IncentiveGenesisBuilder

WithInitializedDelegatorRewardPeriod sets the genesis time as the previous accumulation time for the specified period. This can be helpful in tests. With no prev time set, the first block accrues no rewards as it just sets the prev time to the current.

func (IncentiveGenesisBuilder) WithInitializedSavingsRewardPeriod

func (builder IncentiveGenesisBuilder) WithInitializedSavingsRewardPeriod(period types.MultiRewardPeriod) IncentiveGenesisBuilder

WithInitializedSavingsRewardPeriod sets the genesis time as the previous accumulation time for the specified period. This can be helpful in tests. With no prev time set, the first block accrues no rewards as it just sets the prev time to the current.

func (IncentiveGenesisBuilder) WithInitializedSupplyRewardPeriod

func (builder IncentiveGenesisBuilder) WithInitializedSupplyRewardPeriod(period types.MultiRewardPeriod) IncentiveGenesisBuilder

WithInitializedSupplyRewardPeriod sets the genesis time as the previous accumulation time for the specified period. This can be helpful in tests. With no prev time set, the first block accrues no rewards as it just sets the prev time to the current.

func (IncentiveGenesisBuilder) WithInitializedSwapRewardPeriod

func (builder IncentiveGenesisBuilder) WithInitializedSwapRewardPeriod(period types.MultiRewardPeriod) IncentiveGenesisBuilder

WithInitializedSwapRewardPeriod sets the genesis time as the previous accumulation time for the specified period. This can be helpful in tests. With no prev time set, the first block accrues no rewards as it just sets the prev time to the current.

func (IncentiveGenesisBuilder) WithInitializedUSDXRewardPeriod

func (builder IncentiveGenesisBuilder) WithInitializedUSDXRewardPeriod(period types.RewardPeriod) IncentiveGenesisBuilder

WithInitializedUSDXRewardPeriod sets the genesis time as the previous accumulation time for the specified period. This can be helpful in tests. With no prev time set, the first block accrues no rewards as it just sets the prev time to the current.

func (IncentiveGenesisBuilder) WithMultipliers

func (builder IncentiveGenesisBuilder) WithMultipliers(multipliers types.MultipliersPerDenoms) IncentiveGenesisBuilder

func (IncentiveGenesisBuilder) WithSimpleBorrowRewardPeriod

func (builder IncentiveGenesisBuilder) WithSimpleBorrowRewardPeriod(ctype string, rewardsPerSecond sdk.Coins) IncentiveGenesisBuilder

func (IncentiveGenesisBuilder) WithSimpleDelegatorRewardPeriod

func (builder IncentiveGenesisBuilder) WithSimpleDelegatorRewardPeriod(ctype string, rewardsPerSecond sdk.Coins) IncentiveGenesisBuilder

func (IncentiveGenesisBuilder) WithSimpleSavingsRewardPeriod

func (builder IncentiveGenesisBuilder) WithSimpleSavingsRewardPeriod(ctype string, rewardsPerSecond sdk.Coins) IncentiveGenesisBuilder

func (IncentiveGenesisBuilder) WithSimpleSupplyRewardPeriod

func (builder IncentiveGenesisBuilder) WithSimpleSupplyRewardPeriod(ctype string, rewardsPerSecond sdk.Coins) IncentiveGenesisBuilder

func (IncentiveGenesisBuilder) WithSimpleSwapRewardPeriod

func (builder IncentiveGenesisBuilder) WithSimpleSwapRewardPeriod(poolID string, rewardsPerSecond sdk.Coins) IncentiveGenesisBuilder

func (IncentiveGenesisBuilder) WithSimpleUSDXRewardPeriod

func (builder IncentiveGenesisBuilder) WithSimpleUSDXRewardPeriod(ctype string, rewardsPerSecond sdk.Coin) IncentiveGenesisBuilder

type IntegrationTester

type IntegrationTester struct {
	suite.Suite
	App app.TestApp
	Ctx sdk.Context
}

func (*IntegrationTester) BalanceEquals

func (suite *IntegrationTester) BalanceEquals(address sdk.AccAddress, expected sdk.Coins)

func (*IntegrationTester) BalanceInEpsilon

func (suite *IntegrationTester) BalanceInEpsilon(address sdk.AccAddress, expected sdk.Coins, epsilon float64)

func (*IntegrationTester) DelegatorRewardEquals

func (suite *IntegrationTester) DelegatorRewardEquals(owner sdk.AccAddress, expected sdk.Coins)

func (*IntegrationTester) DeliverCDPMsgBorrow

func (suite *IntegrationTester) DeliverCDPMsgBorrow(owner sdk.AccAddress, collateralType string, draw sdk.Coin) error

func (*IntegrationTester) DeliverCDPMsgRepay

func (suite *IntegrationTester) DeliverCDPMsgRepay(owner sdk.AccAddress, collateralType string, payment sdk.Coin) error

func (*IntegrationTester) DeliverHardMsgRepay

func (suite *IntegrationTester) DeliverHardMsgRepay(owner sdk.AccAddress, repay sdk.Coins) error

func (*IntegrationTester) DeliverHardMsgWithdraw

func (suite *IntegrationTester) DeliverHardMsgWithdraw(owner sdk.AccAddress, withdraw sdk.Coins) error

func (*IntegrationTester) DeliverIncentiveMsg

func (suite *IntegrationTester) DeliverIncentiveMsg(msg sdk.Msg) error

func (*IntegrationTester) DeliverJoltMsgBorrow

func (suite *IntegrationTester) DeliverJoltMsgBorrow(owner sdk.AccAddress, borrow sdk.Coins) error

func (*IntegrationTester) DeliverJoltMsgDeposit

func (suite *IntegrationTester) DeliverJoltMsgDeposit(owner sdk.AccAddress, deposit sdk.Coins) error

func (*IntegrationTester) DeliverMsgCreateCDP

func (suite *IntegrationTester) DeliverMsgCreateCDP(owner sdk.AccAddress, collateral, principal sdk.Coin, collateralType string) error

func (*IntegrationTester) DeliverMsgCreateValidator

func (suite *IntegrationTester) DeliverMsgCreateValidator(address sdk.ValAddress, selfDelegation sdk.Coin) error

func (*IntegrationTester) DeliverMsgDelegate

func (suite *IntegrationTester) DeliverMsgDelegate(delegator sdk.AccAddress, validator sdk.ValAddress, amount sdk.Coin) error

func (*IntegrationTester) ErrorIs

func (suite *IntegrationTester) ErrorIs(err, target error) bool

func (*IntegrationTester) GetAccount

func (suite *IntegrationTester) GetAccount(addr sdk.AccAddress) authtypes.AccountI

func (*IntegrationTester) GetBalance

func (suite *IntegrationTester) GetBalance(address sdk.AccAddress) sdk.Coins

func (*IntegrationTester) GetModuleAccount

func (suite *IntegrationTester) GetModuleAccount(name string) authtypes.ModuleAccountI

func (*IntegrationTester) JoltRewardEquals

func (suite *IntegrationTester) JoltRewardEquals(owner sdk.AccAddress, expected sdk.Coins)

func (*IntegrationTester) NextBlockAfter

func (suite *IntegrationTester) NextBlockAfter(blockDuration time.Duration)

func (*IntegrationTester) NextBlockAt

func (suite *IntegrationTester) NextBlockAt(blockTime time.Time)

func (*IntegrationTester) SetApp

func (suite *IntegrationTester) SetApp()

func (*IntegrationTester) SetupSuite

func (suite *IntegrationTester) SetupSuite()

func (*IntegrationTester) StartChain

func (suite *IntegrationTester) StartChain(genesisTime time.Time, genesisStates ...app.GenesisState)

func (*IntegrationTester) SwapRewardEquals

func (suite *IntegrationTester) SwapRewardEquals(owner sdk.AccAddress, expected sdk.Coins)

func (*IntegrationTester) USDXRewardEquals

func (suite *IntegrationTester) USDXRewardEquals(owner sdk.AccAddress, expected sdk.Coin)

func (*IntegrationTester) VestingPeriodsEqual

func (suite *IntegrationTester) VestingPeriodsEqual(address sdk.AccAddress, expectedPeriods []vestingtypes.Period)

type JoltGenesisBuilder

type JoltGenesisBuilder struct {
	hardtypes.GenesisState
	// contains filtered or unexported fields
}

JoltGenesisBuilder is a tool for creating a jolt genesis state. Helper methods add values onto a default genesis state. All methods are immutable and return updated copies of the builder.

func NewJoltGenesisBuilder

func NewJoltGenesisBuilder() JoltGenesisBuilder

func (JoltGenesisBuilder) Build

func (builder JoltGenesisBuilder) Build() hardtypes.GenesisState

func (JoltGenesisBuilder) BuildMarshalled

func (builder JoltGenesisBuilder) BuildMarshalled(cdc codec.JSONCodec) app.GenesisState

func (JoltGenesisBuilder) WithGenesisTime

func (builder JoltGenesisBuilder) WithGenesisTime(genTime time.Time) JoltGenesisBuilder

func (JoltGenesisBuilder) WithInitializedMoneyMarket

func (builder JoltGenesisBuilder) WithInitializedMoneyMarket(market hardtypes.MoneyMarket) JoltGenesisBuilder

func (JoltGenesisBuilder) WithMinBorrow

func (builder JoltGenesisBuilder) WithMinBorrow(minUSDValue sdk.Dec) JoltGenesisBuilder

Jump to

Keyboard shortcuts

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