-
Notifications
You must be signed in to change notification settings - Fork 0
/
module_simulation.go
50 lines (42 loc) · 1.65 KB
/
module_simulation.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package rewards
import (
"math/rand"
"github.com/cosmos/cosmos-sdk/baseapp"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
"github.com/cosmos/cosmos-sdk/x/simulation"
"github.com/furyanprotocol/v4-chain/protocol/testutil/sample"
rewardssimulation "github.com/furyanprotocol/v4-chain/protocol/x/rewards/simulation"
"github.com/furyanprotocol/v4-chain/protocol/x/rewards/types"
)
// avoid unused import issue
var (
_ = sample.AccAddress
_ = rewardssimulation.FindAccount
_ = simulation.MsgEntryKind
_ = baseapp.Paramspace
_ = rand.Rand{}
)
// GenerateGenesisState creates a randomized GenState of the module.
func (AppModule) GenerateGenesisState(simState *module.SimulationState) {
accs := make([]string, len(simState.Accounts))
for i, acc := range simState.Accounts {
accs[i] = acc.Address.String()
}
rewardsGenesis := types.GenesisState{
Params: types.DefaultParams(),
}
simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&rewardsGenesis)
}
// RegisterStoreDecoder registers a decoder.
func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {}
// WeightedOperations returns the all the gov module operations with their respective weights.
func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation {
operations := make([]simtypes.WeightedOperation, 0)
return operations
}
// ProposalMsgs returns msgs used for governance proposals for simulations.
func (am AppModule) ProposalMsgs(simState module.SimulationState) []simtypes.WeightedProposalMsg {
return []simtypes.WeightedProposalMsg{}
}