From d30b11bb5521c8479a0e48a67007d1716abc2072 Mon Sep 17 00:00:00 2001 From: "Felix C. Morency" <1102868+fmorency@users.noreply.github.com> Date: Thu, 27 Jun 2024 11:14:17 -0400 Subject: [PATCH] fix(simulator): determinism test --- app/sim_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/sim_test.go b/app/sim_test.go index baadafb..fa4c276 100644 --- a/app/sim_test.go +++ b/app/sim_test.go @@ -1,6 +1,7 @@ package app_test import ( + "encoding/hex" "encoding/json" "flag" "fmt" @@ -425,6 +426,7 @@ func TestAppStateDeterminism(t *testing.T) { config.ExportParamsPath = "" config.OnOperation = true config.AllInvariants = true + config.ChainID = SimAppChainID numSeeds := 3 numTimesToRunPerSeed := 3 // This used to be set to 5, but we've temporarily reduced it to 3 for the sake of faster CI. @@ -464,8 +466,6 @@ func TestAppStateDeterminism(t *testing.T) { } else { logger = log.NewNopLogger() } - chainID := fmt.Sprintf("chain-id-%d-%d", i, j) - config.ChainID = chainID err := setPOAAdmin(config) require.NoError(t, err) @@ -479,7 +479,7 @@ func TestAppStateDeterminism(t *testing.T) { SimulatorCommissionRateMinMax, appOptions, interBlockCacheOpt(), - baseapp.SetChainID(chainID), + baseapp.SetChainID(SimAppChainID), ) fmt.Printf( @@ -513,7 +513,7 @@ func TestAppStateDeterminism(t *testing.T) { if j != 0 { require.Equal( - t, string(appHashList[0]), string(appHashList[j]), + t, hex.EncodeToString(appHashList[0]), hex.EncodeToString(appHashList[j]), "non-determinism in seed %d: %d/%d, attempt: %d/%d\n", config.Seed, i+1, numSeeds, j+1, numTimesToRunPerSeed, ) }