diff --git a/CHANGELOG.md b/CHANGELOG.md index e808f085da..0c06ec7151 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -266,6 +266,7 @@ extension interfaces. `module.Manager.Modules` is now of type `map[string]interf ### Bug Fixes +* [#14995](https://github.com/cosmos/cosmos-sdk/pull/14995) Allow unknown fields in `ParseTypedEvent`. * [#14952](https://github.com/cosmos/cosmos-sdk/pull/14952) Pin version of github.com/syndtr/goleveldb `v1.0.1-0.20210819022825-2ae1ddf74ef7` to avoid issues in the store. * (store) [#14931](https://github.com/cosmos/cosmos-sdk/pull/14931) Exclude in-memory KVStores, i.e. `StoreTypeMemory`, from CommitInfo commitments. * (types/coin) [#14715](https://github.com/cosmos/cosmos-sdk/pull/14715) `sdk.Coins.Add` now returns an empty set of coins `sdk.Coins{}` if both coins set are empty. diff --git a/types/events.go b/types/events.go index 3f4b279ac7..0ac28b0461 100644 --- a/types/events.go +++ b/types/events.go @@ -119,7 +119,7 @@ func TypedEventToEvent(tev proto.Message) (Event, error) { }, nil } -// ParseTypedEvent converts abci.Event back to typed event +// ParseTypedEvent converts abci.Event back to a typed event. func ParseTypedEvent(event abci.Event) (proto.Message, error) { concreteGoType := proto.MessageType(event.Type) if concreteGoType == nil { @@ -148,8 +148,8 @@ func ParseTypedEvent(event abci.Event) (proto.Message, error) { return nil, err } - err = jsonpb.Unmarshal(strings.NewReader(string(attrBytes)), protoMsg) - if err != nil { + unmarshaler := jsonpb.Unmarshaler{AllowUnknownFields: true} + if err := unmarshaler.Unmarshal(strings.NewReader(string(attrBytes)), protoMsg); err != nil { return nil, err }