-
Notifications
You must be signed in to change notification settings - Fork 0
/
swap.go
29 lines (24 loc) · 864 Bytes
/
swap.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
package simulation
import (
"math/rand"
"github.com/charleenfei/simple-dex/simple-dex/x/simpledex/keeper"
"github.com/charleenfei/simple-dex/simple-dex/x/simpledex/types"
"github.com/cosmos/cosmos-sdk/baseapp"
sdk "github.com/cosmos/cosmos-sdk/types"
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
)
func SimulateMsgSwap(
ak types.AccountKeeper,
bk types.BankKeeper,
k keeper.Keeper,
) simtypes.Operation {
return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string,
) (simtypes.OperationMsg, []simtypes.FutureOperation, error) {
simAccount, _ := simtypes.RandomAcc(r, accs)
msg := &types.MsgSwap{
Sender: simAccount.Address.String(),
}
// TODO: Handling the Swap simulation
return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "Swap simulation not implemented"), nil, nil
}
}