From 7cc6b64bb75792b149bdf2910539b7113cac8b5f Mon Sep 17 00:00:00 2001 From: Hieu Vu <72878483+hieuvubk@users.noreply.github.com> Date: Wed, 9 Oct 2024 19:02:51 +0700 Subject: [PATCH 1/3] update flag --- tests/systemtests/snapshots_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/systemtests/snapshots_test.go b/tests/systemtests/snapshots_test.go index d80eb530f413..c4d6b257fc93 100644 --- a/tests/systemtests/snapshots_test.go +++ b/tests/systemtests/snapshots_test.go @@ -89,7 +89,7 @@ func TestPrune(t *testing.T) { // prune var command []string if isV2() { - command = []string{"store", "prune", "--keep-recent=1"} + command = []string{"store", "prune", "--store.keep-recent=1"} } else { command = []string{"prune", "everything"} } From 8efc28c23f6d69836896aab14574862184e6fd83 Mon Sep 17 00:00:00 2001 From: Hieu Vu <72878483+hieuvubk@users.noreply.github.com> Date: Wed, 9 Oct 2024 22:06:39 +0700 Subject: [PATCH 2/3] move short gov to spec test --- tests/systemtests/gov_test.go | 2 ++ tests/systemtests/system.go | 5 ----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/systemtests/gov_test.go b/tests/systemtests/gov_test.go index 092773dc2053..62b0987aa4bb 100644 --- a/tests/systemtests/gov_test.go +++ b/tests/systemtests/gov_test.go @@ -375,6 +375,8 @@ func TestQueryDeposit(t *testing.T) { sut.ResetChain(t) cli := NewCLIWrapper(t, sut, verbose) + // Set short period + sut.ModifyGenesisJSON(t, SetGovVotingPeriod(t, time.Second*8)) // get validator address valAddr := gjson.Get(cli.Keys("keys", "list"), "0.address").String() diff --git a/tests/systemtests/system.go b/tests/systemtests/system.go index f42bf96a79cd..8cb247a5d83f 100644 --- a/tests/systemtests/system.go +++ b/tests/systemtests/system.go @@ -134,11 +134,6 @@ func (s *SystemUnderTest) SetupChain() { if err != nil { panic(fmt.Sprintf("failed to set block max gas: %s", err)) } - // Short period for gov - genesisBz, err = sjson.SetRawBytes(genesisBz, "app_state.gov.params.voting_period", []byte(fmt.Sprintf(`"%s"`, "8s"))) - if err != nil { - panic(fmt.Sprintf("failed to set regular voting period: %s", err)) - } // update expedited voting period to avoid validation error genesisBz, err = sjson.SetRawBytes(genesisBz, "app_state.gov.params.expedited_voting_period", []byte(fmt.Sprintf(`"%s"`, "7s"))) if err != nil { From 96cbdc9a7fdaa854340402c1d4edc52f53640a12 Mon Sep 17 00:00:00 2001 From: Hieu Vu <72878483+hieuvubk@users.noreply.github.com> Date: Wed, 9 Oct 2024 22:23:22 +0700 Subject: [PATCH 3/3] expedited_voting_period --- tests/systemtests/genesis_io.go | 9 +++++++++ tests/systemtests/gov_test.go | 9 +++++++-- tests/systemtests/system.go | 5 ----- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/tests/systemtests/genesis_io.go b/tests/systemtests/genesis_io.go index df2081ba0924..f3a61e54a2dd 100644 --- a/tests/systemtests/genesis_io.go +++ b/tests/systemtests/genesis_io.go @@ -33,6 +33,15 @@ func SetGovVotingPeriod(t *testing.T, period time.Duration) GenesisMutator { } } +func SetGovExpeditedVotingPeriod(t *testing.T, period time.Duration) GenesisMutator { + t.Helper() + return func(genesis []byte) []byte { + state, err := sjson.SetRawBytes(genesis, "app_state.gov.params.expedited_voting_period", []byte(fmt.Sprintf("%q", period.String()))) + require.NoError(t, err) + return state + } +} + // GetGenesisBalance return the balance amount for an address from the given genesis json func GetGenesisBalance(rawGenesis []byte, addr string) sdk.Coins { var r []sdk.Coin diff --git a/tests/systemtests/gov_test.go b/tests/systemtests/gov_test.go index 62b0987aa4bb..b3270275b454 100644 --- a/tests/systemtests/gov_test.go +++ b/tests/systemtests/gov_test.go @@ -375,8 +375,13 @@ func TestQueryDeposit(t *testing.T) { sut.ResetChain(t) cli := NewCLIWrapper(t, sut, verbose) - // Set short period - sut.ModifyGenesisJSON(t, SetGovVotingPeriod(t, time.Second*8)) + // short voting period + // update expedited voting period to avoid validation error + sut.ModifyGenesisJSON( + t, + SetGovVotingPeriod(t, time.Second*8), + SetGovExpeditedVotingPeriod(t, time.Second*7), + ) // get validator address valAddr := gjson.Get(cli.Keys("keys", "list"), "0.address").String() diff --git a/tests/systemtests/system.go b/tests/systemtests/system.go index 8cb247a5d83f..adaa6da91d77 100644 --- a/tests/systemtests/system.go +++ b/tests/systemtests/system.go @@ -134,11 +134,6 @@ func (s *SystemUnderTest) SetupChain() { if err != nil { panic(fmt.Sprintf("failed to set block max gas: %s", err)) } - // update expedited voting period to avoid validation error - genesisBz, err = sjson.SetRawBytes(genesisBz, "app_state.gov.params.expedited_voting_period", []byte(fmt.Sprintf(`"%s"`, "7s"))) - if err != nil { - panic(fmt.Sprintf("failed to set expedited voting period: %s", err)) - } s.withEachNodeHome(func(i int, home string) { if err := saveGenesis(home, genesisBz); err != nil { panic(err)