From 1686ba072bfdcd87ab0526be6281b90c351f81ab Mon Sep 17 00:00:00 2001 From: Elvin Date: Thu, 1 Nov 2018 17:26:44 +0800 Subject: [PATCH] Merge PR #2643: AppendTag function usage error. append elements do not work --- PENDING.md | 2 ++ x/gov/handler.go | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/PENDING.md b/PENDING.md index 8a16136c0965..4a13214b6038 100644 --- a/PENDING.md +++ b/PENDING.md @@ -57,5 +57,7 @@ BUG FIXES * Gaia * SDK + - #2625 [x/gov] fix AppendTag function usage error + * Tendermint diff --git a/x/gov/handler.go b/x/gov/handler.go index 3f8cd312b695..dc1dbfb10e40 100644 --- a/x/gov/handler.go +++ b/x/gov/handler.go @@ -42,7 +42,7 @@ func handleMsgSubmitProposal(ctx sdk.Context, keeper Keeper, msg MsgSubmitPropos ) if votingStarted { - resTags.AppendTag(tags.VotingPeriodStart, proposalIDBytes) + resTags = resTags.AppendTag(tags.VotingPeriodStart, proposalIDBytes) } return sdk.Result{ @@ -68,7 +68,7 @@ func handleMsgDeposit(ctx sdk.Context, keeper Keeper, msg MsgDeposit) sdk.Result ) if votingStarted { - resTags.AppendTag(tags.VotingPeriodStart, proposalIDBytes) + resTags = resTags.AppendTag(tags.VotingPeriodStart, proposalIDBytes) } return sdk.Result{ @@ -111,8 +111,8 @@ func EndBlocker(ctx sdk.Context, keeper Keeper) (resTags sdk.Tags) { proposalIDBytes := keeper.cdc.MustMarshalBinaryBare(inactiveProposal.GetProposalID()) keeper.DeleteProposal(ctx, inactiveProposal) - resTags.AppendTag(tags.Action, tags.ActionProposalDropped) - resTags.AppendTag(tags.ProposalID, proposalIDBytes) + resTags = resTags.AppendTag(tags.Action, tags.ActionProposalDropped) + resTags = resTags.AppendTag(tags.ProposalID, proposalIDBytes) logger.Info( fmt.Sprintf("proposal %d (%s) didn't meet minimum deposit of %v steak (had only %v steak); deleted", @@ -152,8 +152,8 @@ func EndBlocker(ctx sdk.Context, keeper Keeper) (resTags sdk.Tags) { logger.Info(fmt.Sprintf("proposal %d (%s) tallied; passed: %v", activeProposal.GetProposalID(), activeProposal.GetTitle(), passes)) - resTags.AppendTag(tags.Action, action) - resTags.AppendTag(tags.ProposalID, proposalIDBytes) + resTags = resTags.AppendTag(tags.Action, action) + resTags = resTags.AppendTag(tags.ProposalID, proposalIDBytes) } return resTags