diff --git a/PENDING.md b/PENDING.md index b3a05abf9271..b80973b83fc4 100644 --- a/PENDING.md +++ b/PENDING.md @@ -40,6 +40,7 @@ BREAKING CHANGES * `Delegation` -> `Value` in `MsgCreateValidator` and `MsgDelegate` * `MsgBeginUnbonding` -> `MsgUndelegate` * [\#3315] Increase decimal precision to 18 + * [\#3328](https://github.com/cosmos/cosmos-sdk/issues/3328) [x/gov] Remove redundant action tag * Tendermint * [\#3298](https://github.com/cosmos/cosmos-sdk/issues/3298) Upgrade to Tendermint 0.28.0 diff --git a/x/gov/client/utils/query.go b/x/gov/client/utils/query.go index fe890c3c0456..a4b728092a30 100644 --- a/x/gov/client/utils/query.go +++ b/x/gov/client/utils/query.go @@ -33,7 +33,7 @@ func QueryDepositsByTxQuery( ) ([]byte, error) { tags := []string{ - fmt.Sprintf("%s='%s'", tags.Action, tags.ActionProposalDeposit), + fmt.Sprintf("%s='%s'", tags.Action, gov.MsgDeposit{}.Type()), fmt.Sprintf("%s='%s'", tags.ProposalID, []byte(fmt.Sprintf("%d", params.ProposalID))), } @@ -78,7 +78,7 @@ func QueryVotesByTxQuery( ) ([]byte, error) { tags := []string{ - fmt.Sprintf("%s='%s'", tags.Action, tags.ActionProposalVote), + fmt.Sprintf("%s='%s'", tags.Action, gov.MsgVote{}.Type()), fmt.Sprintf("%s='%s'", tags.ProposalID, []byte(fmt.Sprintf("%d", params.ProposalID))), } @@ -118,7 +118,7 @@ func QueryVoteByTxQuery( ) ([]byte, error) { tags := []string{ - fmt.Sprintf("%s='%s'", tags.Action, tags.ActionProposalVote), + fmt.Sprintf("%s='%s'", tags.Action, gov.MsgVote{}.Type()), fmt.Sprintf("%s='%s'", tags.ProposalID, []byte(fmt.Sprintf("%d", params.ProposalID))), fmt.Sprintf("%s='%s'", tags.Voter, []byte(params.Voter.String())), } @@ -161,7 +161,7 @@ func QueryDepositByTxQuery( ) ([]byte, error) { tags := []string{ - fmt.Sprintf("%s='%s'", tags.Action, tags.ActionProposalDeposit), + fmt.Sprintf("%s='%s'", tags.Action, gov.MsgDeposit{}.Type()), fmt.Sprintf("%s='%s'", tags.ProposalID, []byte(fmt.Sprintf("%d", params.ProposalID))), fmt.Sprintf("%s='%s'", tags.Depositor, []byte(params.Depositor.String())), } @@ -204,7 +204,7 @@ func QueryProposerByTxQuery( ) ([]byte, error) { tags := []string{ - fmt.Sprintf("%s='%s'", tags.Action, tags.ActionProposalSubmitted), + fmt.Sprintf("%s='%s'", tags.Action, gov.MsgSubmitProposal{}.Type()), fmt.Sprintf("%s='%s'", tags.ProposalID, []byte(fmt.Sprintf("%d", proposalID))), } diff --git a/x/gov/handler.go b/x/gov/handler.go index a5faab122cdf..947ce5407bdd 100644 --- a/x/gov/handler.go +++ b/x/gov/handler.go @@ -35,7 +35,6 @@ func handleMsgSubmitProposal(ctx sdk.Context, keeper Keeper, msg MsgSubmitPropos } resTags := sdk.NewTags( - tags.Action, tags.ActionProposalSubmitted, tags.Proposer, []byte(msg.Proposer.String()), tags.ProposalID, proposalIDBytes, ) @@ -58,7 +57,6 @@ func handleMsgDeposit(ctx sdk.Context, keeper Keeper, msg MsgDeposit) sdk.Result proposalIDBytes := []byte(fmt.Sprintf("%d", msg.ProposalID)) resTags := sdk.NewTags( - tags.Action, tags.ActionProposalDeposit, tags.Depositor, []byte(msg.Depositor.String()), tags.ProposalID, proposalIDBytes, ) @@ -80,7 +78,6 @@ func handleMsgVote(ctx sdk.Context, keeper Keeper, msg MsgVote) sdk.Result { return sdk.Result{ Tags: sdk.NewTags( - tags.Action, tags.ActionProposalVote, tags.Voter, []byte(msg.Voter.String()), tags.ProposalID, []byte(fmt.Sprintf("%d", msg.ProposalID)), ), diff --git a/x/gov/tags/tags.go b/x/gov/tags/tags.go index ac6c80bc89b8..a4b58d8b2ba7 100644 --- a/x/gov/tags/tags.go +++ b/x/gov/tags/tags.go @@ -6,12 +6,9 @@ import ( // Governance tags var ( - ActionProposalDropped = []byte("proposal-dropped") - ActionProposalPassed = []byte("proposal-passed") - ActionProposalRejected = []byte("proposal-rejected") - ActionProposalSubmitted = []byte("proposal-submitted") - ActionProposalVote = []byte("proposal-vote") - ActionProposalDeposit = []byte("proposal-deposit") + ActionProposalDropped = []byte("proposal-dropped") + ActionProposalPassed = []byte("proposal-passed") + ActionProposalRejected = []byte("proposal-rejected") Action = sdk.TagAction Proposer = "proposer"