Skip to content

Commit

Permalink
Revert "fix(x/gov): Return ErrInvalidProposalContent in SubmitProposa…
Browse files Browse the repository at this point in the history
…l when legacy handler returns an error. (backport cosmos#13051) (cosmos#15667)"

This reverts commit f89d955.
  • Loading branch information
yihuang committed May 30, 2023
1 parent 863ad92 commit 50d6acd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

* (cli) [#16312](https://github.com/cosmos/cosmos-sdk/pull/16312) Allow any addresses in `client.ValidatePromptAddress`.
* (store/iavl) [#15717](https://github.com/cosmos/cosmos-sdk/pull/15717) Upstream error on empty version (this change was present on all version but v0.46).
* (x/gov) [#]() Revert a change that breaks result hash.

## [v0.46.12](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.12) - 2022-04-04

Expand All @@ -73,7 +74,6 @@ Ref: https://keepachangelog.com/en/1.0.0/
### Bug Fixes

* (x/auth/vesting) [#15383](https://github.com/cosmos/cosmos-sdk/pull/15383) Add extra checks when creating a periodic vesting account.
* (x/gov) [#13051](https://github.com/cosmos/cosmos-sdk/pull/13051) In SubmitPropsal, when a legacy msg fails it's handler call, wrap the error as ErrInvalidProposalContent (instead of ErrNoProposalHandlerExists).

## [v0.46.11](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.11) - 2022-03-03

Expand Down
6 changes: 1 addition & 5 deletions x/gov/keeper/proposal.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package keeper

import (
"errors"
"fmt"

"github.com/cosmos/cosmos-sdk/client"
Expand Down Expand Up @@ -55,10 +54,7 @@ func (keeper Keeper) SubmitProposal(ctx sdk.Context, messages []sdk.Msg, metadat
if msg, ok := msg.(*v1.MsgExecLegacyContent); ok {
cacheCtx, _ := ctx.CacheContext()
if _, err := handler(cacheCtx, msg); err != nil {
if errors.Is(types.ErrNoProposalHandlerExists, err) {
return v1.Proposal{}, err
}
return v1.Proposal{}, sdkerrors.Wrap(types.ErrInvalidProposalContent, err.Error())
return v1.Proposal{}, sdkerrors.Wrap(types.ErrNoProposalHandlerExists, err.Error())
}
}

Expand Down

0 comments on commit 50d6acd

Please sign in to comment.