simulation

package
v1.0.14 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OpWeightMsgCreateVault           = "op_weight_msg_create_vault"
	OpWeightMsgSwapIn                = "op_weight_msg_swap_in"
	OpWeightMsgSwapOut               = "op_weight_msg_swap_out"
	OpWeightMsgUpdateInterestRate    = "op_weight_msg_update_interest_rate"
	OpWeightMsgUpdateMinInterestRate = "op_weight_msg_update_min_interest_rate"
	OpWeightMsgUpdateMaxInterestRate = "op_weight_msg_update_max_interest_rate"
	OpWeightMsgToggleSwapIn          = "op_weight_msg_toggle_swap_in"
	OpWeightMsgToggleSwapOut         = "op_weight_msg_toggle_swap_out"
	OpWeightMsgDepositInterest       = "op_weight_msg_deposit_interest"
	OpWeightMsgWithdrawInterest      = "op_weight_msg_withdraw_interest"
	OpWeightMsgDepositPrincipal      = "op_weight_msg_deposit_principal"
	OpWeightMsgWithdrawPrincipal     = "op_weight_msg_withdraw_principal"
	OpWeightMsgExpediteSwap          = "op_weight_msg_expedite_swap"
	OpWeightMsgPauseVault            = "op_weight_msg_pause_vault"
	OpWeightMsgUnpauseVault          = "op_weight_msg_unpause_vault"
	OpWeightMsgToggleBridge          = "op_weight_msg_toggle_bridge"
	OpWeightMsgSetBridgeAddress      = "op_weight_msg_set_bridge_address"
	OpWeightMsgBridgeMintShares      = "op_weight_msg_bridge_mint_shares"
	OpWeightMsgBridgeBurnShares      = "op_weight_msg_bridge_burn_shares"
	OpWeightMsgUpdateWithdrawalDelay = "op_weight_msg_update_withdrawal_delay"
)
View Source
const (
	RequiredMarkerAttribute = "kyc.jackthecat.vault"
)
View Source
const (
	// VaultGlobalDenomSuffix is appended to every global marker denom for sim testing.
	VaultGlobalDenomSuffix = "vx"
)

Variables

Functions

func AddAttribute

func AddAttribute(ctx context.Context, acc sdk.AccAddress, attrName string, nk types.NameKeeper, ak types.AttributeKeeper) error

AddAttribute adds an attribute to an account.

func AddNav

func AddNav(ctx context.Context, keeper markerkeeper.Keeper, denom string, admin sdk.AccAddress, price sdk.Coin, volume uint64) error

AddNav adds a net asset value to a marker.

func BridgeAssets

func BridgeAssets(ctx sdk.Context, vk *keeper.Keeper, shareDenom string, mintAmount, burnAmount sdk.Coin) error

BridgeAssets mints and burns shares for a vault to represent assets passed over a bridge.

func CreateGlobalMarker

func CreateGlobalMarker(ctx sdk.Context, ak types.AccountKeeper, bk types.BankKeeper, mk markerkeeper.Keeper, underlying sdk.Coin, accs []simtypes.Account, restricted bool) error

CreateGlobalMarker creates a new marker and distributes its coins to a given set of accounts.

func CreateMarker

func CreateMarker(ctx context.Context, coin sdk.Coin, admin sdk.AccAddress, keeper markerkeeper.Keeper) error

CreateMarker creates a new restricted marker of type COIN.

func CreateUnrestrictedMarker

func CreateUnrestrictedMarker(ctx context.Context, coin sdk.Coin, admin sdk.AccAddress, keeper markerkeeper.Keeper) error

CreateUnrestrictedMarker creates a new unrestricted marker of type COIN.

func CreateVault

func CreateVault(ctx sdk.Context, vk *keeper.Keeper, ak types.AccountKeeper, bk types.BankKeeper, mk markerkeeper.Keeper, underlying, paymentDenom, share string, admin simtypes.Account, accs []simtypes.Account) error

CreateVault creates a new vault with a marker and funds accounts.

func DepositInterestFunds

func DepositInterestFunds(ctx sdk.Context, vk *keeper.Keeper, shareDenom string, amount sdk.Coin) (*types.MsgDepositInterestFundsResponse, error)

DepositInterest deposits interest into a vault.

func DepositPrincipalFunds

func DepositPrincipalFunds(ctx sdk.Context, vk *keeper.Keeper, shareDenom string, amount sdk.Coin) (*types.MsgDepositPrincipalFundsResponse, error)

DepositPrincipal deposits principal into a vault.

func FundAccount

func FundAccount(ctx context.Context, bk types.BankKeeper, addr sdk.AccAddress, amounts sdk.Coins) error

FundAccount mints new coins and sends them to an account.

func IsSetup

func IsSetup(k keeper.Keeper, ctx sdk.Context) bool

