Skip to content

Commit

Permalink
test: clean democracy E2E-test (#2316)
Browse files Browse the repository at this point in the history
* nits

* remove democ test print and fix state

* nits

* docs

* fix docs
  • Loading branch information
sainoe authored Oct 3, 2024
1 parent 92981ff commit 123e1e4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
5 changes: 0 additions & 5 deletions tests/e2e/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -300,8 +297,6 @@ func (tr Commands) GetReward(chain ChainID, validator ValidatorID, blockHeight u
}
}

fmt.Println("res", res)

return res
}

Expand Down
16 changes: 10 additions & 6 deletions tests/e2e/steps_democracy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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],
Expand Down

0 comments on commit 123e1e4

Please sign in to comment.