Documentation ¶
Index ¶
- Constants
- func MaxCoins(a, b sdk.Coins) sdk.Coins
- func NewDecodeStore(_ codec.Codec) func(kvA, kvB kv.Pair) string
- func OperationMsgVote(args *WeightedOpsArgs, voter simtypes.Account, govPropID uint64, ...) simtypes.Operation
- func RandomParams(r *rand.Rand) *sanction.Params
- func RandomSanctionedAddresses(r *rand.Rand, accounts []simtypes.Account) []string
- func RandomTempEntries(r *rand.Rand, accounts []simtypes.Account) []*sanction.TemporaryEntry
- func RandomizedGenState(simState *module.SimulationState)
- func SendGovMsg(args *SendGovMsgArgs) (bool, simtypes.OperationMsg, error)
- func SimulateGovMsgSanction(args *WeightedOpsArgs) simtypes.Operation
- func SimulateGovMsgSanctionImmediate(args *WeightedOpsArgs) simtypes.Operation
- func SimulateGovMsgUnsanction(args *WeightedOpsArgs) simtypes.Operation
- func SimulateGovMsgUnsanctionImmediate(args *WeightedOpsArgs) simtypes.Operation
- func SimulateGovMsgUpdateParams(args *WeightedOpsArgs) simtypes.Operation
- func WeightedOperations(appParams simtypes.AppParams, jsonCodec codec.JSONCodec, ...) simulation.WeightedOperations
- type SendGovMsgArgs
- type WeightedOpsArgs
Constants ¶
const ( SanctionAddresses = "sanction-addresses" SanctionTempEntries = "sanction-temp-entries" SanctionParams = "sanction-params" )
const ( OpWeightSanction = "op_weight_sanction" //nolint:gosec OpWeightSanctionImmediate = "op_weight_sanction_immediate" //nolint:gosec OpWeightUnsanction = "op_weight_unsanction" //nolint:gosec OpWeightUnsanctionImmediate = "op_weight_unsanction_immediate" //nolint:gosec OpWeightUpdateParams = "op_weight_update_params" //nolint:gosec DefaultWeightSanction = 10 DefaultWeightSanctionImmediate = 10 DefaultWeightUnsanction = 10 DefaultWeightUnsanctionImmediate = 10 DefaultWeightUpdateParams = 10 )
Variables ¶
This section is empty.
Functions ¶
func MaxCoins ¶
MaxCoins combines a and b taking the max of each denom. The result will have all the denoms from a and all the denoms from b. The amount of each denom is the max between a and b for that denom.
func OperationMsgVote ¶
func OperationMsgVote(args *WeightedOpsArgs, voter simtypes.Account, govPropID uint64, vote govv1.VoteOption, comment string) simtypes.Operation
OperationMsgVote returns an operation that casts a yes vote on a gov prop from an account.
func RandomParams ¶
RandomParams generates randomized parameters for the sanction module.
ImmediateSanctionMinDeposit and ImmediateUnsanctionMinDeposit are decided individually. Each has a: * 20% chance of being empty/zero. * 80% chance of being between 1 and 1000 (inclusive) of the default bond denom.
func RandomSanctionedAddresses ¶
RandomSanctionedAddresses randomly selects accounts to be sanctioned.
Each account has a: * 20% chance of being sanctioned, * 80% chance of being ignored.
func RandomTempEntries ¶
RandomTempEntries randomly selects accounts to be temporarily sanctioned/unsanctioned.
Each account has a: * 10% chance of having a temp sanction, * 10% chance of having a temp unsanction, * 80% chance of being ignored.
func RandomizedGenState ¶
func RandomizedGenState(simState *module.SimulationState)
RandomizedGenState creates a randomized sanction genesis state and adds it to the provided simState's GenState map.
func SendGovMsg ¶
func SendGovMsg(args *SendGovMsgArgs) (bool, simtypes.OperationMsg, error)
SendGovMsg sends a msg as a gov prop. It returns whether to skip the rest, an operation message, and any error encountered.
func SimulateGovMsgSanction ¶
func SimulateGovMsgSanction(args *WeightedOpsArgs) simtypes.Operation
func SimulateGovMsgSanctionImmediate ¶
func SimulateGovMsgSanctionImmediate(args *WeightedOpsArgs) simtypes.Operation
func SimulateGovMsgUnsanction ¶
func SimulateGovMsgUnsanction(args *WeightedOpsArgs) simtypes.Operation
func SimulateGovMsgUnsanctionImmediate ¶
func SimulateGovMsgUnsanctionImmediate(args *WeightedOpsArgs) simtypes.Operation
func SimulateGovMsgUpdateParams ¶
func SimulateGovMsgUpdateParams(args *WeightedOpsArgs) simtypes.Operation
func WeightedOperations ¶
func WeightedOperations( appParams simtypes.AppParams, jsonCodec codec.JSONCodec, protoCodec *codec.ProtoCodec, ak sanction.AccountKeeper, bk sanction.BankKeeper, gk sanction.GovKeeper, sk keeper.Keeper, ) simulation.WeightedOperations
Types ¶
type SendGovMsgArgs ¶
type SendGovMsgArgs struct { WeightedOpsArgs R *rand.Rand App *baseapp.BaseApp Ctx sdk.Context Accs []simtypes.Account ChainID string Sender simtypes.Account Msg sdk.Msg Deposit sdk.Coins Comment string }
SendGovMsgArgs holds all the args available and needed for sending a gov msg.
type WeightedOpsArgs ¶
type WeightedOpsArgs struct { AppParams simtypes.AppParams JSONCodec codec.JSONCodec ProtoCodec *codec.ProtoCodec AK sanction.AccountKeeper BK sanction.BankKeeper GK sanction.GovKeeper SK *keeper.Keeper }
WeightedOpsArgs holds all the args provided to WeightedOperations so that they can be passed on later more easily.