Documentation ¶
Index ¶
- Constants
- func DecodeStore(cdc *codec.Codec, kvA, kvB kv.Pair) string
- func ProposalContents(k keeper.Keeper, paramChanges []simulation.ParamChange) []simulation.WeightedProposalContent
- func RandInt(r *rand.Rand, inclusiveMin, exclusiveMax sdk.Int) (sdk.Int, error)
- func RandIntInclusive(r *rand.Rand, inclusiveMin, inclusiveMax sdk.Int) (sdk.Int, error)
- func RandomAddresses(r *rand.Rand, accs []simulation.Account) []sdk.AccAddress
- func RandomCommittee(r *rand.Rand, availableAccs []simulation.Account, ...) (types.Committee, error)
- func RandomPermissions(r *rand.Rand, allowedParams []types.AllowedParam) []types.Permission
- func RandomPositiveDuration(r *rand.Rand, inclusiveMin, exclusiveMax time.Duration) (time.Duration, error)
- func RandomTime(r *rand.Rand, inclusiveMin, exclusiveMax time.Time) (time.Time, error)
- func RandomizedGenState(simState *module.SimulationState)
- func SimulateCommitteeChangeProposalContent(k keeper.Keeper, paramChanges []simulation.ParamChange) simulation.ContentSimulatorFn
- func SimulateMsgSubmitProposal(cdc *codec.Codec, ak AccountKeeper, k keeper.Keeper, ...) simulation.Operation
- func SimulateMsgVote(k keeper.Keeper, ak AccountKeeper, voter sdk.AccAddress, proposalID uint64) simulation.Operation
- func WeightedOperations(appParams simulation.AppParams, cdc *codec.Codec, ak AccountKeeper, ...) simulation.WeightedOperations
- type AccountKeeper
Constants ¶
const ( // Calculate the average block time AverageBlockTime time.Duration = (maxTimePerBlock - minTimePerBlock) / 2 FallbackCommitteeID uint64 = 0 )
const OpWeightSubmitCommitteeChangeProposal = "op_weight_submit_committee_change_proposal"
Variables ¶
This section is empty.
Functions ¶
func DecodeStore ¶
DecodeStore unmarshals the KVPair's Value to the corresponding module type
func ProposalContents ¶
func ProposalContents(k keeper.Keeper, paramChanges []simulation.ParamChange) []simulation.WeightedProposalContent
ProposalContents defines the module weighted proposals' contents
func RandInt ¶
RandInt randomly generates an sdk.Int in the range [inclusiveMin, exclusiveMax). It works for negative and positive integers.
func RandIntInclusive ¶
RandInt randomly generates an sdk.Int in the range [inclusiveMin, inclusiveMax]. It works for negative and positive integers.
func RandomAddresses ¶
func RandomAddresses(r *rand.Rand, accs []simulation.Account) []sdk.AccAddress
func RandomCommittee ¶
func RandomCommittee(r *rand.Rand, availableAccs []simulation.Account, allowedParams []types.AllowedParam) (types.Committee, error)
func RandomPermissions ¶
func RandomPermissions(r *rand.Rand, allowedParams []types.AllowedParam) []types.Permission
func RandomPositiveDuration ¶
func RandomTime ¶
func RandomizedGenState ¶
func RandomizedGenState(simState *module.SimulationState)
RandomizedGenState generates a random GenesisState for the module
func SimulateCommitteeChangeProposalContent ¶
func SimulateCommitteeChangeProposalContent(k keeper.Keeper, paramChanges []simulation.ParamChange) simulation.ContentSimulatorFn
SimulateCommitteeChangeProposalContent generates gov proposal contents that either: - create new committees - change existing committees - delete committees It does not alter the fallback committee.
func SimulateMsgSubmitProposal ¶
func SimulateMsgSubmitProposal(cdc *codec.Codec, ak AccountKeeper, k keeper.Keeper, contentSim simulation.ContentSimulatorFn) simulation.Operation
SimulateMsgSubmitProposal creates a proposal using the passed contentSimulatorFn and tries to find a committee that has permissions for it. If it can't then it uses the fallback committee. If the fallback committee isn't there (eg when using an non-generated genesis) and no committee can be found this emits a no-op msg and doesn't do anything. For each submit proposal msg, future ops for the vote messages are generated. Sometimes it doesn't run enough votes to allow the proposal to timeout - the likelihood of this happening is controlled by a parameter.
func SimulateMsgVote ¶
func SimulateMsgVote(k keeper.Keeper, ak AccountKeeper, voter sdk.AccAddress, proposalID uint64) simulation.Operation
func WeightedOperations ¶
func WeightedOperations(appParams simulation.AppParams, cdc *codec.Codec, ak AccountKeeper, k keeper.Keeper, wContents []simulation.WeightedProposalContent) simulation.WeightedOperations
WeightedOperations creates an operation (with weight) for each type of proposal generator. Custom proposal generators can be added for more control over types of proposal submitted, eg to increase likelyhood of particular cdp param changes.
Types ¶
type AccountKeeper ¶
type AccountKeeper interface {
GetAccount(sdk.Context, sdk.AccAddress) authexported.Account
}