From 738a5c28e45f55ddf51b1bbe4b076fb66eb15613 Mon Sep 17 00:00:00 2001 From: Hendrik Hofstadt Date: Sun, 20 Jan 2019 18:10:57 +0100 Subject: [PATCH 1/2] Remove redundant action tag in x/gov --- x/gov/client/utils/query.go | 10 +++++----- x/gov/handler.go | 3 --- x/gov/tags/tags.go | 9 +++------ 3 files changed, 8 insertions(+), 14 deletions(-) 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" From d29d6d793f35855fdb7b7fd60d7b245853d6a4c9 Mon Sep 17 00:00:00 2001 From: Hendrik Hofstadt Date: Sun, 20 Jan 2019 18:19:36 +0100 Subject: [PATCH 2/2] Update PENDING.MD --- PENDING.md | 1 + 1 file changed, 1 insertion(+) 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