diff --git a/x/tx/CHANGELOG.md b/x/tx/CHANGELOG.md index 9bc399cf97..8cebd933f4 100644 --- a/x/tx/CHANGELOG.md +++ b/x/tx/CHANGELOG.md @@ -31,13 +31,16 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +## v0.9.0 + ### Bug Fixes -* [#16681](https://github.com/cosmos/cosmos-sdk/pull/16681): catch and fix `(*Decoder).Decode` crash from invalid length prefix in Tx bytes +* [#16681](https://github.com/cosmos/cosmos-sdk/pull/16681): Catch and fix `(*Decoder).Decode` crash from invalid length prefix in Tx bytes. ### Improvements -* [#16684](https://github.com/cosmos/cosmos-sdk/pull/16684): x/tx/signing/aminojson: use io.WriteString+fmt.Fprintf to remove unnecessary string->[]byte roundtrip +* [#16846](https://github.com/cosmos/cosmos-sdk/pull/16846): Harmonize interface `signing.TypeResolver` with the rest of the codebase (orm and client/v2). +* [#16684](https://github.com/cosmos/cosmos-sdk/pull/16684): Use `io.WriteString`+`fmt.Fprintf` to remove unnecessary `string`->`[]byte` roundtrip. ## v0.8.0 diff --git a/x/tx/signing/aminojson/aminojson.go b/x/tx/signing/aminojson/aminojson.go index 5d4c3136f5..b0da26dfa4 100644 --- a/x/tx/signing/aminojson/aminojson.go +++ b/x/tx/signing/aminojson/aminojson.go @@ -22,7 +22,7 @@ type SignModeHandler struct { // SignModeHandlerOptions are the options for the SignModeHandler. type SignModeHandlerOptions struct { FileResolver signing.ProtoFileResolver - TypeResolver protoregistry.MessageTypeResolver + TypeResolver signing.TypeResolver Encoder *Encoder } diff --git a/x/tx/signing/aminojson/json_marshal.go b/x/tx/signing/aminojson/json_marshal.go index c4a97db01f..349f84348d 100644 --- a/x/tx/signing/aminojson/json_marshal.go +++ b/x/tx/signing/aminojson/json_marshal.go @@ -26,7 +26,7 @@ type EncoderOptions struct { // DonotSortFields when set turns off sorting of field names. DoNotSortFields bool // TypeResolver is used to resolve protobuf message types by TypeURL when marshaling any packed messages. - TypeResolver protoregistry.MessageTypeResolver + TypeResolver signing.TypeResolver // FileResolver is used to resolve protobuf file descriptors TypeURL when TypeResolver fails. FileResolver signing.ProtoFileResolver } diff --git a/x/tx/signing/context.go b/x/tx/signing/context.go index c4e99bdf20..ba2ad52c92 100644 --- a/x/tx/signing/context.go +++ b/x/tx/signing/context.go @@ -14,6 +14,11 @@ import ( "cosmossdk.io/core/address" ) +type TypeResolver interface { + protoregistry.MessageTypeResolver + protoregistry.ExtensionTypeResolver +} + // Context is a context for retrieving the list of signers from a // message where signers are specified by the cosmos.msg.v1.signer protobuf // option. It also contains the ProtoFileResolver and address.Codec's used @@ -34,7 +39,7 @@ type Options struct { FileResolver ProtoFileResolver // TypeResolver is the protobuf type resolver to use for resolving message types. - TypeResolver protoregistry.MessageTypeResolver + TypeResolver TypeResolver // AddressCodec is the codec for converting addresses between strings and bytes. AddressCodec address.Codec diff --git a/x/tx/signing/textual/fuzz_test.go b/x/tx/signing/textual/fuzz_test.go index 7df64de615..bdbf1be243 100644 --- a/x/tx/signing/textual/fuzz_test.go +++ b/x/tx/signing/textual/fuzz_test.go @@ -222,6 +222,8 @@ var ( ) func FuzzCoinsJSONTestcases(f *testing.F) { + f.Skip() // https://github.com/cosmos/cosmos-sdk/pull/16521#issuecomment-1614507574 + // Generate some seeds. seed, err := os.ReadFile("./internal/testdata/coins.json") if err != nil {