Skip to content

Commit

Permalink
update test traces
Browse files Browse the repository at this point in the history
  • Loading branch information
sainoe committed Oct 4, 2023
2 parents ea545b4 + 92a9d17 commit f8f1029
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 6 deletions.
3 changes: 2 additions & 1 deletion tests/e2e/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,8 @@ func DemocracyTestConfig(allowReward bool) TestConfig {
".app_state.slashing.params.signed_blocks_window = \"10\" | " +
".app_state.slashing.params.min_signed_per_window = \"0.500000000000000000\" | " +
".app_state.slashing.params.downtime_jail_duration = \"60s\" | " +
".app_state.slashing.params.slash_fraction_downtime = \"0.010000000000000000\""
".app_state.slashing.params.slash_fraction_downtime = \"0.010000000000000000\" | " +
".app_state.transfer.params.send_enabled = false"

if allowReward {
// This allows the consumer chain to send rewards in the stake denom
Expand Down
6 changes: 5 additions & 1 deletion tests/e2e/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,12 @@ func getTestFileUsageString() string {

// Test runner selection
builder.WriteString("Test runner selection:\nSelection of test runners to be executed:\n")
testConfigSet := map[string]struct{}{}
for _, testConfig := range testConfigs {
builder.WriteString(fmt.Sprintf("- %s\n", testConfig.name))
if _, ok := testConfigSet[testConfig.name]; !ok {
builder.WriteString(fmt.Sprintf("- %s\n", testConfig.name))
testConfigSet[testConfig.name] = struct{}{}
}
}
builder.WriteString("\n")

Expand Down
13 changes: 13 additions & 0 deletions tests/e2e/steps_democracy.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ func stepsDemocracy(consumerName string) []Step {
ValidatorID("alice"): 9889999998,
ValidatorID("bob"): 9960000001,
},
// Check that the "SendEnabled" transfer parameter is set to false
Params: &([]Param{{Subspace: "transfer", Key: "SendEnabled", Value: "false"}}),
Proposals: &map[uint]Proposal{
1: ParamsProposal{
Deposit: 10000001,
Expand All @@ -99,10 +101,21 @@ func stepsDemocracy(consumerName string) []Step {
},
State: State{
ChainID(consumerName): ChainState{
// Check that alice gets the prop deposit refunded
ValBalances: &map[ValidatorID]uint{
ValidatorID("alice"): 9899999999,
ValidatorID("bob"): 9960000001,
},
// Check that the prop passed
Proposals: &map[uint]Proposal{
1: ParamsProposal{
Deposit: 10000001,
Status: "PROPOSAL_STATUS_PASSED",
Subspace: "transfer",
Key: "SendEnabled",
Value: "true",
},
},
// Check that the parameter is changed on gov-consumer chain
Params: &([]Param{{Subspace: "transfer", Key: "SendEnabled", Value: "true"}}),
},
Expand Down
13 changes: 13 additions & 0 deletions tests/e2e/steps_reward_denom.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ func stepsRewardDenomConsumer(consumerName string) []Step {
ValidatorID("alice"): 9889999998,
ValidatorID("bob"): 9960000001,
},
// Check that the "SendEnabled" transfer parameter is set to false
Params: &([]Param{{Subspace: "transfer", Key: "SendEnabled", Value: "false"}}),
Proposals: &map[uint]Proposal{
1: ParamsProposal{
Deposit: 10000001,
Expand All @@ -97,10 +99,21 @@ func stepsRewardDenomConsumer(consumerName string) []Step {
},
State: State{
ChainID(consumerName): ChainState{
// Check that alice gets the prop deposit refunded
ValBalances: &map[ValidatorID]uint{
ValidatorID("alice"): 9899999999,
ValidatorID("bob"): 9960000001,
},
// Check that the prop passed
Proposals: &map[uint]Proposal{
1: ParamsProposal{
Deposit: 10000001,
Status: "PROPOSAL_STATUS_PASSED",
Subspace: "transfer",
Key: "SendEnabled",
Value: "true",
},
},
// Check that the parameter is changed on gov-consumer chain
Params: &([]Param{{Subspace: "transfer", Key: "SendEnabled", Value: "true"}}),
},
Expand Down
21 changes: 19 additions & 2 deletions tests/e2e/tracehandler_testdata/democracy.json
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,13 @@
},
"ValPowers": null,
"StakedTokens": null,
"Params": null,
"Params": [
{
"Subspace": "transfer",
"Key": "SendEnabled",
"Value": "false"
}
],
"Rewards": null,
"ConsumerChains": null,
"AssignedKeys": null,
Expand Down Expand Up @@ -621,7 +627,18 @@
"GlobalSlashQueueSize": null,
"RegisteredConsumerRewardDenoms": null,
"ClientsFrozenHeights": null,
"Proposals": null
"Proposals": {
"1": {
"RawProposal": {
"Deposit": 10000001,
"Status": "PROPOSAL_STATUS_PASSED",
"Subspace": "transfer",
"Key": "SendEnabled",
"Value": "true"
},
"Type": "main.ParamsProposal"
}
}
}
}
},
Expand Down
21 changes: 19 additions & 2 deletions tests/e2e/tracehandler_testdata/democracyRewardsSteps.json
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,13 @@
},
"ValPowers": null,
"StakedTokens": null,
"Params": null,
"Params": [
{
"Subspace": "transfer",
"Key": "SendEnabled",
"Value": "false"
}
],
"Rewards": null,
"ConsumerChains": null,
"AssignedKeys": null,
Expand Down Expand Up @@ -621,7 +627,18 @@
"GlobalSlashQueueSize": null,
"RegisteredConsumerRewardDenoms": null,
"ClientsFrozenHeights": null,
"Proposals": null
"Proposals": {
"1": {
"RawProposal": {
"Deposit": 10000001,
"Status": "PROPOSAL_STATUS_PASSED",
"Subspace": "transfer",
"Key": "SendEnabled",
"Value": "true"
},
"Type": "main.ParamsProposal"
}
}
}
}
},
Expand Down

0 comments on commit f8f1029

Please sign in to comment.