-
Notifications
You must be signed in to change notification settings - Fork 0
/
operations.go
36 lines (29 loc) · 1.01 KB
/
operations.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
// Copyright [2021] - [2022], AssetMantle Pte. Ltd. and the code contributors
// SPDX-License-Identifier: Apache-2.0
package simulator
import (
"math/rand"
"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/codec"
sdkTypes "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/simulation"
)
func (simulator) WeightedOperations(appParams simulation.AppParams, codec *codec.Codec) simulation.WeightedOperations {
var weightMsg int
appParams.GetOrGenerate(codec, OpWeightMsg, &weightMsg, nil,
func(_ *rand.Rand) {
weightMsg = DefaultWeightMsg
},
)
return simulation.WeightedOperations{
simulation.NewWeightedOperation(
weightMsg,
simulateMsg(),
),
}
}
func simulateMsg() simulation.Operation {
return func(rand *rand.Rand, baseApp *baseapp.BaseApp, context sdkTypes.Context, simulationAccountList []simulation.Account, chainID string) (simulation.OperationMsg, []simulation.FutureOperation, error) {
return simulation.NewOperationMsg(nil, true, ""), nil, nil
}
}