simulation

package
v1.19.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QuarantineOptIn    = "quarantine-opt-in"
	QuarantineAutoResp = "quarantine-auto-resp"
	QuarantineFunds    = "quarantine-funds"
)
View Source
const (
	OpMsgOptIn               = "op_weight_quarantine_msg_opt_in"
	OpMsgOptOut              = "op_weight_quarantine_msg_opt_out"
	OpMsgAccept              = "op_weight_quarantine_msg_accept"
	OpMsgDecline             = "op_weight_quarantine_msg_decline"
	OpMsgUpdateAutoResponses = "op_weight_quarantine_msg_update_auto_responses"
)

Simulation operation weights constants.

View Source
const (
	WeightMsgOptIn               = 100
	WeightMsgOptOut              = 50
	WeightMsgAccept              = 50
	WeightMsgDecline             = 20
	WeightMsgUpdateAutoResponses = 50
)

Default weights.

Variables

View Source
var (
	TypeMsgOptIn               = sdk.MsgTypeURL(&quarantine.MsgOptIn{})
	TypeMsgOptOut              = sdk.MsgTypeURL(&quarantine.MsgOptOut{})
	TypeMsgAccept              = sdk.MsgTypeURL(&quarantine.MsgAccept{})
	TypeMsgDecline             = sdk.MsgTypeURL(&quarantine.MsgDecline{})
	TypeMsgUpdateAutoResponses = sdk.MsgTypeURL(&quarantine.MsgUpdateAutoResponses{})
)

Quarantine message types.

Functions

func NewDecodeStore

func NewDecodeStore(cdc codec.Codec) func(kvA, kvB kv.Pair) string

NewDecodeStore returns a decoder function closure that unmarshals the KVPair's Value to the corresponding group type.

func RandomQuarantineAutoResponses

func RandomQuarantineAutoResponses(r *rand.Rand, quarantinedAddrs []string) []*quarantine.AutoResponseEntry

RandomQuarantineAutoResponses randomly defines some auto-responses for some of the provided addresses (and maybe others).

func RandomQuarantinedAddresses

func RandomQuarantinedAddresses(r *rand.Rand, accounts []simtypes.Account) []string

RandomQuarantinedAddresses randomly selects accounts from the ones provided to be quarantined.

func RandomQuarantinedFunds

func RandomQuarantinedFunds(r *rand.Rand, quarantinedAddrs []string) []*quarantine.QuarantinedFunds

RandomQuarantinedFunds randomly generates some quarantined funds for some of the provided addresses.

func RandomizedGenState

func RandomizedGenState(simState *module.SimulationState, fundsHolder sdk.AccAddress)

RandomizedGenState generates a random GenesisState for the quarantine module.

func SimulateMsgAccept

SimulateMsgAccept accepts quarantined funds.

func SimulateMsgDecline

SimulateMsgDecline declines quarantined funds.

func SimulateMsgOptIn

SimulateMsgOptIn opts an account into quarantine.

func SimulateMsgOptOut

SimulateMsgOptOut opts an account out of quarantine.

func SimulateMsgUpdateAutoResponses

func SimulateMsgUpdateAutoResponses(simState module.SimulationState, ak quarantine.AccountKeeper, bk quarantine.BankKeeper, k keeper.Keeper) simtypes.Operation

SimulateMsgUpdateAutoResponses updates an accounts auto-responses

func WeightedOperations

WeightedOperations returns all the operations from the module with their respective weights

Types

This section is empty.

Jump to

Keyboard shortcuts

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