testutil

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 36 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 EarnGenesisBuilder added in v0.19.0

type EarnGenesisBuilder struct {
	earntypes.GenesisState
}

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

func NewEarnGenesisBuilder added in v0.19.0

func NewEarnGenesisBuilder() EarnGenesisBuilder

func (EarnGenesisBuilder) Build added in v0.19.0

func (builder EarnGenesisBuilder) Build() earntypes.GenesisState

func (EarnGenesisBuilder) BuildMarshalled added in v0.19.0

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

func (EarnGenesisBuilder) WithAllowedVaults added in v0.19.0

func (builder EarnGenesisBuilder) WithAllowedVaults(vault ...earntypes.AllowedVault) EarnGenesisBuilder

type GenesisBuilder added in v0.19.0

type GenesisBuilder interface {
	BuildMarshalled(cdc codec.JSONCodec) app.GenesisState
}

type HardGenesisBuilder

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

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

func NewHardGenesisBuilder

func NewHardGenesisBuilder() HardGenesisBuilder

func (HardGenesisBuilder) Build

func (builder HardGenesisBuilder) Build() hardtypes.GenesisState

func (HardGenesisBuilder) BuildMarshalled

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

func (HardGenesisBuilder) WithGenesisTime

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

func (HardGenesisBuilder) WithInitializedMoneyMarket

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

func (HardGenesisBuilder) WithMinBorrow

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

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) WithInitializedEarnRewardPeriod added in v0.19.0

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

WithInitializedEarnRewardPeriod 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 added in v0.17.0

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) WithSimpleEarnRewardPeriod added in v0.19.0

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

func (IncentiveGenesisBuilder) WithSimpleSavingsRewardPeriod added in v0.17.0

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

	GenesisTime time.Time
}

func (*IntegrationTester) AddIncentiveEarnMultiRewardPeriod added in v0.19.0

func (suite *IntegrationTester) AddIncentiveEarnMultiRewardPeriod(period types.MultiRewardPeriod)

func (*IntegrationTester) AddTestAddrsFromPubKeys added in v0.19.0

func (suite *IntegrationTester) AddTestAddrsFromPubKeys(ctx sdk.Context, pubKeys []cryptotypes.PubKey, accAmt sdkmath.Int)

AddTestAddrsFromPubKeys adds the addresses into the SimApp providing only the public keys.

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) DeliverEarnMsgDeposit added in v0.19.0

func (suite *IntegrationTester) DeliverEarnMsgDeposit(
	depositor sdk.AccAddress,
	amount sdk.Coin,
	strategy earntypes.StrategyType,
) error

func (*IntegrationTester) DeliverHardMsgBorrow

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

func (*IntegrationTester) DeliverHardMsgDeposit

func (suite *IntegrationTester) DeliverHardMsgDeposit(owner sdk.AccAddress, deposit sdk.Coins) 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) 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) DeliverMsgDelegateMint added in v0.19.0

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

func (*IntegrationTester) DeliverMsgMintDerivative added in v0.19.0

func (suite *IntegrationTester) DeliverMsgMintDerivative(
	sender sdk.AccAddress,
	validator sdk.ValAddress,
	amount sdk.Coin,
) (sdk.Coin, error)

func (*IntegrationTester) DeliverRouterMsgDelegateMintDeposit added in v0.19.0

func (suite *IntegrationTester) DeliverRouterMsgDelegateMintDeposit(
	depositor sdk.AccAddress,
	validator sdk.ValAddress,
	amount sdk.Coin,
) error

func (*IntegrationTester) DeliverRouterMsgMintDeposit added in v0.19.0

func (suite *IntegrationTester) DeliverRouterMsgMintDeposit(
	depositor sdk.AccAddress,
	validator sdk.ValAddress,
	amount sdk.Coin,
) error

func (*IntegrationTester) DeliverSwapMsgDeposit

func (suite *IntegrationTester) DeliverSwapMsgDeposit(depositor sdk.AccAddress, tokenA, tokenB sdk.Coin, slippage sdk.Dec) error

func (*IntegrationTester) EarnRewardEquals added in v0.19.0

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

func (*IntegrationTester) ErrorIs

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

func (*IntegrationTester) GetAbciValidator added in v0.19.0

func (suite *IntegrationTester) GetAbciValidator(valAddr sdk.ValAddress) abcitypes.Validator

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) GetBeginBlockClaimedStakingRewards added in v0.19.0

func (suite *IntegrationTester) GetBeginBlockClaimedStakingRewards(
	resBeginBlock abcitypes.ResponseBeginBlock,
) (validatorRewards map[string]sdk.Coins, totalRewards sdk.Coins)