IsSetup checks if the simulation has been set up with any vaults.

func MarkerExists

func MarkerExists(ctx sdk.Context, markerKeeper types.MarkerKeeper, denom string) bool

MarkerExists checks if a marker with the given denom exists.

func NewAttribute added in v1.0.1

func NewAttribute(name string, address string, attrType attrtypes.AttributeType, value []byte, expirationDate *time.Time) attrtypes.Attribute

NewAttribute creates a new instance of an Attribute.

func PauseVault

func PauseVault(ctx sdk.Context, vk *keeper.Keeper, shareDenom string) error

PauseVault pauses a vault.

func RandomizedGenState

func RandomizedGenState(simState *module.SimulationState)

RandomizedGenState generates a random GenesisState for the vault module

func SetVaultBridge

func SetVaultBridge(ctx sdk.Context, vk *keeper.Keeper, shareDenom string, bridgeAddr sdk.AccAddress, enabled bool) error

SetVaultBridge sets the bridge address and enabled flag for a vault.

func Setup

Setup ensures the simulation is ready by creating global markers and an initial vault if none exist.

func SimulateMsgBridgeBurnShares

func SimulateMsgBridgeBurnShares(k keeper.Keeper) simtypes.Operation

SimulateMsgBridgeBurnShares creates a message to burn shares from the bridge address

func SimulateMsgBridgeMintShares

func SimulateMsgBridgeMintShares(k keeper.Keeper) simtypes.Operation

SimulateMsgBridgeMintShares creates a message to mint shares to the bridge address

func SimulateMsgCreateVault

func SimulateMsgCreateVault(k keeper.Keeper) simtypes.Operation

func SimulateMsgDepositInterestFunds

func SimulateMsgDepositInterestFunds(k keeper.Keeper) simtypes.Operation

func SimulateMsgDepositPrincipalFunds

func SimulateMsgDepositPrincipalFunds(k keeper.Keeper) simtypes.Operation

func SimulateMsgExpeditePendingSwapOut

func SimulateMsgExpeditePendingSwapOut(k keeper.Keeper) simtypes.Operation

func SimulateMsgPauseVault

func SimulateMsgPauseVault(k keeper.Keeper) simtypes.Operation

func SimulateMsgSetBridgeAddress

func SimulateMsgSetBridgeAddress(k keeper.Keeper) simtypes.Operation

SimulateMsgSetBridgeAddress creates a message to set the bridge address for a vault

func SimulateMsgSwapIn

func SimulateMsgSwapIn(k keeper.Keeper) simtypes.Operation

func SimulateMsgSwapOut

func SimulateMsgSwapOut(k keeper.Keeper) simtypes.Operation

func SimulateMsgToggleBridge

func SimulateMsgToggleBridge(k keeper.Keeper) simtypes.Operation

func SimulateMsgToggleSwapIn

func SimulateMsgToggleSwapIn(k keeper.Keeper) simtypes.Operation

func SimulateMsgToggleSwapOut

func SimulateMsgToggleSwapOut(k keeper.Keeper) simtypes.Operation

func SimulateMsgUnpauseVault

func SimulateMsgUnpauseVault(k keeper.Keeper) simtypes.Operation

func SimulateMsgUpdateInterestRate

func SimulateMsgUpdateInterestRate(k keeper.Keeper) simtypes.Operation

func SimulateMsgUpdateMaxInterestRate

func SimulateMsgUpdateMaxInterestRate(k keeper.Keeper) simtypes.Operation

func SimulateMsgUpdateMinInterestRate

func SimulateMsgUpdateMinInterestRate(k keeper.Keeper) simtypes.Operation

func SimulateMsgUpdateWithdrawalDelay added in v1.0.14

func SimulateMsgUpdateWithdrawalDelay(k keeper.Keeper) simtypes.Operation

func SimulateMsgWithdrawInterestFunds

func SimulateMsgWithdrawInterestFunds(k keeper.Keeper) simtypes.Operation

func SimulateMsgWithdrawPrincipalFunds

func SimulateMsgWithdrawPrincipalFunds(k keeper.Keeper) simtypes.Operation

func SwapIn

func SwapIn(ctx sdk.Context, vk *keeper.Keeper, user simtypes.Account, shareDenom string, amount sdk.Coin) error

SwapIn performs a swap in for a user.

func SwapOut

func SwapOut(ctx sdk.Context, vk *keeper.Keeper, user simtypes.Account, shares sdk.Coin, redeemDenom string) error

SwapOut performs a swap out for a user.

func UpdateVaultTotalShares

func UpdateVaultTotalShares(ctx sdk.Context, vk *keeper.Keeper, shares sdk.Coin) error

UpdateVaultTotalShares sets the total shares amount in the vault.

Types

This section is empty.

Jump to

Keyboard shortcuts

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