From 2b76e18d1fbd203f93ab229bac4b33c33d663cf9 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 7 Aug 2023 16:10:00 +0200 Subject: [PATCH 1/8] wip (dnm) --- client/v2/autocli/query.go | 52 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/client/v2/autocli/query.go b/client/v2/autocli/query.go index d5d92e364a00..c041fc3f79ee 100644 --- a/client/v2/autocli/query.go +++ b/client/v2/autocli/query.go @@ -1,6 +1,8 @@ package autocli import ( + "encoding/base64" + "encoding/json" "fmt" autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" @@ -123,6 +125,10 @@ func (b *Builder) BuildQueryMethodCommand(descriptor protoreflect.MethodDescript return fmt.Errorf("cannot marshal response %v: %w", output.Interface(), err) } + if result, err := decodeBase64Fields(bz); err == nil { + bz = result + } + return b.outOrStdoutFormat(cmd, bz) }) if err != nil { @@ -135,3 +141,49 @@ func (b *Builder) BuildQueryMethodCommand(descriptor protoreflect.MethodDescript return cmd, nil } + +// wip, we probably do not want to use that, as this gives false positives (600s f.e is decoded while it shouldn't) +func decodeBase64Fields(bz []byte) ([]byte, error) { + var result interface{} + if err := json.Unmarshal(bz, &result); err != nil { + return nil, fmt.Errorf("cannot unmarshal response %v: %w", bz, err) + } + + decodeString := func(s string) (string, error) { + decoded, err := base64.StdEncoding.DecodeString(s) + if err != nil { + return "", fmt.Errorf("cannot decode base64 string %s: %w", s, err) + } + return string(decoded), nil + } + + var decode func(interface{}) interface{} + decode = func(v interface{}) interface{} { + switch vv := v.(type) { + case string: + if decoded, err := decodeString(vv); err == nil { + return decoded + } + case []interface{}: + for i, u := range vv { + vv[i] = decode(u) + } + return vv + case map[string]interface{}: + for k, u := range vv { + vv[k] = decode(u) + } + return vv + } + + return v + } + + decoded := decode(result) + bz, err := json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("cannot marshal response %v: %w", decoded, err) + } + + return bz, nil +} From 645ffd4dc70ffafdad509aac705e8da9e768c77f Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Thu, 31 Aug 2023 15:26:47 +0200 Subject: [PATCH 2/8] updates --- client/v2/autocli/flag/builder.go | 5 ++- client/v2/autocli/query.go | 69 ++++--------------------------- client/v2/go.mod | 2 +- 3 files changed, 12 insertions(+), 64 deletions(-) diff --git a/client/v2/autocli/flag/builder.go b/client/v2/autocli/flag/builder.go index c595f5590802..bb2b7a0b530e 100644 --- a/client/v2/autocli/flag/builder.go +++ b/client/v2/autocli/flag/builder.go @@ -30,7 +30,10 @@ type Builder struct { // FileResolver specifies how protobuf file descriptors will be resolved. If it is // nil protoregistry.GlobalFiles will be used. - FileResolver protodesc.Resolver + FileResolver interface { + protodesc.Resolver + RangeFiles(func(protoreflect.FileDescriptor) bool) + } messageFlagTypes map[protoreflect.FullName]Type scalarFlagTypes map[string]Type diff --git a/client/v2/autocli/query.go b/client/v2/autocli/query.go index 547db5b95e27..94219438200d 100644 --- a/client/v2/autocli/query.go +++ b/client/v2/autocli/query.go @@ -1,14 +1,12 @@ package autocli import ( - "encoding/base64" - "encoding/json" "fmt" autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + "cosmossdk.io/x/tx/signing/aminojson" "github.com/cockroachdb/errors" "github.com/spf13/cobra" - "google.golang.org/protobuf/encoding/protojson" "google.golang.org/protobuf/reflect/protoreflect" "cosmossdk.io/client/v2/internal/util" @@ -103,17 +101,14 @@ func (b *Builder) BuildQueryMethodCommand(descriptor protoreflect.MethodDescript serviceDescriptor := descriptor.Parent().(protoreflect.ServiceDescriptor) methodName := fmt.Sprintf("/%s/%s", serviceDescriptor.FullName(), descriptor.Name()) outputType := util.ResolveMessageType(b.TypeResolver, descriptor.Output()) - jsonMarshalOptions := protojson.MarshalOptions{ - Indent: " ", - UseProtoNames: true, - UseEnumNumbers: false, - EmitUnpopulated: true, - Resolver: b.TypeResolver, - } + enc := aminojson.NewEncoder(aminojson.EncoderOptions{ + TypeResolver: b.TypeResolver, + FileResolver: b.FileResolver, + }) cmd, err := b.buildMethodCommandCommon(descriptor, options, func(cmd *cobra.Command, input protoreflect.Message) error { if noIdent, _ := cmd.Flags().GetBool(flagNoIndent); noIdent { - jsonMarshalOptions.Indent = "" + // TODO fix indent } clientConn, err := getClientConn(cmd) @@ -126,15 +121,11 @@ func (b *Builder) BuildQueryMethodCommand(descriptor protoreflect.MethodDescript return err } - bz, err := jsonMarshalOptions.Marshal(output.Interface()) + bz, err := enc.Marshal(output.Interface()) if err != nil { return fmt.Errorf("cannot marshal response %v: %w", output.Interface(), err) } - if result, err := decodeBase64Fields(bz); err == nil { - bz = result - } - return b.outOrStdoutFormat(cmd, bz) }) if err != nil { @@ -149,49 +140,3 @@ func (b *Builder) BuildQueryMethodCommand(descriptor protoreflect.MethodDescript return cmd, nil } - -// wip, we probably do not want to use that, as this gives false positives (600s f.e is decoded while it shouldn't) -func decodeBase64Fields(bz []byte) ([]byte, error) { - var result interface{} - if err := json.Unmarshal(bz, &result); err != nil { - return nil, fmt.Errorf("cannot unmarshal response %v: %w", bz, err) - } - - decodeString := func(s string) (string, error) { - decoded, err := base64.StdEncoding.DecodeString(s) - if err != nil { - return "", fmt.Errorf("cannot decode base64 string %s: %w", s, err) - } - return string(decoded), nil - } - - var decode func(interface{}) interface{} - decode = func(v interface{}) interface{} { - switch vv := v.(type) { - case string: - if decoded, err := decodeString(vv); err == nil { - return decoded - } - case []interface{}: - for i, u := range vv { - vv[i] = decode(u) - } - return vv - case map[string]interface{}: - for k, u := range vv { - vv[k] = decode(u) - } - return vv - } - - return v - } - - decoded := decode(result) - bz, err := json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("cannot marshal response %v: %w", decoded, err) - } - - return bz, nil -} diff --git a/client/v2/go.mod b/client/v2/go.mod index a6c9b53b1378..281952641fa4 100644 --- a/client/v2/go.mod +++ b/client/v2/go.mod @@ -7,6 +7,7 @@ require ( cosmossdk.io/core v0.10.0 cosmossdk.io/depinject v1.0.0-alpha.4 cosmossdk.io/log v1.2.1 + cosmossdk.io/x/tx v0.9.1 github.com/cockroachdb/errors v1.11.1 github.com/cosmos/cosmos-proto v1.0.0-beta.3 github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230718211500-1d74652f6021 @@ -24,7 +25,6 @@ require ( cosmossdk.io/errors v1.0.0 // indirect cosmossdk.io/math v1.1.2 // indirect cosmossdk.io/store v1.0.0-rc.0 // indirect - cosmossdk.io/x/tx v0.9.1 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect From 1e1ef2da41347a77c19566922e5a160a642d7c81 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Thu, 31 Aug 2023 15:49:02 +0200 Subject: [PATCH 3/8] nit --- client/v2/autocli/query.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/v2/autocli/query.go b/client/v2/autocli/query.go index 94219438200d..d8d6207d070f 100644 --- a/client/v2/autocli/query.go +++ b/client/v2/autocli/query.go @@ -102,8 +102,9 @@ func (b *Builder) BuildQueryMethodCommand(descriptor protoreflect.MethodDescript methodName := fmt.Sprintf("/%s/%s", serviceDescriptor.FullName(), descriptor.Name()) outputType := util.ResolveMessageType(b.TypeResolver, descriptor.Output()) enc := aminojson.NewEncoder(aminojson.EncoderOptions{ - TypeResolver: b.TypeResolver, - FileResolver: b.FileResolver, + DoNotSortFields: true, + TypeResolver: b.TypeResolver, + FileResolver: b.FileResolver, }) cmd, err := b.buildMethodCommandCommon(descriptor, options, func(cmd *cobra.Command, input protoreflect.Message) error { From 48f6248f0beefbfa48a987d9575c3940802e6882 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 11 Sep 2023 23:43:59 +0200 Subject: [PATCH 4/8] updates --- client/v2/autocli/query.go | 40 +++++++++++++++++++++++++++++++++---- client/v2/go.mod | 2 +- client/v2/go.sum | 4 ++-- simapp/go.mod | 2 +- simapp/go.sum | 4 ++-- simapp/gomod2nix.toml | 4 ++-- tests/go.mod | 2 +- tests/go.sum | 4 ++-- tests/starship/tests/go.mod | 2 +- 9 files changed, 48 insertions(+), 16 deletions(-) diff --git a/client/v2/autocli/query.go b/client/v2/autocli/query.go index d8d6207d070f..6eaacfdcd79e 100644 --- a/client/v2/autocli/query.go +++ b/client/v2/autocli/query.go @@ -2,6 +2,8 @@ package autocli import ( "fmt" + "io" + "time" autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" "cosmossdk.io/x/tx/signing/aminojson" @@ -101,15 +103,16 @@ func (b *Builder) BuildQueryMethodCommand(descriptor protoreflect.MethodDescript serviceDescriptor := descriptor.Parent().(protoreflect.ServiceDescriptor) methodName := fmt.Sprintf("/%s/%s", serviceDescriptor.FullName(), descriptor.Name()) outputType := util.ResolveMessageType(b.TypeResolver, descriptor.Output()) - enc := aminojson.NewEncoder(aminojson.EncoderOptions{ + encoderOptions := aminojson.EncoderOptions{ + Indent: " ", DoNotSortFields: true, TypeResolver: b.TypeResolver, FileResolver: b.FileResolver, - }) + } cmd, err := b.buildMethodCommandCommon(descriptor, options, func(cmd *cobra.Command, input protoreflect.Message) error { - if noIdent, _ := cmd.Flags().GetBool(flagNoIndent); noIdent { - // TODO fix indent + if noIndent, _ := cmd.Flags().GetBool(flagNoIndent); noIndent { + encoderOptions.Indent = "" } clientConn, err := getClientConn(cmd) @@ -122,6 +125,7 @@ func (b *Builder) BuildQueryMethodCommand(descriptor protoreflect.MethodDescript return err } + enc := encoder(aminojson.NewEncoder(encoderOptions)) bz, err := enc.Marshal(output.Interface()) if err != nil { return fmt.Errorf("cannot marshal response %v: %w", output.Interface(), err) @@ -141,3 +145,31 @@ func (b *Builder) BuildQueryMethodCommand(descriptor protoreflect.MethodDescript return cmd, nil } + +func encoder(encoder aminojson.Encoder) aminojson.Encoder { + return encoder.DefineTypeEncoding("google.protobuf.Duration", func(_ *aminojson.Encoder, msg protoreflect.Message, w io.Writer) error { + var ( + secondsName protoreflect.Name = "seconds" + nanosName protoreflect.Name = "nanos" + ) + + fields := msg.Descriptor().Fields() + secondsField := fields.ByName(secondsName) + if secondsField == nil { + return fmt.Errorf("expected seconds field") + } + + // check signs are consistent + seconds := msg.Get(secondsField).Int() + + nanosField := fields.ByName(nanosName) + if nanosField == nil { + return fmt.Errorf("expected nanos field") + } + + nanos := msg.Get(nanosField).Int() + + _, err := fmt.Fprintf(w, `"%s"`, time.Duration(time.Duration(seconds)*time.Second+(time.Duration(nanos)*time.Nanosecond)).String()) + return err + }) +} diff --git a/client/v2/go.mod b/client/v2/go.mod index 6cee72bd75f6..7204d75011a8 100644 --- a/client/v2/go.mod +++ b/client/v2/go.mod @@ -7,7 +7,7 @@ require ( cosmossdk.io/core v0.10.0 cosmossdk.io/depinject v1.0.0-alpha.4 cosmossdk.io/log v1.2.1 - cosmossdk.io/x/tx v0.9.1 + cosmossdk.io/x/tx v0.9.2-0.20230911171206-1f8d1ed9203e github.com/cockroachdb/errors v1.11.1 github.com/cosmos/cosmos-proto v1.0.0-beta.3 github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230718211500-1d74652f6021 diff --git a/client/v2/go.sum b/client/v2/go.sum index 9aafc7bafe81..0d0aefb8a458 100644 --- a/client/v2/go.sum +++ b/client/v2/go.sum @@ -51,8 +51,8 @@ cosmossdk.io/math v1.1.2 h1:ORZetZCTyWkI5GlZ6CZS28fMHi83ZYf+A2vVnHNzZBM= cosmossdk.io/math v1.1.2/go.mod h1:l2Gnda87F0su8a/7FEKJfFdJrM0JZRXQaohlgJeyQh0= cosmossdk.io/store v1.0.0-rc.0 h1:9DwOjuUYxDtYxn/REkTxGQAmxlIGfRroB35MQ8TrxF4= cosmossdk.io/store v1.0.0-rc.0/go.mod h1:FtBDOJmwtOZfmKKF65bKZbTYgS3bDNjjo3nP76dAegk= -cosmossdk.io/x/tx v0.9.1 h1:9pmmXA9Vs4qdouOFnzhsdsff2mif0f0kylMq5xTGhRI= -cosmossdk.io/x/tx v0.9.1/go.mod h1:/YFGTXG6+kyihd8YbfuJiXHV4R/mIMm2uvVzo80CIhA= +cosmossdk.io/x/tx v0.9.2-0.20230911171206-1f8d1ed9203e h1:gWCBprurg5QNDrDtWneIanf1Q286AzNK/9gQUT2Fi1c= +cosmossdk.io/x/tx v0.9.2-0.20230911171206-1f8d1ed9203e/go.mod h1:tTDamDDyuFZKNRVAwfeWp1klTb6R1PIme2oNbrkrskQ= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= diff --git a/simapp/go.mod b/simapp/go.mod index 18738fda1c2d..7709983191ec 100644 --- a/simapp/go.mod +++ b/simapp/go.mod @@ -16,7 +16,7 @@ require ( cosmossdk.io/x/evidence v0.0.0-20230613133644-0a778132a60f cosmossdk.io/x/feegrant v0.0.0-20230613133644-0a778132a60f cosmossdk.io/x/nft v0.0.0-20230613133644-0a778132a60f - cosmossdk.io/x/tx v0.9.1 + cosmossdk.io/x/tx v0.9.2-0.20230911171206-1f8d1ed9203e cosmossdk.io/x/upgrade v0.0.0-20230613133644-0a778132a60f github.com/cometbft/cometbft v0.38.0-rc3 github.com/cosmos/cosmos-db v1.0.0 diff --git a/simapp/go.sum b/simapp/go.sum index 76b7a14e49f8..08179c4dbfe1 100644 --- a/simapp/go.sum +++ b/simapp/go.sum @@ -203,8 +203,8 @@ cosmossdk.io/math v1.1.2 h1:ORZetZCTyWkI5GlZ6CZS28fMHi83ZYf+A2vVnHNzZBM= cosmossdk.io/math v1.1.2/go.mod h1:l2Gnda87F0su8a/7FEKJfFdJrM0JZRXQaohlgJeyQh0= cosmossdk.io/store v1.0.0-rc.0 h1:9DwOjuUYxDtYxn/REkTxGQAmxlIGfRroB35MQ8TrxF4= cosmossdk.io/store v1.0.0-rc.0/go.mod h1:FtBDOJmwtOZfmKKF65bKZbTYgS3bDNjjo3nP76dAegk= -cosmossdk.io/x/tx v0.9.1 h1:9pmmXA9Vs4qdouOFnzhsdsff2mif0f0kylMq5xTGhRI= -cosmossdk.io/x/tx v0.9.1/go.mod h1:/YFGTXG6+kyihd8YbfuJiXHV4R/mIMm2uvVzo80CIhA= +cosmossdk.io/x/tx v0.9.2-0.20230911171206-1f8d1ed9203e h1:gWCBprurg5QNDrDtWneIanf1Q286AzNK/9gQUT2Fi1c= +cosmossdk.io/x/tx v0.9.2-0.20230911171206-1f8d1ed9203e/go.mod h1:tTDamDDyuFZKNRVAwfeWp1klTb6R1PIme2oNbrkrskQ= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= diff --git a/simapp/gomod2nix.toml b/simapp/gomod2nix.toml index 057506393038..bc578e9651ee 100644 --- a/simapp/gomod2nix.toml +++ b/simapp/gomod2nix.toml @@ -41,8 +41,8 @@ schema = 3 version = "v1.0.0-rc.0" hash = "sha256-DgW4ZrDwmgsPtEXajPyAsrQuPjXekw5PfsYFvA5yuiE=" [mod."cosmossdk.io/x/tx"] - version = "v0.9.1" - hash = "sha256-/fopDRDbfIUr8Ub0qqu3k0y6FsLKTAwf51PJaCL18Bk=" + version = "v0.9.2-0.20230911171206-1f8d1ed9203e" + hash = "sha256-+lAsf0VrK6pUkeexGLiOPeir0I4QEEadUitgILFAKcU=" [mod."filippo.io/edwards25519"] version = "v1.0.0" hash = "sha256-APnPAcmItvtJ5Zsy863lzR2TjEBF9Y66TY1e4M1ap98=" diff --git a/tests/go.mod b/tests/go.mod index 4476914fb5f9..e8f7312748ad 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -15,7 +15,7 @@ require ( cosmossdk.io/x/evidence v0.0.0-20230613133644-0a778132a60f cosmossdk.io/x/feegrant v0.0.0-20230613133644-0a778132a60f cosmossdk.io/x/nft v0.0.0-20230613133644-0a778132a60f // indirect - cosmossdk.io/x/tx v0.9.1 + cosmossdk.io/x/tx v0.9.2-0.20230911171206-1f8d1ed9203e cosmossdk.io/x/upgrade v0.0.0-20230613133644-0a778132a60f github.com/cometbft/cometbft v0.38.0-rc3 github.com/cosmos/cosmos-db v1.0.0 diff --git a/tests/go.sum b/tests/go.sum index 71414feb47a9..c00c3b3a7b69 100644 --- a/tests/go.sum +++ b/tests/go.sum @@ -203,8 +203,8 @@ cosmossdk.io/math v1.1.2 h1:ORZetZCTyWkI5GlZ6CZS28fMHi83ZYf+A2vVnHNzZBM= cosmossdk.io/math v1.1.2/go.mod h1:l2Gnda87F0su8a/7FEKJfFdJrM0JZRXQaohlgJeyQh0= cosmossdk.io/store v1.0.0-rc.0 h1:9DwOjuUYxDtYxn/REkTxGQAmxlIGfRroB35MQ8TrxF4= cosmossdk.io/store v1.0.0-rc.0/go.mod h1:FtBDOJmwtOZfmKKF65bKZbTYgS3bDNjjo3nP76dAegk= -cosmossdk.io/x/tx v0.9.1 h1:9pmmXA9Vs4qdouOFnzhsdsff2mif0f0kylMq5xTGhRI= -cosmossdk.io/x/tx v0.9.1/go.mod h1:/YFGTXG6+kyihd8YbfuJiXHV4R/mIMm2uvVzo80CIhA= +cosmossdk.io/x/tx v0.9.2-0.20230911171206-1f8d1ed9203e h1:gWCBprurg5QNDrDtWneIanf1Q286AzNK/9gQUT2Fi1c= +cosmossdk.io/x/tx v0.9.2-0.20230911171206-1f8d1ed9203e/go.mod h1:tTDamDDyuFZKNRVAwfeWp1klTb6R1PIme2oNbrkrskQ= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= diff --git a/tests/starship/tests/go.mod b/tests/starship/tests/go.mod index ad218ccd1346..e37e011d935d 100644 --- a/tests/starship/tests/go.mod +++ b/tests/starship/tests/go.mod @@ -58,7 +58,7 @@ require ( cosmossdk.io/x/evidence v0.0.0-20230613133644-0a778132a60f // indirect cosmossdk.io/x/feegrant v0.0.0-20230613133644-0a778132a60f // indirect cosmossdk.io/x/nft v0.0.0-20230613133644-0a778132a60f // indirect - cosmossdk.io/x/tx v0.9.1 // indirect + cosmossdk.io/x/tx v0.9.2-0.20230911171206-1f8d1ed9203e // indirect cosmossdk.io/x/upgrade v0.0.0-20230613133644-0a778132a60f // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect From 293cec942afbcd0866ea021de315c7206e475d24 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 11 Sep 2023 23:52:53 +0200 Subject: [PATCH 5/8] lint --- client/v2/autocli/query.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/v2/autocli/query.go b/client/v2/autocli/query.go index 6eaacfdcd79e..f736c50b791b 100644 --- a/client/v2/autocli/query.go +++ b/client/v2/autocli/query.go @@ -169,7 +169,7 @@ func encoder(encoder aminojson.Encoder) aminojson.Encoder { nanos := msg.Get(nanosField).Int() - _, err := fmt.Fprintf(w, `"%s"`, time.Duration(time.Duration(seconds)*time.Second+(time.Duration(nanos)*time.Nanosecond)).String()) + _, err := fmt.Fprintf(w, `"%s"`, (time.Duration(seconds)*time.Second + (time.Duration(nanos) * time.Nanosecond)).String()) return err }) } From 343d6287285d3733c7ea80d80b87911c472c25d1 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Wed, 13 Sep 2023 12:42:04 +0200 Subject: [PATCH 6/8] updates --- client/v2/autocli/query.go | 1 - 1 file changed, 1 deletion(-) diff --git a/client/v2/autocli/query.go b/client/v2/autocli/query.go index f736c50b791b..da88d5b0d25a 100644 --- a/client/v2/autocli/query.go +++ b/client/v2/autocli/query.go @@ -159,7 +159,6 @@ func encoder(encoder aminojson.Encoder) aminojson.Encoder { return fmt.Errorf("expected seconds field") } - // check signs are consistent seconds := msg.Get(secondsField).Int() nanosField := fields.ByName(nanosName) From 149b8c322de258b520d946b9698efd3ed9211124 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Wed, 13 Sep 2023 13:45:01 +0200 Subject: [PATCH 7/8] use pseudo version from main --- client/v2/go.mod | 4 ++-- client/v2/go.sum | 8 ++++---- simapp/go.mod | 4 ++-- simapp/go.sum | 8 ++++---- simapp/gomod2nix.toml | 8 ++++---- tests/go.mod | 4 ++-- tests/go.sum | 8 ++++---- tests/starship/tests/go.mod | 4 ++-- 8 files changed, 24 insertions(+), 24 deletions(-) diff --git a/client/v2/go.mod b/client/v2/go.mod index 7204d75011a8..b55ccdbe8c74 100644 --- a/client/v2/go.mod +++ b/client/v2/go.mod @@ -4,10 +4,10 @@ go 1.21 require ( cosmossdk.io/api v0.7.0 - cosmossdk.io/core v0.10.0 + cosmossdk.io/core v0.11.0 cosmossdk.io/depinject v1.0.0-alpha.4 cosmossdk.io/log v1.2.1 - cosmossdk.io/x/tx v0.9.2-0.20230911171206-1f8d1ed9203e + cosmossdk.io/x/tx v0.9.2-0.20230913111958-e394604f8382 github.com/cockroachdb/errors v1.11.1 github.com/cosmos/cosmos-proto v1.0.0-beta.3 github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230718211500-1d74652f6021 diff --git a/client/v2/go.sum b/client/v2/go.sum index 0d0aefb8a458..b9e6a26b2708 100644 --- a/client/v2/go.sum +++ b/client/v2/go.sum @@ -39,8 +39,8 @@ cosmossdk.io/api v0.7.0 h1:QsEMIWuv9xWDbF2HZnW4Lpu1/SejCztPu0LQx7t6MN4= cosmossdk.io/api v0.7.0/go.mod h1:kJFAEMLN57y0viszHDPLMmieF0471o5QAwwApa+270M= cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= -cosmossdk.io/core v0.10.0 h1:NP28Ol9YyRODmZLJg2ko/mUl40hMegeMzhJnG+XPkcY= -cosmossdk.io/core v0.10.0/go.mod h1:MygXNld9DvMgYY4yE76DM/mdZpgfeyRjy6FPjEEehlY= +cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= +cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc= cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU= cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04= @@ -51,8 +51,8 @@ cosmossdk.io/math v1.1.2 h1:ORZetZCTyWkI5GlZ6CZS28fMHi83ZYf+A2vVnHNzZBM= cosmossdk.io/math v1.1.2/go.mod h1:l2Gnda87F0su8a/7FEKJfFdJrM0JZRXQaohlgJeyQh0= cosmossdk.io/store v1.0.0-rc.0 h1:9DwOjuUYxDtYxn/REkTxGQAmxlIGfRroB35MQ8TrxF4= cosmossdk.io/store v1.0.0-rc.0/go.mod h1:FtBDOJmwtOZfmKKF65bKZbTYgS3bDNjjo3nP76dAegk= -cosmossdk.io/x/tx v0.9.2-0.20230911171206-1f8d1ed9203e h1:gWCBprurg5QNDrDtWneIanf1Q286AzNK/9gQUT2Fi1c= -cosmossdk.io/x/tx v0.9.2-0.20230911171206-1f8d1ed9203e/go.mod h1:tTDamDDyuFZKNRVAwfeWp1klTb6R1PIme2oNbrkrskQ= +cosmossdk.io/x/tx v0.9.2-0.20230913111958-e394604f8382 h1:p/wyc5pVTMtx2/RsKP0fUpOKGbDfy6q6WswJtmARdbg= +cosmossdk.io/x/tx v0.9.2-0.20230913111958-e394604f8382/go.mod h1:MKo9/b5wsoL8dd9y9pvD2yOP1CMvzHIWYxi1l2oLPFo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= diff --git a/simapp/go.mod b/simapp/go.mod index 7709983191ec..548271513cba 100644 --- a/simapp/go.mod +++ b/simapp/go.mod @@ -6,7 +6,7 @@ require ( cosmossdk.io/api v0.7.0 cosmossdk.io/client/v2 v2.0.0-20230630094428-02b760776860 cosmossdk.io/collections v0.4.0 - cosmossdk.io/core v0.10.0 + cosmossdk.io/core v0.11.0 cosmossdk.io/depinject v1.0.0-alpha.4 cosmossdk.io/log v1.2.1 cosmossdk.io/math v1.1.2 @@ -16,7 +16,7 @@ require ( cosmossdk.io/x/evidence v0.0.0-20230613133644-0a778132a60f cosmossdk.io/x/feegrant v0.0.0-20230613133644-0a778132a60f cosmossdk.io/x/nft v0.0.0-20230613133644-0a778132a60f - cosmossdk.io/x/tx v0.9.2-0.20230911171206-1f8d1ed9203e + cosmossdk.io/x/tx v0.9.2-0.20230913111958-e394604f8382 cosmossdk.io/x/upgrade v0.0.0-20230613133644-0a778132a60f github.com/cometbft/cometbft v0.38.0-rc3 github.com/cosmos/cosmos-db v1.0.0 diff --git a/simapp/go.sum b/simapp/go.sum index 08179c4dbfe1..df13713fd9ec 100644 --- a/simapp/go.sum +++ b/simapp/go.sum @@ -191,8 +191,8 @@ cosmossdk.io/api v0.7.0 h1:QsEMIWuv9xWDbF2HZnW4Lpu1/SejCztPu0LQx7t6MN4= cosmossdk.io/api v0.7.0/go.mod h1:kJFAEMLN57y0viszHDPLMmieF0471o5QAwwApa+270M= cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= -cosmossdk.io/core v0.10.0 h1:NP28Ol9YyRODmZLJg2ko/mUl40hMegeMzhJnG+XPkcY= -cosmossdk.io/core v0.10.0/go.mod h1:MygXNld9DvMgYY4yE76DM/mdZpgfeyRjy6FPjEEehlY= +cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= +cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc= cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU= cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04= @@ -203,8 +203,8 @@ cosmossdk.io/math v1.1.2 h1:ORZetZCTyWkI5GlZ6CZS28fMHi83ZYf+A2vVnHNzZBM= cosmossdk.io/math v1.1.2/go.mod h1:l2Gnda87F0su8a/7FEKJfFdJrM0JZRXQaohlgJeyQh0= cosmossdk.io/store v1.0.0-rc.0 h1:9DwOjuUYxDtYxn/REkTxGQAmxlIGfRroB35MQ8TrxF4= cosmossdk.io/store v1.0.0-rc.0/go.mod h1:FtBDOJmwtOZfmKKF65bKZbTYgS3bDNjjo3nP76dAegk= -cosmossdk.io/x/tx v0.9.2-0.20230911171206-1f8d1ed9203e h1:gWCBprurg5QNDrDtWneIanf1Q286AzNK/9gQUT2Fi1c= -cosmossdk.io/x/tx v0.9.2-0.20230911171206-1f8d1ed9203e/go.mod h1:tTDamDDyuFZKNRVAwfeWp1klTb6R1PIme2oNbrkrskQ= +cosmossdk.io/x/tx v0.9.2-0.20230913111958-e394604f8382 h1:p/wyc5pVTMtx2/RsKP0fUpOKGbDfy6q6WswJtmARdbg= +cosmossdk.io/x/tx v0.9.2-0.20230913111958-e394604f8382/go.mod h1:MKo9/b5wsoL8dd9y9pvD2yOP1CMvzHIWYxi1l2oLPFo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= diff --git a/simapp/gomod2nix.toml b/simapp/gomod2nix.toml index bc578e9651ee..6cf051d9ad16 100644 --- a/simapp/gomod2nix.toml +++ b/simapp/gomod2nix.toml @@ -23,8 +23,8 @@ schema = 3 version = "v0.4.0" hash = "sha256-minFyzgO/D+Oda4E3B1qvOAN5qd65SjS6nmjca4cp/8=" [mod."cosmossdk.io/core"] - version = "v0.10.0" - hash = "sha256-VLVMqLMvbPLdJ5NmFtQvG0RIcHNpaiR/BvboXXWl0+I=" + version = "v0.11.0" + hash = "sha256-zUiOF04lWHK8OZqGhwVuzKYfig5I0107D+8fWX5/pbQ=" [mod."cosmossdk.io/depinject"] version = "v1.0.0-alpha.4" hash = "sha256-xpLH0K6ivQznFrLw2hmhWIIyYgqjstV47OhTEj/c1oQ=" @@ -41,8 +41,8 @@ schema = 3 version = "v1.0.0-rc.0" hash = "sha256-DgW4ZrDwmgsPtEXajPyAsrQuPjXekw5PfsYFvA5yuiE=" [mod."cosmossdk.io/x/tx"] - version = "v0.9.2-0.20230911171206-1f8d1ed9203e" - hash = "sha256-+lAsf0VrK6pUkeexGLiOPeir0I4QEEadUitgILFAKcU=" + version = "v0.9.2-0.20230913111958-e394604f8382" + hash = "sha256-am/+/mfQR+xqjQSTFh2X/AiC6EQZvZ7te6d8MIwd/EA=" [mod."filippo.io/edwards25519"] version = "v1.0.0" hash = "sha256-APnPAcmItvtJ5Zsy863lzR2TjEBF9Y66TY1e4M1ap98=" diff --git a/tests/go.mod b/tests/go.mod index e8f7312748ad..cc14500ff3bb 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -5,7 +5,7 @@ go 1.21 require ( cosmossdk.io/api v0.7.0 cosmossdk.io/collections v0.4.0 - cosmossdk.io/core v0.10.0 + cosmossdk.io/core v0.11.0 cosmossdk.io/depinject v1.0.0-alpha.4 cosmossdk.io/errors v1.0.0 cosmossdk.io/log v1.2.1 @@ -15,7 +15,7 @@ require ( cosmossdk.io/x/evidence v0.0.0-20230613133644-0a778132a60f cosmossdk.io/x/feegrant v0.0.0-20230613133644-0a778132a60f cosmossdk.io/x/nft v0.0.0-20230613133644-0a778132a60f // indirect - cosmossdk.io/x/tx v0.9.2-0.20230911171206-1f8d1ed9203e + cosmossdk.io/x/tx v0.9.2-0.20230913111958-e394604f8382 cosmossdk.io/x/upgrade v0.0.0-20230613133644-0a778132a60f github.com/cometbft/cometbft v0.38.0-rc3 github.com/cosmos/cosmos-db v1.0.0 diff --git a/tests/go.sum b/tests/go.sum index c00c3b3a7b69..1fbf1f63249a 100644 --- a/tests/go.sum +++ b/tests/go.sum @@ -191,8 +191,8 @@ cosmossdk.io/api v0.7.0 h1:QsEMIWuv9xWDbF2HZnW4Lpu1/SejCztPu0LQx7t6MN4= cosmossdk.io/api v0.7.0/go.mod h1:kJFAEMLN57y0viszHDPLMmieF0471o5QAwwApa+270M= cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= -cosmossdk.io/core v0.10.0 h1:NP28Ol9YyRODmZLJg2ko/mUl40hMegeMzhJnG+XPkcY= -cosmossdk.io/core v0.10.0/go.mod h1:MygXNld9DvMgYY4yE76DM/mdZpgfeyRjy6FPjEEehlY= +cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= +cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc= cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU= cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04= @@ -203,8 +203,8 @@ cosmossdk.io/math v1.1.2 h1:ORZetZCTyWkI5GlZ6CZS28fMHi83ZYf+A2vVnHNzZBM= cosmossdk.io/math v1.1.2/go.mod h1:l2Gnda87F0su8a/7FEKJfFdJrM0JZRXQaohlgJeyQh0= cosmossdk.io/store v1.0.0-rc.0 h1:9DwOjuUYxDtYxn/REkTxGQAmxlIGfRroB35MQ8TrxF4= cosmossdk.io/store v1.0.0-rc.0/go.mod h1:FtBDOJmwtOZfmKKF65bKZbTYgS3bDNjjo3nP76dAegk= -cosmossdk.io/x/tx v0.9.2-0.20230911171206-1f8d1ed9203e h1:gWCBprurg5QNDrDtWneIanf1Q286AzNK/9gQUT2Fi1c= -cosmossdk.io/x/tx v0.9.2-0.20230911171206-1f8d1ed9203e/go.mod h1:tTDamDDyuFZKNRVAwfeWp1klTb6R1PIme2oNbrkrskQ= +cosmossdk.io/x/tx v0.9.2-0.20230913111958-e394604f8382 h1:p/wyc5pVTMtx2/RsKP0fUpOKGbDfy6q6WswJtmARdbg= +cosmossdk.io/x/tx v0.9.2-0.20230913111958-e394604f8382/go.mod h1:MKo9/b5wsoL8dd9y9pvD2yOP1CMvzHIWYxi1l2oLPFo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= diff --git a/tests/starship/tests/go.mod b/tests/starship/tests/go.mod index e37e011d935d..6e41186c2ccf 100644 --- a/tests/starship/tests/go.mod +++ b/tests/starship/tests/go.mod @@ -50,7 +50,7 @@ require ( cosmossdk.io/api v0.7.0 // indirect cosmossdk.io/client/v2 v2.0.0-20230630094428-02b760776860 // indirect cosmossdk.io/collections v0.4.0 // indirect - cosmossdk.io/core v0.10.0 // indirect + cosmossdk.io/core v0.11.0 // indirect cosmossdk.io/depinject v1.0.0-alpha.4 // indirect cosmossdk.io/errors v1.0.0 // indirect cosmossdk.io/store v1.0.0-rc.0 // indirect @@ -58,7 +58,7 @@ require ( cosmossdk.io/x/evidence v0.0.0-20230613133644-0a778132a60f // indirect cosmossdk.io/x/feegrant v0.0.0-20230613133644-0a778132a60f // indirect cosmossdk.io/x/nft v0.0.0-20230613133644-0a778132a60f // indirect - cosmossdk.io/x/tx v0.9.2-0.20230911171206-1f8d1ed9203e // indirect + cosmossdk.io/x/tx v0.9.2-0.20230913111958-e394604f8382 // indirect cosmossdk.io/x/upgrade v0.0.0-20230613133644-0a778132a60f // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect From 1049ed08e158441ce99abc5735d2001316d0a3ae Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Wed, 13 Sep 2023 14:40:33 +0200 Subject: [PATCH 8/8] fixes --- tests/starship/tests/go.sum | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/starship/tests/go.sum b/tests/starship/tests/go.sum index a51c20608f7d..82d3add518e6 100644 --- a/tests/starship/tests/go.sum +++ b/tests/starship/tests/go.sum @@ -203,8 +203,8 @@ cosmossdk.io/math v1.1.2 h1:ORZetZCTyWkI5GlZ6CZS28fMHi83ZYf+A2vVnHNzZBM= cosmossdk.io/math v1.1.2/go.mod h1:l2Gnda87F0su8a/7FEKJfFdJrM0JZRXQaohlgJeyQh0= cosmossdk.io/store v1.0.0-rc.0 h1:9DwOjuUYxDtYxn/REkTxGQAmxlIGfRroB35MQ8TrxF4= cosmossdk.io/store v1.0.0-rc.0/go.mod h1:FtBDOJmwtOZfmKKF65bKZbTYgS3bDNjjo3nP76dAegk= -cosmossdk.io/x/tx v0.9.1 h1:9pmmXA9Vs4qdouOFnzhsdsff2mif0f0kylMq5xTGhRI= -cosmossdk.io/x/tx v0.9.1/go.mod h1:/YFGTXG6+kyihd8YbfuJiXHV4R/mIMm2uvVzo80CIhA= +cosmossdk.io/x/tx v0.9.2-0.20230913111958-e394604f8382 h1:p/wyc5pVTMtx2/RsKP0fUpOKGbDfy6q6WswJtmARdbg= +cosmossdk.io/x/tx v0.9.2-0.20230913111958-e394604f8382/go.mod h1:MKo9/b5wsoL8dd9y9pvD2yOP1CMvzHIWYxi1l2oLPFo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns=