Skip to content

Commit

Permalink
Update e2e x/community params proposal test to work without upgrade h…
Browse files Browse the repository at this point in the history
…andler
  • Loading branch information
drklee3 committed Oct 31, 2023
1 parent af58c58 commit 122fd6f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions tests/e2e/e2e_community_update_params_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ func (suite *IntegrationTestSuite) TestCommunityUpdateParams_Authority() {
gasLimit := int64(2e5)
fee := ukava(200)

// Wait until switchover actually happens
// Wait until switchover actually happens - When testing without the upgrade
// handler that sets a relative switchover time, the switchover time in
// genesis should be set in the past so it runs immediately.
suite.Require().Eventually(
func() bool {
params, err := suite.Kava.Community.Params(
Expand All @@ -88,14 +90,19 @@ func (suite *IntegrationTestSuite) TestCommunityUpdateParams_Authority() {
"switchover should happen",
)

// Add 1 to the staking rewards per second
newStakingRewardsPerSecond := communityParamsResInitial.Params.
StakingRewardsPerSecond.
Add(sdkmath.LegacyNewDec(1))

// 1. Proposal
// Only modify stakingRewardsPerSecond, as to not re-run the switchover and
// to not influence other tests
updateParamsMsg := communitytypes.NewMsgUpdateParams(
authtypes.NewModuleAddress(govtypes.ModuleName), // authority
communitytypes.NewParams(
time.Time{}, // after switchover, is empty
sdkmath.LegacyNewDec(1111), // only modify stakingRewardsPerSecond
newStakingRewardsPerSecond, // only modify stakingRewardsPerSecond
communityParamsResInitial.Params.UpgradeTimeSetStakingRewardsPerSecond,
),
)
Expand Down

0 comments on commit 122fd6f

Please sign in to comment.