Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: clean democracy E2E-test #2316

Merged
merged 5 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading