diff --git a/x/gov/keeper/proposal.go b/x/gov/keeper/proposal.go index f4e70fcc215b..45d35e7fb8ba 100644 --- a/x/gov/keeper/proposal.go +++ b/x/gov/keeper/proposal.go @@ -283,9 +283,13 @@ func (keeper Keeper) ProposalKinds(p v1.Proposal) v1.ProposalKinds { var sdkMsg sdk.Msg if err := keeper.cdc.UnpackAny(msg, &sdkMsg); err == nil { switch sdkMsg.(type) { - case *v1.MsgProposeConstitutionAmendment: + case interface { + IsProposalKindConstitutionAmendment() + }: kinds |= v1.ProposalKindConstitutionAmendment - case *v1.MsgProposeLaw: + case interface { + IsProposalKindLaw() + }: kinds |= v1.ProposalKindLaw default: kinds |= v1.ProposalKindAny diff --git a/x/gov/types/v1/msgs.go b/x/gov/types/v1/msgs.go index 16b8cd8cfb5c..ba82a2321c23 100644 --- a/x/gov/types/v1/msgs.go +++ b/x/gov/types/v1/msgs.go @@ -126,3 +126,7 @@ func (msg MsgProposeConstitutionAmendment) ValidateBasic() error { return nil } + +func (msg MsgProposeConstitutionAmendment) IsProposalKindConstitutionAmendment() {} + +func (msg MsgProposeLaw) IsProposalKindLaw() {}