-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsim_test.go
More file actions
36 lines (29 loc) · 995 Bytes
/
sim_test.go
File metadata and controls
36 lines (29 loc) · 995 Bytes
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
//go:build sims
package example
import (
"testing"
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
simsx "github.com/cosmos/cosmos-sdk/testutil/simsx"
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
simcli "github.com/cosmos/cosmos-sdk/x/simulation/client/cli"
)
func init() {
simcli.GetSimulatorFlags()
}
func TestFullAppSimulation(t *testing.T) {
simsx.Run(t, NewExampleApp, setupStateFactory)
}
func setupStateFactory(app *ExampleApp) simsx.SimStateFactory {
return simsx.SimStateFactory{
Codec: app.AppCodec(),
AppStateFn: simtestutil.AppStateFn(app.AppCodec(), app.SimulationManager(), app.DefaultGenesis()),
BlockedAddr: BlockedAddresses(),
AccountSource: app.AccountKeeper,
BalanceSource: app.BankKeeper,
}
}
func TestAppStateDeterminism(t *testing.T) {
simsx.Run(t, NewExampleApp, setupStateFactory, func(tb testing.TB, ti simsx.TestInstance[*ExampleApp], accs []simtypes.Account) {
tb.Log("running determinism test...")
})
}