From d857e20dddb2cd04eb8aa2e87a7f5b8a4860c5df Mon Sep 17 00:00:00 2001 From: elvin Date: Mon, 29 Oct 2018 18:39:11 +0800 Subject: [PATCH 1/4] fix bug: Tags.AppendTag do not work --- types/tags.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/tags.go b/types/tags.go index add0c0ad5425..241d49ed01f5 100644 --- a/types/tags.go +++ b/types/tags.go @@ -17,7 +17,8 @@ func EmptyTags() Tags { // Append a single tag func (t Tags) AppendTag(k string, v []byte) Tags { - return append(t, MakeTag(k, v)) + t = append(t, MakeTag(k, v)) + return t } // Append two lists of tags From ba2cf9a161619fb3a4f108bb6cc452f0a945c9b4 Mon Sep 17 00:00:00 2001 From: elvin Date: Wed, 31 Oct 2018 14:18:19 +0800 Subject: [PATCH 2/4] fix bug:Tags append error --- types/tags.go | 3 +-- x/gov/handler.go | 12 ++++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/types/tags.go b/types/tags.go index 241d49ed01f5..add0c0ad5425 100644 --- a/types/tags.go +++ b/types/tags.go @@ -17,8 +17,7 @@ func EmptyTags() Tags { // Append a single tag func (t Tags) AppendTag(k string, v []byte) Tags { - t = append(t, MakeTag(k, v)) - return t + return append(t, MakeTag(k, v)) } // Append two lists of tags diff --git a/x/gov/handler.go b/x/gov/handler.go index 3f8cd312b695..1fd5a4eeab04 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) + resTag = 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 From f9044515d35f5dcb44edffd079d59b9947e14e0e Mon Sep 17 00:00:00 2001 From: elvin Date: Wed, 31 Oct 2018 16:13:34 +0800 Subject: [PATCH 3/4] fix type error --- CHANGELOG.md | 8 ++++++++ x/gov/handler.go | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 764d481f887a..680bfbf6f540 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.25.0 + +*October 31st, 2018* + +BUG FIXES +* [x/gov] \#2625](https://github.com/cosmos/cosmos-sdk/pull/2625) - fix bug: AppendTag function usage error + + ## 0.25.0 *October 24th, 2018* diff --git a/x/gov/handler.go b/x/gov/handler.go index 1fd5a4eeab04..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 { - resTag = resTags.AppendTag(tags.VotingPeriodStart, proposalIDBytes) + resTags = resTags.AppendTag(tags.VotingPeriodStart, proposalIDBytes) } return sdk.Result{ From 4b1c09e00428472d682bfe8b5c4fc1a921e40b55 Mon Sep 17 00:00:00 2001 From: elvin Date: Thu, 1 Nov 2018 10:20:21 +0800 Subject: [PATCH 4/4] update PENDING.md --- CHANGELOG.md | 8 -------- PENDING.md | 2 ++ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 680bfbf6f540..764d481f887a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,5 @@ # Changelog -## 0.25.0 - -*October 31st, 2018* - -BUG FIXES -* [x/gov] \#2625](https://github.com/cosmos/cosmos-sdk/pull/2625) - fix bug: AppendTag function usage error - - ## 0.25.0 *October 24th, 2018* 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