From 3528cd73ac0713a2a24110fe8c0c60afdd363d1a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 20 Jun 2024 09:30:56 +0200 Subject: [PATCH] build(deps): bump cosmossdk.io/client/v2 from 2.0.0-beta.1 to 2.0.0-beta.2 (#143) * build(deps): bump cosmossdk.io/client/v2 Bumps [cosmossdk.io/client/v2](https://github.com/cosmos/cosmos-sdk) from 2.0.0-beta.1 to 2.0.0-beta.2. - [Release notes](https://github.com/cosmos/cosmos-sdk/releases) - [Changelog](https://github.com/cosmos/cosmos-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/cosmos/cosmos-sdk/compare/client/v2.0.0-beta.1...client/v2.0.0-beta.2) --- updated-dependencies: - dependency-name: cosmossdk.io/client/v2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * updates --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Julien Robert --- cmd/minid/cmd/root.go | 38 ++++++++------------------------------ go.mod | 4 ++-- go.sum | 8 ++++---- 3 files changed, 14 insertions(+), 36 deletions(-) diff --git a/cmd/minid/cmd/root.go b/cmd/minid/cmd/root.go index 87e8371..aaeb5dc 100644 --- a/cmd/minid/cmd/root.go +++ b/cmd/minid/cmd/root.go @@ -8,8 +8,6 @@ import ( "github.com/spf13/cobra" "cosmossdk.io/client/v2/autocli" - clientv2keyring "cosmossdk.io/client/v2/autocli/keyring" - "cosmossdk.io/core/address" "cosmossdk.io/depinject" "cosmossdk.io/log" @@ -17,13 +15,11 @@ import ( "github.com/cosmos/cosmos-sdk/client/config" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/crypto/keyring" "github.com/cosmos/cosmos-sdk/server" serverconfig "github.com/cosmos/cosmos-sdk/server/config" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/cosmos/cosmos-sdk/types/tx/signing" "github.com/cosmos/cosmos-sdk/x/auth/tx" - txmodule "github.com/cosmos/cosmos-sdk/x/auth/tx/config" + authtxconfig "github.com/cosmos/cosmos-sdk/x/auth/tx/config" "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmosregistry/chain-minimal/app" @@ -33,7 +29,6 @@ import ( // main function. func NewRootCmd() *cobra.Command { var ( - txConfigOpts tx.ConfigOptions autoCliOpts autocli.AppOptions moduleBasicManager module.BasicManager clientCtx client.Context @@ -46,10 +41,8 @@ func NewRootCmd() *cobra.Command { ), depinject.Provide( ProvideClientContext, - ProvideKeyring, ), ), - &txConfigOpts, &autoCliOpts, &moduleBasicManager, &clientCtx, @@ -76,19 +69,6 @@ func NewRootCmd() *cobra.Command { return err } - // sign mode textual is only available in online mode - if !clientCtx.Offline { - // This needs to go after ReadFromClientConfig, as that function ets the RPC client needed for SIGN_MODE_TEXTUAL. - txConfigOpts.EnabledSignModes = append(txConfigOpts.EnabledSignModes, signing.SignMode_SIGN_MODE_TEXTUAL) - txConfigOpts.TextualCoinMetadataQueryFn = txmodule.NewGRPCCoinMetadataQueryFn(clientCtx) - txConfigWithTextual, err := tx.NewTxConfigWithOptions(codec.NewProtoCodec(clientCtx.InterfaceRegistry), txConfigOpts) - if err != nil { - return err - } - - clientCtx = clientCtx.WithTxConfig(txConfigWithTextual) - } - if err := client.SetCmdClientContextHandler(clientCtx, cmd); err != nil { return err } @@ -118,13 +98,12 @@ func NewRootCmd() *cobra.Command { func ProvideClientContext( appCodec codec.Codec, interfaceRegistry codectypes.InterfaceRegistry, - txConfig client.TxConfig, + txConfigOpts tx.ConfigOptions, legacyAmino *codec.LegacyAmino, ) client.Context { clientCtx := client.Context{}. WithCodec(appCodec). WithInterfaceRegistry(interfaceRegistry). - WithTxConfig(txConfig). WithLegacyAmino(legacyAmino). WithInput(os.Stdin). WithAccountRetriever(types.AccountRetriever{}). @@ -134,14 +113,13 @@ func ProvideClientContext( // Read the config again to overwrite the default values with the values from the config file clientCtx, _ = config.ReadFromClientConfig(clientCtx) - return clientCtx -} - -func ProvideKeyring(clientCtx client.Context, addressCodec address.Codec) (clientv2keyring.Keyring, error) { - kb, err := client.NewKeyringFromBackend(clientCtx, clientCtx.Keyring.Backend()) + // textual is enabled by default, we need to re-create the tx config grpc instead of bank keeper. + txConfigOpts.TextualCoinMetadataQueryFn = authtxconfig.NewGRPCCoinMetadataQueryFn(clientCtx) + txConfig, err := tx.NewTxConfigWithOptions(clientCtx.Codec, txConfigOpts) if err != nil { - return nil, err + panic(err) } + clientCtx = clientCtx.WithTxConfig(txConfig) - return keyring.NewAutoCLIKeyring(kb) + return clientCtx } diff --git a/go.mod b/go.mod index 58a960e..e7fe044 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ replace ( require ( cosmossdk.io/api v0.7.5 - cosmossdk.io/client/v2 v2.0.0-beta.1 + cosmossdk.io/client/v2 v2.0.0-beta.2 cosmossdk.io/core v0.11.0 cosmossdk.io/depinject v1.0.0-alpha.4 cosmossdk.io/errors v1.0.1 @@ -54,7 +54,7 @@ require ( github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/gogoproto v1.4.12 // indirect + github.com/cosmos/gogoproto v1.5.0 // indirect github.com/cosmos/iavl v1.1.2 // indirect github.com/cosmos/ics23/go v0.10.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect diff --git a/go.sum b/go.sum index 63aa64d..55fb70a 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,8 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cosmossdk.io/api v0.7.5 h1:eMPTReoNmGUm8DeiQL9DyM8sYDjEhWzL1+nLbI9DqtQ= cosmossdk.io/api v0.7.5/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= -cosmossdk.io/client/v2 v2.0.0-beta.1 h1:XkHh1lhrLYIT9zKl7cIOXUXg2hdhtjTPBUfqERNA1/Q= -cosmossdk.io/client/v2 v2.0.0-beta.1/go.mod h1:JEUSu9moNZQ4kU3ir1DKD5eU4bllmAexrGWjmb9k8qU= +cosmossdk.io/client/v2 v2.0.0-beta.2 h1:jnTKB0PLb7qunQibijAftwmNjUbsIAf1sPjF5HaCW/E= +cosmossdk.io/client/v2 v2.0.0-beta.2/go.mod h1:8QAyewD7rDWeJGqedFBpeqJ9XLIJAkt1TDhCf1gsN9o= 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.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= @@ -151,8 +151,8 @@ github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4x github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= -github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= +github.com/cosmos/gogoproto v1.5.0 h1:SDVwzEqZDDBoslaeZg+dGE55hdzHfgUA40pEanMh52o= +github.com/cosmos/gogoproto v1.5.0/go.mod h1:iUM31aofn3ymidYG6bUR5ZFrk+Om8p5s754eMUcyp8I= github.com/cosmos/iavl v1.1.2 h1:zL9FK7C4L/P4IF1Dm5fIwz0WXCnn7Bp1M2FxH0ayM7Y= github.com/cosmos/iavl v1.1.2/go.mod h1:jLeUvm6bGT1YutCaL2fIar/8vGUE8cPZvh/gXEWDaDM= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM=