mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-11-13 03:25:20 +00:00
fix simulations
This commit is contained in:
parent
e6a96fa4da
commit
b71ce1802b
10
Makefile
10
Makefile
@ -83,10 +83,16 @@ install: go.sum
|
|||||||
### Tools & dependencies
|
### Tools & dependencies
|
||||||
|
|
||||||
go.sum: go.mod
|
go.sum: go.mod
|
||||||
@echo "--> Ensure dependencies have not been modified"
|
@echo "--> Ensuring dependencies have not been modified"
|
||||||
@go mod verify
|
@go mod verify
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf build/
|
rm -rf build/
|
||||||
|
|
||||||
.PHONY: all build-linux install clean build
|
########################################
|
||||||
|
### Testing
|
||||||
|
|
||||||
|
sim:
|
||||||
|
@go test -mod=readonly ./app -run TestFullAppSimulation -Enabled=true -NumBlocks=100 -BlockSize=200 -Commit=true -Seed=99 -Period=5 -v -timeout 24h
|
||||||
|
|
||||||
|
.PHONY: all build-linux install clean build sim
|
@ -343,7 +343,7 @@ func TestFullAppSimulation(t *testing.T) {
|
|||||||
}()
|
}()
|
||||||
|
|
||||||
app := NewApp(logger, db, nil, true, simapp.FlagPeriodValue, fauxMerkleModeOpt)
|
app := NewApp(logger, db, nil, true, simapp.FlagPeriodValue, fauxMerkleModeOpt)
|
||||||
require.Equal(t, "GaiaApp", app.Name())
|
require.Equal(t, "kava", app.Name())
|
||||||
|
|
||||||
// Run randomized simulation
|
// Run randomized simulation
|
||||||
_, simParams, simErr := simulation.SimulateFromSeed(
|
_, simParams, simErr := simulation.SimulateFromSeed(
|
||||||
@ -397,7 +397,7 @@ func TestAppImportExport(t *testing.T) {
|
|||||||
}()
|
}()
|
||||||
|
|
||||||
app := NewApp(logger, db, nil, true, simapp.FlagPeriodValue, fauxMerkleModeOpt)
|
app := NewApp(logger, db, nil, true, simapp.FlagPeriodValue, fauxMerkleModeOpt)
|
||||||
require.Equal(t, "SimApp", app.Name())
|
require.Equal(t, "kava", app.Name())
|
||||||
|
|
||||||
// Run randomized simulation
|
// Run randomized simulation
|
||||||
_, simParams, simErr := simulation.SimulateFromSeed(
|
_, simParams, simErr := simulation.SimulateFromSeed(
|
||||||
@ -441,7 +441,7 @@ func TestAppImportExport(t *testing.T) {
|
|||||||
}()
|
}()
|
||||||
|
|
||||||
newApp := NewApp(log.NewNopLogger(), newDB, nil, true, simapp.FlagPeriodValue, fauxMerkleModeOpt)
|
newApp := NewApp(log.NewNopLogger(), newDB, nil, true, simapp.FlagPeriodValue, fauxMerkleModeOpt)
|
||||||
require.Equal(t, "SimApp", newApp.Name())
|
require.Equal(t, "kava", newApp.Name())
|
||||||
|
|
||||||
var genesisState simapp.GenesisState
|
var genesisState simapp.GenesisState
|
||||||
err = app.cdc.UnmarshalJSON(appState, &genesisState)
|
err = app.cdc.UnmarshalJSON(appState, &genesisState)
|
||||||
@ -513,7 +513,7 @@ func TestAppSimulationAfterImport(t *testing.T) {
|
|||||||
}()
|
}()
|
||||||
|
|
||||||
app := NewApp(logger, db, nil, true, simapp.FlagPeriodValue, fauxMerkleModeOpt)
|
app := NewApp(logger, db, nil, true, simapp.FlagPeriodValue, fauxMerkleModeOpt)
|
||||||
require.Equal(t, "GaiaApp", app.Name())
|
require.Equal(t, "kava", app.Name())
|
||||||
|
|
||||||
// Run randomized simulation
|
// Run randomized simulation
|
||||||
// Run randomized simulation
|
// Run randomized simulation
|
||||||
@ -567,7 +567,7 @@ func TestAppSimulationAfterImport(t *testing.T) {
|
|||||||
}()
|
}()
|
||||||
|
|
||||||
newApp := NewApp(log.NewNopLogger(), newDB, nil, true, 0, fauxMerkleModeOpt)
|
newApp := NewApp(log.NewNopLogger(), newDB, nil, true, 0, fauxMerkleModeOpt)
|
||||||
require.Equal(t, "GaiaApp", newApp.Name())
|
require.Equal(t, "kava", newApp.Name())
|
||||||
|
|
||||||
newApp.InitChain(abci.RequestInitChain{
|
newApp.InitChain(abci.RequestInitChain{
|
||||||
AppStateBytes: appState,
|
AppStateBytes: appState,
|
||||||
|
Loading…
Reference in New Issue
Block a user