func (*IntegrationTester) GetModuleAccount

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

func (*IntegrationTester) HardRewardEquals

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

func (*IntegrationTester) MintLiquidAnyValAddr added in v0.19.0

func (suite *IntegrationTester) MintLiquidAnyValAddr(
	owner sdk.AccAddress,
	validator sdk.ValAddress,
	amount sdk.Coin,
) (sdk.Coin, error)

MintLiquidAnyValAddr mints liquid tokens with the given validator address, creating the validator if it does not already exist. **Note:** This will increment the block height/time and run the End and Begin blockers!

func (*IntegrationTester) NextBlockAfter

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

func (*IntegrationTester) NextBlockAfterWithReq added in v0.19.0

func (*IntegrationTester) NextBlockAt

func (*IntegrationTester) NextBlockAtWithRequest added in v0.19.0

func (*IntegrationTester) ProposeAndVoteOnNewParams

func (suite *IntegrationTester) ProposeAndVoteOnNewParams(voter sdk.AccAddress, committeeID uint64, changes []proposaltypes.ParamChange)

func (*IntegrationTester) SetApp added in v0.16.0

func (suite *IntegrationTester) SetApp()

func (*IntegrationTester) SetupSuite

func (suite *IntegrationTester) SetupSuite()

func (*IntegrationTester) SetupTest added in v0.19.0

func (suite *IntegrationTester) SetupTest()

func (*IntegrationTester) StartChain

func (suite *IntegrationTester) StartChain(genesisStates ...app.GenesisState)

func (*IntegrationTester) StartChainWithBuilders added in v0.19.0

func (suite *IntegrationTester) StartChainWithBuilders(builders ...GenesisBuilder)

func (*IntegrationTester) StoredEarnIndexesEqual added in v0.19.0

func (suite *IntegrationTester) StoredEarnIndexesEqual(denom string, expected types.RewardIndexes)

func (*IntegrationTester) StoredEarnTimeEquals added in v0.19.0

func (suite *IntegrationTester) StoredEarnTimeEquals(denom string, expected time.Time)

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)

func (*IntegrationTester) WithGenesisTime added in v0.19.0

func (suite *IntegrationTester) WithGenesisTime(genesisTime time.Time)

type MintGenesisBuilder added in v0.19.0

type MintGenesisBuilder struct {
	minttypes.GenesisState
}

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

func NewMintGenesisBuilder added in v0.19.0

func NewMintGenesisBuilder() MintGenesisBuilder

func (MintGenesisBuilder) Build added in v0.19.0

func (builder MintGenesisBuilder) Build() minttypes.GenesisState

func (MintGenesisBuilder) BuildMarshalled added in v0.19.0

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

func (MintGenesisBuilder) WithInflationMax added in v0.19.0

func (builder MintGenesisBuilder) WithInflationMax(
	inflationMax sdk.Dec,
) MintGenesisBuilder

func (MintGenesisBuilder) WithInflationMin added in v0.19.0

func (builder MintGenesisBuilder) WithInflationMin(
	inflationMin sdk.Dec,
) MintGenesisBuilder

func (MintGenesisBuilder) WithMintDenom added in v0.19.0

func (builder MintGenesisBuilder) WithMintDenom(
	mintDenom string,
) MintGenesisBuilder

func (MintGenesisBuilder) WithMinter added in v0.19.0

func (builder MintGenesisBuilder) WithMinter(
	inflation sdk.Dec,
	annualProvisions sdk.Dec,
) MintGenesisBuilder

type SavingsGenesisBuilder added in v0.19.0

type SavingsGenesisBuilder struct {
	savingstypes.GenesisState
	// contains filtered or unexported fields
}

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

func NewSavingsGenesisBuilder added in v0.19.0

func NewSavingsGenesisBuilder() SavingsGenesisBuilder

func (SavingsGenesisBuilder) Build added in v0.19.0

func (SavingsGenesisBuilder) BuildMarshalled added in v0.19.0

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

func (SavingsGenesisBuilder) WithGenesisTime added in v0.19.0

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

func (SavingsGenesisBuilder) WithSupportedDenoms added in v0.19.0

func (builder SavingsGenesisBuilder) WithSupportedDenoms(denoms ...string) SavingsGenesisBuilder

type StakingGenesisBuilder added in v0.19.0

type StakingGenesisBuilder struct {
	stakingtypes.GenesisState
}

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

func NewStakingGenesisBuilder added in v0.19.0

func NewStakingGenesisBuilder() StakingGenesisBuilder

func (StakingGenesisBuilder) Build added in v0.19.0

func (StakingGenesisBuilder) BuildMarshalled added in v0.19.0

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

Jump to

Keyboard shortcuts

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