diff --git a/x/ccv/provider/proposal_handler_test.go b/x/ccv/provider/proposal_handler_test.go index 3d221dc2ca..8f1322b3d2 100644 --- a/x/ccv/provider/proposal_handler_test.go +++ b/x/ccv/provider/proposal_handler_test.go @@ -73,20 +73,6 @@ func TestProviderProposalHandler(t *testing.T) { blockTime: hourFromNow, expValidEquivocation: true, }, - { - name: "invalid change reward denoms proposal, none to add or remove", - content: providertypes.NewChangeRewardDenomsProposal( - "title", "description", []string{}, []string{}), - blockTime: hourFromNow, - expValidChangeRewardDenom: false, - }, - { - name: "invalid change reward denoms proposal, same denom in both sets", - content: providertypes.NewChangeRewardDenomsProposal( - "title", "description", []string{"denom1"}, []string{"denom1"}), - blockTime: hourFromNow, - expValidChangeRewardDenom: false, - }, { name: "valid change reward denoms proposal", content: providertypes.NewChangeRewardDenomsProposal( diff --git a/x/ccv/provider/types/proposal_test.go b/x/ccv/provider/types/proposal_test.go index fac4c7fc4b..e3f069db0c 100644 --- a/x/ccv/provider/types/proposal_test.go +++ b/x/ccv/provider/types/proposal_test.go @@ -362,3 +362,38 @@ func TestEquivocationProposalValidateBasic(t *testing.T) { }) } } + +func TestChangeRewardDenomsProposalValidateBasic(t *testing.T) { + tcs := []struct { + name string + proposal govv1beta1.Content + expectError bool + }{{ + name: "invalid change reward denoms proposal, none to add or remove", + proposal: types.NewChangeRewardDenomsProposal( + "title", "description", []string{}, []string{}), + expectError: true, + }, { + name: "invalid change reward denoms proposal, same denom in both sets", + proposal: types.NewChangeRewardDenomsProposal( + "title", "description", []string{"denom1"}, []string{"denom1"}), + expectError: true, + }, { + name: "valid change reward denoms proposal", + proposal: types.NewChangeRewardDenomsProposal( + "title", "description", []string{"denom1"}, []string{"denom2"}), + expectError: false, + }, + } + + for _, tc := range tcs { + t.Run(tc.name, func(t *testing.T) { + err := tc.proposal.ValidateBasic() + if tc.expectError { + require.Error(t, err) + return + } + require.NoError(t, err) + }) + } +}