Documentation
¶
Index ¶
- Constants
- Variables
- func AddAttribute(ctx context.Context, owner sdk.AccAddress, acc sdk.AccAddress, attrName string, ...) error
- func AddNav(ctx context.Context, keeper markerkeeper.Keeper, denom string, ...) error
- func BindName(ctx context.Context, acc sdk.AccAddress, name string, nk types.NameKeeper) error
- func BridgeAssets(ctx sdk.Context, vk *keeper.Keeper, shareDenom string, ...) error
- func CreateGlobalMarker(ctx sdk.Context, ak types.AccountKeeper, bk types.BankKeeper, ...) error
- func CreateMarker(ctx context.Context, coin sdk.Coin, admin sdk.AccAddress, ...) error
- func CreateUnrestrictedMarker(ctx context.Context, coin sdk.Coin, admin sdk.AccAddress, ...) error
- func CreateVault(ctx sdk.Context, vk *keeper.Keeper, ak types.AccountKeeper, ...) error
- func DepositInterestFunds(ctx sdk.Context, vk *keeper.Keeper, shareDenom string, amount sdk.Coin) (*types.MsgDepositInterestFundsResponse, error)
- func DepositPrincipalFunds(ctx sdk.Context, vk *keeper.Keeper, shareDenom string, amount sdk.Coin) (*types.MsgDepositPrincipalFundsResponse, error)
- func FundAccount(ctx context.Context, bk types.BankKeeper, addr sdk.AccAddress, ...) error
- func GrantAccess(ctx context.Context, keeper markerkeeper.Keeper, denom string, ...) error
- func GrantTransferPermission(ctx context.Context, keeper markerkeeper.Keeper, denom string, ...) error
- func GrantWithdrawPermission(ctx context.Context, keeper markerkeeper.Keeper, denom string, ...) error
- func IsSetup(k keeper.Keeper, ctx sdk.Context) bool
- func MarkerExists(ctx sdk.Context, markerKeeper types.MarkerKeeper, denom string) bool
- func NewAttribute(name string, address string, attrType attrtypes.AttributeType, value []byte, ...) attrtypes.Attribute
- func PauseVault(ctx sdk.Context, vk *keeper.Keeper, shareDenom string) error
- func PrepareVaultMarkers(ctx sdk.Context, ak types.AccountKeeper, mk markerkeeper.Keeper, ...) error
- func RandomizedGenState(simState *module.SimulationState)
- func SetVaultBridge(ctx sdk.Context, vk *keeper.Keeper, shareDenom string, ...) error
- func Setup(ctx sdk.Context, r *rand.Rand, k keeper.Keeper, ak types.AccountKeeper, ...) error
- func SimulateMsgBridgeBurnShares(k keeper.Keeper) simtypes.Operation
- func SimulateMsgBridgeMintShares(k keeper.Keeper) simtypes.Operation
- func SimulateMsgCreateVault(k keeper.Keeper) simtypes.Operation
- func SimulateMsgDepositInterestFunds(k keeper.Keeper) simtypes.Operation
- func SimulateMsgDepositPrincipalFunds(k keeper.Keeper) simtypes.Operation
- func SimulateMsgExpeditePendingSwapOut(k keeper.Keeper) simtypes.Operation
- func SimulateMsgPauseVault(k keeper.Keeper) simtypes.Operation
- func SimulateMsgSetBridgeAddress(k keeper.Keeper) simtypes.Operation
- func SimulateMsgSwapIn(k keeper.Keeper) simtypes.Operation
- func SimulateMsgSwapOut(k keeper.Keeper) simtypes.Operation
- func SimulateMsgToggleBridge(k keeper.Keeper) simtypes.Operation
- func SimulateMsgToggleSwapIn(k keeper.Keeper) simtypes.Operation
- func SimulateMsgToggleSwapOut(k keeper.Keeper) simtypes.Operation
- func SimulateMsgUnpauseVault(k keeper.Keeper) simtypes.Operation
- func SimulateMsgUpdateInterestRate(k keeper.Keeper) simtypes.Operation
- func SimulateMsgUpdateMaxInterestRate(k keeper.Keeper) simtypes.Operation
- func SimulateMsgUpdateMaxSwapInValue(k keeper.Keeper) simtypes.Operation
- func SimulateMsgUpdateMaxSwapOutValue(k keeper.Keeper) simtypes.Operation
- func SimulateMsgUpdateMinInterestRate(k keeper.Keeper) simtypes.Operation
- func SimulateMsgUpdateMinSwapInValue(k keeper.Keeper) simtypes.Operation
- func SimulateMsgUpdateMinSwapOutValue(k keeper.Keeper) simtypes.Operation
- func SimulateMsgUpdateParams(k keeper.Keeper) simtypes.Operation
- func SimulateMsgUpdateVaultAUMFeeBips(k keeper.Keeper) simtypes.Operation
- func SimulateMsgUpdateWithdrawalDelay(k keeper.Keeper) simtypes.Operation
- func SimulateMsgWithdrawInterestFunds(k keeper.Keeper) simtypes.Operation
- func SimulateMsgWithdrawPrincipalFunds(k keeper.Keeper) simtypes.Operation
- func SwapIn(ctx sdk.Context, vk *keeper.Keeper, user simtypes.Account, shareDenom string, ...) error
- func SwapOut(ctx sdk.Context, vk *keeper.Keeper, user simtypes.Account, shares sdk.Coin, ...) error
- func UpdateVaultTotalShares(ctx sdk.Context, vk *keeper.Keeper, shares sdk.Coin) error
- func WeightedOperations(simState module.SimulationState, k keeper.Keeper) simulation.WeightedOperations
Constants ¶
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" OpWeightMsgUpdateWithdrawalDelay = "op_weight_msg_update_withdrawal_delay" OpWeightMsgUpdateParams = "op_weight_msg_update_params" OpWeightMsgUpdateVaultAUMFeeBips = "op_weight_msg_update_vault_aum_fee_bips" OpWeightMsgUpdateMinSwapInValue = "op_weight_msg_update_min_swap_in_value" OpWeightMsgUpdateMinSwapOutValue = "op_weight_msg_update_min_swap_out_value" OpWeightMsgUpdateMaxSwapInValue = "op_weight_msg_update_max_swap_in_value" OpWeightMsgUpdateMaxSwapOutValue = "op_weight_msg_update_max_swap_out_value" )
const (
RequiredMarkerAttribute = "simulation.restricted"
)
const (
// VaultGlobalDenomSuffix is appended to every global marker denom for sim testing.
VaultGlobalDenomSuffix = "vx"
)
Variables ¶
var DefaultWeights = map[string]int{ OpWeightMsgCreateVault: 4, OpWeightMsgSwapIn: 18, OpWeightMsgSwapOut: 8, OpWeightMsgUpdateInterestRate: 7, OpWeightMsgUpdateMinInterestRate: 2, OpWeightMsgUpdateMaxInterestRate: 2, OpWeightMsgToggleSwapIn: 6, OpWeightMsgToggleSwapOut: 6, OpWeightMsgDepositInterest: 3, OpWeightMsgWithdrawInterest: 3, OpWeightMsgDepositPrincipal: 3, OpWeightMsgWithdrawPrincipal: 3, OpWeightMsgExpediteSwap: 2, OpWeightMsgPauseVault: 2, OpWeightMsgUnpauseVault: 2, OpWeightMsgToggleBridge: 2, OpWeightMsgSetBridgeAddress: 2, OpWeightMsgBridgeMintShares: 6, OpWeightMsgBridgeBurnShares: 6, OpWeightMsgUpdateWithdrawalDelay: 2, OpWeightMsgUpdateParams: 1, OpWeightMsgUpdateVaultAUMFeeBips: 2, OpWeightMsgUpdateMinSwapInValue: 2, OpWeightMsgUpdateMinSwapOutValue: 2, OpWeightMsgUpdateMaxSwapInValue: 2, OpWeightMsgUpdateMaxSwapOutValue: 2, }
Functions ¶
func AddAttribute ¶
func AddAttribute(ctx context.Context, owner sdk.AccAddress, acc sdk.AccAddress, attrName string, nk types.NameKeeper, ak types.AttributeKeeper) error
AddAttribute adds an attribute to an account using the provided owner to authorize the action.
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 BindName ¶ added in v1.1.0
func BindName(ctx context.Context, acc sdk.AccAddress, name string, nk types.NameKeeper) error
BindName ensures that a name is bound to an address if it doesn't already exist. If the name has multiple segments (separated by dots), it attempts to bind each parent segment recursively from right to left.
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, feeCollector sdk.AccAddress) 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, feeCollector sdk.AccAddress) 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 GrantAccess ¶ added in v1.1.0
func GrantAccess(ctx context.Context, keeper markerkeeper.Keeper, denom string, grantee sdk.AccAddress, admin sdk.AccAddress, access markertypes.AccessList) error
GrantAccess grants specified permissions to an account for a given marker.
func GrantTransferPermission ¶ added in v1.1.0
func GrantTransferPermission(ctx context.Context, keeper markerkeeper.Keeper, denom string, grantee sdk.AccAddress, admin sdk.AccAddress) error
GrantTransferPermission grants transfer permission to an account for a given marker.
func GrantWithdrawPermission ¶ added in v1.1.0
func GrantWithdrawPermission(ctx context.Context, keeper markerkeeper.Keeper, denom string, grantee sdk.AccAddress, admin sdk.AccAddress) error
GrantWithdrawPermission grants withdraw permission to an account for a given marker.
func MarkerExists ¶
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 ¶
PauseVault pauses a vault.
func PrepareVaultMarkers ¶ added in v1.1.0
func PrepareVaultMarkers(ctx sdk.Context, ak types.AccountKeeper, mk markerkeeper.Keeper, underlying, paymentDenom, share string) error
PrepareVaultMarkers grants the necessary permissions to the predicted vault address for its underlying and payment markers. This is required for the vault creation pre-flight check and for collecting AUM fees.
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 ¶
func Setup(ctx sdk.Context, r *rand.Rand, k keeper.Keeper, ak types.AccountKeeper, bk types.BankKeeper, mk types.MarkerKeeper, accs []simtypes.Account) error
Setup ensures the simulation is ready by initializing the AUM fee collector account, binding the required marker attribute name, granting that attribute to all simulation accounts, creating global markers, and creating an initial vault if none exist.
func SimulateMsgBridgeBurnShares ¶
SimulateMsgBridgeBurnShares creates a message to burn shares from the bridge address
func SimulateMsgBridgeMintShares ¶
SimulateMsgBridgeMintShares creates a message to mint shares to the bridge address
func SimulateMsgSetBridgeAddress ¶
SimulateMsgSetBridgeAddress creates a message to set the bridge address for a vault
func SimulateMsgUpdateMaxSwapInValue ¶ added in v1.1.0
func SimulateMsgUpdateMaxSwapOutValue ¶ added in v1.1.0
func SimulateMsgUpdateMinSwapInValue ¶ added in v1.1.0
func SimulateMsgUpdateMinSwapOutValue ¶ added in v1.1.0
func SimulateMsgUpdateParams ¶ added in v1.1.0
func SimulateMsgUpdateVaultAUMFeeBips ¶ added in v1.1.0
func SimulateMsgUpdateWithdrawalDelay ¶ added in v1.0.14
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 ¶
UpdateVaultTotalShares sets the total shares amount in the vault.
func WeightedOperations ¶
func WeightedOperations(simState module.SimulationState, k keeper.Keeper) simulation.WeightedOperations
Types ¶
This section is empty.