From 123e1e40f0702a6ddad1a3827c70b44617166d50 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Thu, 3 Oct 2024 15:03:56 +0200 Subject: [PATCH] test: clean democracy E2E-test (#2316) * nits * remove democ test print and fix state * nits * docs * fix docs --- tests/e2e/state.go | 5 ----- tests/e2e/steps_democracy.go | 16 ++++++++++------ 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/tests/e2e/state.go b/tests/e2e/state.go index 55db1789d7..089c026192 100644 --- a/tests/e2e/state.go +++ b/tests/e2e/state.go @@ -289,9 +289,6 @@ func (tr Commands) GetReward(chain ChainID, validator ValidatorID, blockHeight u denomCondition := fmt.Sprintf(`total.#(%%"*%s*")`, denom) amount := strings.Split(gjson.Get(string(bz), denomCondition).String(), denom)[0] - fmt.Println("denomCondition:", denomCondition) - fmt.Println("json:", gjson.Parse(string(bz))) - res := float64(0) if amount != "" { res, err = strconv.ParseFloat(amount, 64) @@ -300,8 +297,6 @@ func (tr Commands) GetReward(chain ChainID, validator ValidatorID, blockHeight u } } - fmt.Println("res", res) - return res } diff --git a/tests/e2e/steps_democracy.go b/tests/e2e/steps_democracy.go index 604f724ad8..f8b34f1001 100644 --- a/tests/e2e/steps_democracy.go +++ b/tests/e2e/steps_democracy.go @@ -265,15 +265,17 @@ func stepsDemocracy(consumerName string, expectRegisteredRewardDistribution bool ValidatorID("bob"): false, ValidatorID("carol"): false, }, - IsIncrementalReward: true, - Denom: "stake", + IsIncrementalReward: false, + Denom: consumerRewardDenoms[1], }, }, }, }, // Transfer tokens from the consumer to the consumer reward pool // of the provider via the transfer channel-2 using the correct memo - // to identify the consumer + // to identify the consumer. + // Note that in this case, the consumer reward denoms aren't filtered by the `provider_reward_denoms` + // consumer parameter since the rewards are sent without going through the consumer distribution logic. { Action: TransferIbcTokenAction{ Chain: ChainID(consumerName), @@ -298,9 +300,11 @@ func stepsDemocracy(consumerName string, expectRegisteredRewardDistribution bool ChainID("provi"): ChainState{ Rewards: &Rewards{ IsRewarded: map[ValidatorID]bool{ - ValidatorID("alice"): expectRegisteredRewardDistribution, - ValidatorID("bob"): expectRegisteredRewardDistribution, - ValidatorID("carol"): expectRegisteredRewardDistribution, + // rewards should be distributed regardless + // of the `provider_reward_denoms` consumer parameter + ValidatorID("alice"): true, + ValidatorID("bob"): true, + ValidatorID("carol"): true, }, IsIncrementalReward: false, Denom: consumerRewardDenoms[1],