Skip to content

Commit

Permalink
Merge PR #2643: AppendTag function usage error. append elements do no…
Browse files Browse the repository at this point in the history
…t work
  • Loading branch information
elvin-du authored and cwgoes committed Nov 1, 2018
1 parent 9cf53f2 commit 1686ba0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions PENDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,7 @@ BUG FIXES
* Gaia

* SDK
- #2625 [x/gov] fix AppendTag function usage error


* Tendermint
12 changes: 6 additions & 6 deletions x/gov/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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{
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1686ba0

Please sign in to comment.