Skip to content

Commit

Permalink
[1760]: In the sanction tests, make the voting period last 5 blocks.
Browse files Browse the repository at this point in the history
  • Loading branch information
SpicyLemon committed Apr 24, 2024
1 parent f339848 commit 0f54784
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions x/sanction/client/testutil/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,14 @@ import (
client "github.com/provenance-io/provenance/x/sanction/client/cli"
)

const blocksPerVotingPeriod = 5

func TestIntegrationTestSuite(t *testing.T) {
pioconfig.SetProvenanceConfig(sdk.DefaultBondDenom, 0)
govv1.DefaultMinDepositRatio = sdkmath.LegacyZeroDec()
cfg := testutil.DefaultTestNetworkConfig()
cfg.NumValidators = 5
// cfg.TimeoutCommit = time.Millisecond * msPerBlock

// Define some stuff in the sanction genesis state.
sanctionedAddr1 := sdk.AccAddress("1_sanctioned_address_")
Expand Down Expand Up @@ -79,9 +82,9 @@ func TestIntegrationTestSuite(t *testing.T) {
cfg.Codec.MustUnmarshalJSON(govGenBz, &govGen)
}
govGen.Params.MinDeposit = sdk.NewCoins(sdk.NewInt64Coin(cfg.BondDenom, 6))
twoSeconds := time.Second * 2
govGen.Params.MaxDepositPeriod = &twoSeconds
govGen.Params.VotingPeriod = &twoSeconds
votingPeriod := cfg.TimeoutCommit * blocksPerVotingPeriod
govGen.Params.MaxDepositPeriod = &votingPeriod
govGen.Params.VotingPeriod = &votingPeriod
cfg.GenesisState[gov.ModuleName] = cfg.Codec.MustMarshalJSON(&govGen)

suite.Run(t, NewIntegrationTestSuite(cfg, &sanctionGen))
Expand Down Expand Up @@ -221,11 +224,10 @@ func (s *IntegrationTestSuite) TestSanctionValidatorImmediateUsingGovCmds() {
}
}

// We configured 1/2 second per block, and a 2-second voting period.
// So wait for 4 blocks after the proposal block.
// Wait for the proposal to pass.
s.logHeight()
s.T().Log("waiting for voting period to end")
s.waitForHeight(propHeight + 4)
s.waitForHeight(propHeight + blocksPerVotingPeriod)

// Check that the proposal passed.
finalProp := queries.GetGovProp(s.T(), s.network, propID)
Expand Down

0 comments on commit 0f54784

Please sign in to comment.