Skip to content

Commit

Permalink
fix: proposal MsgChangeRewardDenoms (#2166)
Browse files Browse the repository at this point in the history
  • Loading branch information
bermuell authored Aug 28, 2024
1 parent 40eb3fd commit 400a8f8
Show file tree
Hide file tree
Showing 4 changed files with 155 additions and 116 deletions.
1 change: 1 addition & 0 deletions proto/interchain_security/ccv/provider/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ service Msg {
rpc OptOut(MsgOptOut) returns (MsgOptOutResponse);
rpc SetConsumerCommissionRate(MsgSetConsumerCommissionRate) returns (MsgSetConsumerCommissionRateResponse);
rpc ConsumerModification(MsgConsumerModification) returns (MsgConsumerModificationResponse);
rpc ChangeRewardDenoms(MsgChangeRewardDenoms) returns (MsgChangeRewardDenomsResponse);
}


Expand Down
10 changes: 5 additions & 5 deletions tests/e2e/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -2227,8 +2227,8 @@ func (tr Chain) submitChangeRewardDenomsProposal(action SubmitChangeRewardDenoms
"messages": [
{
"@type": "/interchain_security.ccv.provider.v1.MsgChangeRewardDenoms",
"denoms_to_add": %s,
"denoms_to_remove": %s,
"denoms_to_add": ["%s"],
"denoms_to_remove": ["%s"],
"authority": "cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn"
}
],
Expand All @@ -2239,15 +2239,15 @@ func (tr Chain) submitChangeRewardDenomsProposal(action SubmitChangeRewardDenoms
"expedited": false
}`

denomsToAdd := []string{action.Denom}
denomsToRemove := []string{"stake"}
denomsToAdd := action.Denom
denomsToRemove := "stake"
jsonStr := fmt.Sprintf(template,
denomsToAdd,
denomsToRemove,
action.Deposit)

//#nosec G204 -- bypass unsafe quoting warning (no production code)
proposalFile := "/consumer-addition.proposal"
proposalFile := "/change-reward.proposal"
bz, err := tr.target.ExecCommand(
"/bin/bash", "-c", fmt.Sprintf(`echo '%s' > %s`, jsonStr, proposalFile),
).CombinedOutput()
Expand Down
3 changes: 2 additions & 1 deletion tests/e2e/test_driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,8 @@ func (td *DefaultDriver) runAction(action interface{}) error {
target.startConsumerEvidenceDetector(action, td.verbose)
case SubmitChangeRewardDenomsProposalAction:
target = td.getTargetDriver(action.Chain)
if semver.Compare(semver.Major(target.testConfig.providerVersion), "v5") < 0 {
version := target.testConfig.providerVersion
if semver.IsValid(version) && semver.Compare(semver.Major(version), "v5") < 0 {
target.submitChangeRewardDenomsLegacyProposal(action, td.verbose)
} else {
target.submitChangeRewardDenomsProposal(action, td.verbose)
Expand Down
Loading

0 comments on commit 400a8f8

Please sign in to comment.