Documentation
¶
Index ¶
- Constants
- Variables
- func AddAttribute(ctx context.Context, acc sdk.AccAddress, attrName string, nk types.NameKeeper, ...) error
- func AddNav(ctx context.Context, keeper markerkeeper.Keeper, denom string, ...) 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 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 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 SimulateMsgUpdateMinInterestRate(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" )
const (
RequiredMarkerAttribute = "kyc.jackthecat.vault"
)
const (
// VaultGlobalDenomSuffix is appended to every global marker denom for sim testing.
VaultGlobalDenomSuffix = "vx"
)
Variables ¶
var DefaultWeights = map[string]int{ OpWeightMsgCreateVault: 4, OpWeightMsgSwapIn: 25, OpWeightMsgSwapOut: 12, 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, }
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 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 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 creating global markers and 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 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.