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: update confusing e2e democracy setup #1701

Merged
merged 2 commits into from
Mar 13, 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
4 changes: 2 additions & 2 deletions tests/e2e/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,13 @@ var stepChoices = map[string]StepChoice{
},
"democracy-reward": {
name: "democracy-reward",
steps: democracyRewardsSteps,
steps: democracyRegisteredDenomSteps,
description: "democracy tests allowing rewards",
testConfig: DemocracyRewardTestCfg,
},
"democracy": {
name: "democracy",
steps: democracySteps,
steps: democracyUnregisteredDenomSteps,
description: "democracy tests",
testConfig: DemocracyTestCfg,
},
Expand Down
13 changes: 9 additions & 4 deletions tests/e2e/steps.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,20 +73,25 @@ var slashThrottleSteps = concatSteps(
stepsStopChain("consu", 2),
)

var democracyRewardsSteps = concatSteps(
// these tests start with transfer SendEnabled set to false
// one of the steps will set SendEnabled to true
var democracyUnregisteredDenomSteps = concatSteps(
// democracySteps requires a transfer channel
stepsStartChains([]string{"democ"}, true),
// delegation needs to happen so the first VSC packet can be delivered
stepsDelegate("democ"),
stepsDemocracy("democ"),
// the denom is not registered on the provider chain so it will not be distributed as rewards
stepsDemocracy("democ", false),
)

var democracySteps = concatSteps(
// these tests start with transfer SendEnabled set to true
var democracyRegisteredDenomSteps = concatSteps(
// democracySteps requires a transfer channel
stepsStartChains([]string{"democ"}, true),
// delegation needs to happen so the first VSC packet can be delivered
stepsDelegate("democ"),
stepsRewardDenomConsumer("democ"),
// the denom is registered on the provider chain so it will be distributed as rewards
stepsDemocracy("democ", true),
)

var multipleConsumers = concatSteps(
Expand Down
13 changes: 7 additions & 6 deletions tests/e2e/steps_democracy.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

const consumerRewardDenom = "ibc/3C3D7B3BE4ECC85A0E5B52A3AEC3B7DFC2AA9CA47C37821E57020D6807043BE9"

func stepsDemocracy(consumerName string) []Step {
func stepsDemocracy(consumerName string, expectRegisteredRewardDistribution bool) []Step {
return []Step{
{
Action: RegisterRepresentativeAction{
Expand Down Expand Up @@ -62,7 +62,7 @@ func stepsDemocracy(consumerName string) []Step {
},
},
{
// whitelisted legacy proposal can only handle ibctransfer.SendEnabled/ReceiveEnabled
// this proposal will allow ibc transfer by setting SendEnabled to true
Action: SubmitParamChangeLegacyProposalAction{
Chain: ChainID(consumerName),
From: ValidatorID("alice"),
Expand Down Expand Up @@ -181,12 +181,13 @@ func stepsDemocracy(consumerName string) []Step {
},
State: State{
ChainID("provi"): ChainState{
// Check that tokens are minted and sent to provider chain and distributed to validators and their delegators on provider chain
// Check that ARE NOT minted and sent to provider chain and distributed to validators and their delegators on provider chain
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Check that ARE NOT minted and sent to provider chain and distributed to validators and their delegators on provider chain
// Check that tokens ARE NOT minted and sent to provider chain and distributed to validators and their delegators on provider chain

// the tokens are not sent because the test configuration does not allow sending tokens
Rewards: &Rewards{
IsRewarded: map[ValidatorID]bool{
ValidatorID("alice"): true,
ValidatorID("bob"): true,
ValidatorID("carol"): true,
ValidatorID("alice"): expectRegisteredRewardDistribution,
ValidatorID("bob"): expectRegisteredRewardDistribution,
ValidatorID("carol"): expectRegisteredRewardDistribution,
},
IsIncrementalReward: false,
IsNativeDenom: false,
Expand Down
308 changes: 0 additions & 308 deletions tests/e2e/steps_reward_denom.go

This file was deleted.

Loading
Loading