Skip to content

Commit

Permalink
added E2E tests for power-shaping features
Browse files Browse the repository at this point in the history
  • Loading branch information
insumity committed May 2, 2024
1 parent b4beaae commit 91cb6f0
Show file tree
Hide file tree
Showing 3 changed files with 926 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/e2e/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,10 @@ type SubmitConsumerAdditionProposalAction struct {
InitialHeight clienttypes.Height
DistributionChannel string
TopN uint32
ValidatorsPowerCap uint32
ValidatorSetCap uint32
Allowlist []string
Denylist []string
}

func (tr TestConfig) submitConsumerAdditionProposal(
Expand All @@ -287,6 +291,10 @@ func (tr TestConfig) submitConsumerAdditionProposal(
Deposit: fmt.Sprint(action.Deposit) + `stake`,
DistributionTransmissionChannel: action.DistributionChannel,
TopN: action.TopN,
ValidatorsPowerCap: action.ValidatorsPowerCap,
ValidatorSetCap: action.ValidatorSetCap,
Allowlist: action.Allowlist,
Denylist: action.Denylist,
}

bz, err := json.Marshal(prop)
Expand Down
26 changes: 26 additions & 0 deletions tests/e2e/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,30 @@ var stepChoices = map[string]StepChoice{
description: "test partial set security for a Top-N chain",
testConfig: DefaultTestCfg,
},
"partial-set-security-validator-set-cap": {
name: "partial-set-security-validator-set-cap",
steps: stepsValidatorSetCappedChain(),
description: "test partial set security for an Opt-In chain that is validator-set capped",
testConfig: DefaultTestCfg,
},
"partial-set-security-validators-power-cap": {
name: "partial-set-security-validators-power-cap",
steps: stepsValidatorsPowerCappedChain(),
description: "test partial set security for an Opt-In chain that has its validators' power capped",
testConfig: DefaultTestCfg,
},
"partial-set-security-validators-allowlisted": {
name: "partial-set-security-validators-allowlisted",
steps: stepsValidatorsAllowlistedChain(),
description: "test partial set security for an Opt-In chain that has some validators allowlisted",
testConfig: DefaultTestCfg,
},
"partial-set-security-validators-denylisted": {
name: "partial-set-security-validators-denylisted",
steps: stepsValidatorsDenylistedChain(),
description: "test partial set security for an Opt-In chain that has a validator denylisted",
testConfig: DefaultTestCfg,
},
}

func getTestCaseUsageString() string {
Expand Down Expand Up @@ -254,6 +278,8 @@ func getTestCases(selectedPredefinedTests, selectedTestFiles TestSet, providerVe
"democracy-reward", "democracy",
"slash-throttle", "consumer-double-sign", "consumer-misbehaviour",
"consumer-double-downtime", "partial-set-security-opt-in", "partial-set-security-top-n",
"partial-set-security-validator-set-cap", "partial-set-security-validators-power-cap",
"partial-set-security-validators-allowlisted", "partial-set-security-validators-denylisted",
}
if includeMultiConsumer != nil && *includeMultiConsumer {
selectedPredefinedTests = append(selectedPredefinedTests, "multiconsumer")
Expand Down
Loading

0 comments on commit 91cb6f0

Please sign in to comment.