Co-authored-by: Facundo Medica <14063057+facundomedica@users.noreply.github.com> Co-authored-by: Julien Robert <julien@rbrt.fr>
This commit is contained in:
parent
56043427c0
commit
1376e0dc3f
48
UPGRADING.md
48
UPGRADING.md
@ -305,6 +305,54 @@ if err := app.RegisterStreamingServices(appOpts, app.kvStoreKeys()); err != nil
|
||||
|
||||
The return type of the interface method `TxConfig.SignModeHandler()` has been changed from `x/auth/signing.SignModeHandler` to `x/tx/signing.HandlerMap`. This change is transparent to most users as the `TxConfig` interface is typically implemented by private `x/auth/tx.config` struct (as returned by `auth.NewTxConfig`) which has been updated to return the new type. If users have implemented their own `TxConfig` interface, they will need to update their implementation to return the new type.
|
||||
|
||||
##### Textual sign mode
|
||||
|
||||
A new sign mode is available in the SDK that produces more human readable output, currently only available on Ledger
|
||||
devices but soon to be implemented in other UIs.
|
||||
|
||||
:::tip
|
||||
This sign mode does not allow offline signing
|
||||
:::
|
||||
|
||||
When using (legacy) application wiring, the following must be added to `app.go` after setting the app's bank keeper:
|
||||
|
||||
```golang
|
||||
enabledSignModes := append(tx.DefaultSignModes, sigtypes.SignMode_SIGN_MODE_TEXTUAL)
|
||||
txConfigOpts := tx.ConfigOptions{
|
||||
EnabledSignModes: enabledSignModes,
|
||||
TextualCoinMetadataQueryFn: txmodule.NewBankKeeperCoinMetadataQueryFn(app.BankKeeper),
|
||||
}
|
||||
txConfig, err := tx.NewTxConfigWithOptions(
|
||||
appCodec,
|
||||
txConfigOpts,
|
||||
)
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to create new TxConfig with options: %v", err)
|
||||
}
|
||||
app.txConfig = txConfig
|
||||
```
|
||||
|
||||
And in the application client (usually `root.go`):
|
||||
|
||||
```golang
|
||||
if !clientCtx.Offline {
|
||||
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)
|
||||
}
|
||||
```
|
||||
|
||||
When using `depinject` / `app v2`, **it's enabled by default** if there's a bank keeper present.
|
||||
|
||||
To learn more see the [docs](https://docs.cosmos.network/main/learn/advanced/transactions#sign_mode_textual) and the [ADR-050](https://docs.cosmos.network/main/build/architecture/adr-050-sign-mode-textual).
|
||||
|
||||
### Modules
|
||||
|
||||
#### `**all**`
|
||||
|
||||
@ -6,6 +6,7 @@ import (
|
||||
|
||||
"github.com/cockroachdb/errors"
|
||||
"github.com/spf13/cobra"
|
||||
"golang.org/x/exp/slices"
|
||||
"google.golang.org/protobuf/proto"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/types/dynamicpb"
|
||||
@ -115,17 +116,19 @@ func (b *Builder) BuildMsgMethodCommand(descriptor protoreflect.MethodDescriptor
|
||||
}
|
||||
|
||||
// enable sign mode textual and config tx options
|
||||
b.TxConfigOpts.EnabledSignModes = append(b.TxConfigOpts.EnabledSignModes, signing.SignMode_SIGN_MODE_TEXTUAL)
|
||||
b.TxConfigOpts.TextualCoinMetadataQueryFn = authtxconfig.NewGRPCCoinMetadataQueryFn(clientCtx)
|
||||
if !clientCtx.Offline && !slices.Contains(b.TxConfigOpts.EnabledSignModes, signing.SignMode_SIGN_MODE_TEXTUAL) {
|
||||
b.TxConfigOpts.EnabledSignModes = append(b.TxConfigOpts.EnabledSignModes, signing.SignMode_SIGN_MODE_TEXTUAL)
|
||||
b.TxConfigOpts.TextualCoinMetadataQueryFn = authtxconfig.NewGRPCCoinMetadataQueryFn(clientCtx)
|
||||
}
|
||||
|
||||
txConfigWithTextual, err := authtx.NewTxConfigWithOptions(
|
||||
txConfig, err := authtx.NewTxConfigWithOptions(
|
||||
codec.NewProtoCodec(clientCtx.InterfaceRegistry),
|
||||
b.TxConfigOpts,
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
clientCtx = clientCtx.WithTxConfig(txConfigWithTextual)
|
||||
clientCtx = clientCtx.WithTxConfig(txConfig)
|
||||
clientCtx.Output = cmd.OutOrStdout()
|
||||
|
||||
// set signer to signer field if empty
|
||||
|
||||
@ -13,6 +13,7 @@ require (
|
||||
github.com/cosmos/gogoproto v1.4.11
|
||||
github.com/spf13/cobra v1.7.0
|
||||
github.com/spf13/pflag v1.0.5
|
||||
golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63
|
||||
google.golang.org/grpc v1.58.3
|
||||
google.golang.org/protobuf v1.31.0
|
||||
gotest.tools/v3 v3.5.1
|
||||
@ -137,7 +138,6 @@ require (
|
||||
github.com/zondax/ledger-go v0.14.3 // indirect
|
||||
go.etcd.io/bbolt v1.3.7 // indirect
|
||||
golang.org/x/crypto v0.14.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 // indirect
|
||||
golang.org/x/net v0.17.0 // indirect
|
||||
golang.org/x/sync v0.3.0 // indirect
|
||||
golang.org/x/sys v0.13.0 // indirect
|
||||
|
||||
@ -94,7 +94,13 @@ create the final transaction by appending a fee. Note that the fee payer of the
|
||||
|
||||
#### `SIGN_MODE_TEXTUAL`
|
||||
|
||||
`SIGN_MODE_TEXTUAL` is a new sign mode for delivering a better signing experience on hardware wallets, it is currently still under implementation. If you wish to learn more, please refer to [ADR-050](https://github.com/cosmos/cosmos-sdk/pull/10701).
|
||||
`SIGN_MODE_TEXTUAL` is a new sign mode for delivering a better signing experience on hardware wallets and it is included in the v0.50 release. In this mode, the signer signs over the human-readable string representation of the transaction (CBOR) and makes all data being displayed easier to read. The data is formatted as screens, and each screen is meant to be displayed in its entirety even on small devices like the Ledger Nano.
|
||||
|
||||
There are also _expert_ screens, which will only be displayed if the user has chosen that option in its hardware device. These screens contain things like account number, account sequence and the sign data hash.
|
||||
|
||||
Data is formatted using a set of `ValueRenderer` which the SDK provides defaults for all the known messages and value types. Chain developers can also opt to implement their own `ValueRenderer` for a type/message if they'd like to display information differently.
|
||||
|
||||
If you wish to learn more, please refer to [ADR-050](../../build/architecture/adr-050-sign-mode-textual.md).
|
||||
|
||||
#### Custom Sign modes
|
||||
|
||||
|
||||
@ -52,6 +52,7 @@ import (
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/types/module"
|
||||
"github.com/cosmos/cosmos-sdk/types/msgservice"
|
||||
sigtypes "github.com/cosmos/cosmos-sdk/types/tx/signing"
|
||||
"github.com/cosmos/cosmos-sdk/version"
|
||||
"github.com/cosmos/cosmos-sdk/x/auth"
|
||||
"github.com/cosmos/cosmos-sdk/x/auth/ante"
|
||||
@ -61,6 +62,7 @@ import (
|
||||
authsims "github.com/cosmos/cosmos-sdk/x/auth/simulation"
|
||||
"github.com/cosmos/cosmos-sdk/x/auth/tx"
|
||||
authtx "github.com/cosmos/cosmos-sdk/x/auth/tx"
|
||||
txmodule "github.com/cosmos/cosmos-sdk/x/auth/tx/config"
|
||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/auth/vesting"
|
||||
vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"
|
||||
@ -146,7 +148,7 @@ type SimApp struct {
|
||||
|
||||
// keepers
|
||||
AccountKeeper authkeeper.AccountKeeper
|
||||
BankKeeper bankkeeper.Keeper
|
||||
BankKeeper bankkeeper.BaseKeeper
|
||||
StakingKeeper *stakingkeeper.Keeper
|
||||
SlashingKeeper slashingkeeper.Keeper
|
||||
MintKeeper mintkeeper.Keeper
|
||||
@ -290,6 +292,22 @@ func NewSimApp(
|
||||
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
|
||||
logger,
|
||||
)
|
||||
|
||||
// optional: enable sign mode textual by overwriting the default tx config (after setting the bank keeper)
|
||||
enabledSignModes := append(tx.DefaultSignModes, sigtypes.SignMode_SIGN_MODE_TEXTUAL)
|
||||
txConfigOpts := tx.ConfigOptions{
|
||||
EnabledSignModes: enabledSignModes,
|
||||
TextualCoinMetadataQueryFn: txmodule.NewBankKeeperCoinMetadataQueryFn(app.BankKeeper),
|
||||
}
|
||||
txConfig, err := tx.NewTxConfigWithOptions(
|
||||
appCodec,
|
||||
txConfigOpts,
|
||||
)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
app.txConfig = txConfig
|
||||
|
||||
app.StakingKeeper = stakingkeeper.NewKeeper(
|
||||
appCodec, runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), app.AccountKeeper, app.BankKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(), authcodec.NewBech32Codec(sdk.Bech32PrefixValAddr), authcodec.NewBech32Codec(sdk.Bech32PrefixConsAddr),
|
||||
)
|
||||
@ -463,7 +481,7 @@ func NewSimApp(
|
||||
|
||||
app.ModuleManager.RegisterInvariants(app.CrisisKeeper)
|
||||
app.configurator = module.NewConfigurator(app.appCodec, app.MsgServiceRouter(), app.GRPCQueryRouter())
|
||||
err := app.ModuleManager.RegisterServices(app.configurator)
|
||||
err = app.ModuleManager.RegisterServices(app.configurator)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
@ -4,20 +4,20 @@ go 1.21
|
||||
|
||||
require (
|
||||
cosmossdk.io/api v0.7.2
|
||||
cosmossdk.io/client/v2 v2.0.0-20231009141709-5e209c3c0fce
|
||||
cosmossdk.io/client/v2 v2.0.0-20231023154906-f2188065a4f6
|
||||
cosmossdk.io/collections v0.4.0 // indirect
|
||||
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.3-rc.1
|
||||
cosmossdk.io/store v1.0.0-rc.0
|
||||
cosmossdk.io/tools/confix v0.0.0-20230925151519-64e0e8980834
|
||||
cosmossdk.io/x/circuit v0.0.0-20231006095526-33390754f9fe
|
||||
cosmossdk.io/x/evidence v0.0.0-20230925151519-64e0e8980834
|
||||
cosmossdk.io/x/feegrant v0.0.0-20231020161330-8acf4f8853ca
|
||||
cosmossdk.io/x/nft v0.0.0-20231006095526-33390754f9fe
|
||||
cosmossdk.io/tools/confix v0.0.0-20231023160833-026631cd833c
|
||||
cosmossdk.io/x/circuit v0.0.0-20231023160833-026631cd833c
|
||||
cosmossdk.io/x/evidence v0.0.0-20231023160833-026631cd833c
|
||||
cosmossdk.io/x/feegrant v0.0.0-20231023160833-026631cd833c
|
||||
cosmossdk.io/x/nft v0.0.0-20231023160833-026631cd833c
|
||||
cosmossdk.io/x/tx v0.11.0
|
||||
cosmossdk.io/x/upgrade v0.0.0-20230925151519-64e0e8980834
|
||||
cosmossdk.io/x/upgrade v0.0.0-20231023160833-026631cd833c
|
||||
github.com/cometbft/cometbft v0.38.0
|
||||
github.com/cosmos/cosmos-db v1.0.0
|
||||
// this version is not used as it is always replaced by the latest Cosmos SDK version
|
||||
|
||||
@ -189,8 +189,8 @@ cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1V
|
||||
cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M=
|
||||
cosmossdk.io/api v0.7.2 h1:BO3i5fvKMKvfaUiMkCznxViuBEfyWA/k6w2eAF6q1C4=
|
||||
cosmossdk.io/api v0.7.2/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38=
|
||||
cosmossdk.io/client/v2 v2.0.0-20231009141709-5e209c3c0fce h1:k3Yk/99Tg4IY0KictwPBYwZSuK6uyqrw6YoJStD3C9o=
|
||||
cosmossdk.io/client/v2 v2.0.0-20231009141709-5e209c3c0fce/go.mod h1:VqOuMtieftq2OaX7WhRXjG0mhFih4qzw5JT8fyNlVuE=
|
||||
cosmossdk.io/client/v2 v2.0.0-20231023154906-f2188065a4f6 h1:evrZZyxskWybzhgUprCi6B6r+1Uyrv0t1JDTdtuY7js=
|
||||
cosmossdk.io/client/v2 v2.0.0-20231023154906-f2188065a4f6/go.mod h1:m8opgTNq+LeP5fcOGaixkRPTN5oMr5lrJNtnu7ldxbY=
|
||||
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=
|
||||
@ -205,20 +205,20 @@ cosmossdk.io/math v1.1.3-rc.1 h1:NebCNWDqb1MJRNfvxr4YY7d8FSYgkuB3L75K6xvM+Zo=
|
||||
cosmossdk.io/math v1.1.3-rc.1/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/tools/confix v0.0.0-20230925151519-64e0e8980834 h1:lOHFhmSC6phBBVeE/TbtV2MV7nDwclPnXdBEZsOEf3k=
|
||||
cosmossdk.io/tools/confix v0.0.0-20230925151519-64e0e8980834/go.mod h1:sJU9iqlZxilbg1Ik63S03QTZIYZZ9V+Uok/lu4px3XY=
|
||||
cosmossdk.io/x/circuit v0.0.0-20231006095526-33390754f9fe h1:xcQTAlbv1l8PBHXI5/xv7AQLUe/tBvewH6JR2Zt1F4g=
|
||||
cosmossdk.io/x/circuit v0.0.0-20231006095526-33390754f9fe/go.mod h1:syo6njNlaE1KLXRFd1gZQr/7pMstANp2zMqVUC+u4h4=
|
||||
cosmossdk.io/x/evidence v0.0.0-20230925151519-64e0e8980834 h1:h4ooSV3X5BxEfl3EUbOlXNFMnEc/mXTXF5mdl17CQLg=
|
||||
cosmossdk.io/x/evidence v0.0.0-20230925151519-64e0e8980834/go.mod h1:yUgv71a56ZEJu7c8BXWCliDrQ7Ag+FCZ//rYKw9S93U=
|
||||
cosmossdk.io/x/feegrant v0.0.0-20231020161330-8acf4f8853ca h1:YuagGZRMuE6lg913jEVGHTf6b4cWjt+gJdnhTmFQ1LA=
|
||||
cosmossdk.io/x/feegrant v0.0.0-20231020161330-8acf4f8853ca/go.mod h1:vmiW+2cIfGZULh6ReN03sawbhn8UUGrttNMxiIiduKI=
|
||||
cosmossdk.io/x/nft v0.0.0-20231006095526-33390754f9fe h1:xDWsbJp/9Tdwh2w8/KT7E0sxb52ASTn1M+UO4pq6kko=
|
||||
cosmossdk.io/x/nft v0.0.0-20231006095526-33390754f9fe/go.mod h1:QQROAXjZWeJzH6dNHUNCPhs7zHrYjknH8gYynf0IvXs=
|
||||
cosmossdk.io/tools/confix v0.0.0-20231023160833-026631cd833c h1:IFIZ0qFpM+EGbdwpNcUtK8NCCS/HWWxSh9C/5WMlco0=
|
||||
cosmossdk.io/tools/confix v0.0.0-20231023160833-026631cd833c/go.mod h1:Dq174Qyh5wJaJtsyoQOKeDWFBF7i95b7fRAYokzMYmo=
|
||||
cosmossdk.io/x/circuit v0.0.0-20231023160833-026631cd833c h1:rmOHiuzDW3Er00Mg++jxr+YZox05x9SP+jbM38se0MA=
|
||||
cosmossdk.io/x/circuit v0.0.0-20231023160833-026631cd833c/go.mod h1:xqLjv08l2XgIZLOuNUQpdxSeggQXopbq1PV6ZfHOyOE=
|
||||
cosmossdk.io/x/evidence v0.0.0-20231023160833-026631cd833c h1:k0U55yMjTLWfs+wT1Ffnj7lahS8FSGTjqXL2Zke0oF8=
|
||||
cosmossdk.io/x/evidence v0.0.0-20231023160833-026631cd833c/go.mod h1:N//0zHq1MoGysusHeZC/LmH0Lw3u55QR/mUr5UMzCSw=
|
||||
cosmossdk.io/x/feegrant v0.0.0-20231023160833-026631cd833c h1:1DEtQYVuCI9hA5nCJSkN6PJooi7kdBiZc2sFbzMcuXY=
|
||||
cosmossdk.io/x/feegrant v0.0.0-20231023160833-026631cd833c/go.mod h1:vmiW+2cIfGZULh6ReN03sawbhn8UUGrttNMxiIiduKI=
|
||||
cosmossdk.io/x/nft v0.0.0-20231023160833-026631cd833c h1:EFBlwazEIqkvKV5L1JfQZ6lhUJF9cMguAqQk1xSmbfM=
|
||||
cosmossdk.io/x/nft v0.0.0-20231023160833-026631cd833c/go.mod h1:PELWSey8Y7pq8iSgqEav82APBbgMb/SDbbjyuP8tvWc=
|
||||
cosmossdk.io/x/tx v0.11.0 h1:Ak2LIC06bXqPbpMIEorkQbwVddRvRys1sL3Cjm+KPfs=
|
||||
cosmossdk.io/x/tx v0.11.0/go.mod h1:tzuC7JlfGivYuIO32JbvvY3Ft9s6FK1+r0/nGHiHwtM=
|
||||
cosmossdk.io/x/upgrade v0.0.0-20230925151519-64e0e8980834 h1:M/yPP4g31SSgYEku5d5Xk+UGkjp47RKXFk1bYGnWJdY=
|
||||
cosmossdk.io/x/upgrade v0.0.0-20230925151519-64e0e8980834/go.mod h1:+5jCm6Lk/CrQhQvtJFy/tmuLfhQKNMn/U0vwrRz/dxQ=
|
||||
cosmossdk.io/x/upgrade v0.0.0-20231023160833-026631cd833c h1:wqlSXbvd3SEX4cDJWamiARHtZHZxOzneJNNaSzHwwkw=
|
||||
cosmossdk.io/x/upgrade v0.0.0-20231023160833-026631cd833c/go.mod h1:OGcabvCst54+IOZQodvOAbAxEhhlhk6mvGQV8zRh7wI=
|
||||
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=
|
||||
|
||||
@ -13,7 +13,6 @@ import (
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/client/config"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
"github.com/cosmos/cosmos-sdk/crypto/keyring"
|
||||
"github.com/cosmos/cosmos-sdk/server"
|
||||
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
|
||||
@ -67,20 +66,24 @@ func NewRootCmd() *cobra.Command {
|
||||
}
|
||||
|
||||
// This needs to go after ReadFromClientConfig, as that function
|
||||
// sets the RPC client needed for SIGN_MODE_TEXTUAL.
|
||||
enabledSignModes := append(tx.DefaultSignModes, signing.SignMode_SIGN_MODE_TEXTUAL)
|
||||
txConfigOpts := tx.ConfigOptions{
|
||||
EnabledSignModes: enabledSignModes,
|
||||
TextualCoinMetadataQueryFn: txmodule.NewGRPCCoinMetadataQueryFn(initClientCtx),
|
||||
// sets the RPC client needed for SIGN_MODE_TEXTUAL. This sign mode
|
||||
// is only available if the client is online.
|
||||
if !initClientCtx.Offline {
|
||||
enabledSignModes := append(tx.DefaultSignModes, signing.SignMode_SIGN_MODE_TEXTUAL)
|
||||
txConfigOpts := tx.ConfigOptions{
|
||||
EnabledSignModes: enabledSignModes,
|
||||
TextualCoinMetadataQueryFn: txmodule.NewGRPCCoinMetadataQueryFn(initClientCtx),
|
||||
}
|
||||
txConfig, err := tx.NewTxConfigWithOptions(
|
||||
initClientCtx.Codec,
|
||||
txConfigOpts,
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
initClientCtx = initClientCtx.WithTxConfig(txConfig)
|
||||
}
|
||||
txConfigWithTextual, err := tx.NewTxConfigWithOptions(
|
||||
codec.NewProtoCodec(encodingConfig.InterfaceRegistry),
|
||||
txConfigOpts,
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
initClientCtx = initClientCtx.WithTxConfig(txConfigWithTextual)
|
||||
|
||||
if err := client.SetCmdClientContextHandler(initClientCtx, cmd); err != nil {
|
||||
return err
|
||||
|
||||
@ -22,9 +22,7 @@ import (
|
||||
"github.com/cosmos/cosmos-sdk/server"
|
||||
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
|
||||
"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"
|
||||
"github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
)
|
||||
|
||||
@ -76,17 +74,6 @@ func NewRootCmd() *cobra.Command {
|
||||
return err
|
||||
}
|
||||
|
||||
// This needs to go after CreateClientConfig, as that function sets 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
|
||||
}
|
||||
|
||||
12
tests/go.mod
12
tests/go.mod
@ -11,11 +11,11 @@ require (
|
||||
cosmossdk.io/math v1.1.3-rc.1
|
||||
cosmossdk.io/simapp v0.0.0-20230620040119-e078f1a49e8b
|
||||
cosmossdk.io/store v1.0.0-rc.0
|
||||
cosmossdk.io/x/evidence v0.0.0-20230925151519-64e0e8980834
|
||||
cosmossdk.io/x/feegrant v0.0.0-20231020161330-8acf4f8853ca
|
||||
cosmossdk.io/x/nft v0.0.0-20231006095526-33390754f9fe // indirect
|
||||
cosmossdk.io/x/evidence v0.0.0-20231023160833-026631cd833c
|
||||
cosmossdk.io/x/feegrant v0.0.0-20231023160833-026631cd833c
|
||||
cosmossdk.io/x/nft v0.0.0-20231023160833-026631cd833c // indirect
|
||||
cosmossdk.io/x/tx v0.11.0
|
||||
cosmossdk.io/x/upgrade v0.0.0-20230925151519-64e0e8980834
|
||||
cosmossdk.io/x/upgrade v0.0.0-20231023160833-026631cd833c
|
||||
github.com/cometbft/cometbft v0.38.0
|
||||
github.com/cosmos/cosmos-db v1.0.0
|
||||
github.com/cosmos/cosmos-proto v1.0.0-beta.3
|
||||
@ -37,9 +37,9 @@ require (
|
||||
cloud.google.com/go/compute/metadata v0.2.3 // indirect
|
||||
cloud.google.com/go/iam v1.1.2 // indirect
|
||||
cloud.google.com/go/storage v1.30.1 // indirect
|
||||
cosmossdk.io/client/v2 v2.0.0-20231009141709-5e209c3c0fce // indirect
|
||||
cosmossdk.io/client/v2 v2.0.0-20231023154906-f2188065a4f6 // indirect
|
||||
cosmossdk.io/collections v0.4.0 // indirect
|
||||
cosmossdk.io/x/circuit v0.0.0-20231006095526-33390754f9fe // indirect
|
||||
cosmossdk.io/x/circuit v0.0.0-20231023160833-026631cd833c // 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
|
||||
|
||||
24
tests/go.sum
24
tests/go.sum
@ -189,8 +189,8 @@ cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1V
|
||||
cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M=
|
||||
cosmossdk.io/api v0.7.2 h1:BO3i5fvKMKvfaUiMkCznxViuBEfyWA/k6w2eAF6q1C4=
|
||||
cosmossdk.io/api v0.7.2/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38=
|
||||
cosmossdk.io/client/v2 v2.0.0-20231009141709-5e209c3c0fce h1:k3Yk/99Tg4IY0KictwPBYwZSuK6uyqrw6YoJStD3C9o=
|
||||
cosmossdk.io/client/v2 v2.0.0-20231009141709-5e209c3c0fce/go.mod h1:VqOuMtieftq2OaX7WhRXjG0mhFih4qzw5JT8fyNlVuE=
|
||||
cosmossdk.io/client/v2 v2.0.0-20231023154906-f2188065a4f6 h1:evrZZyxskWybzhgUprCi6B6r+1Uyrv0t1JDTdtuY7js=
|
||||
cosmossdk.io/client/v2 v2.0.0-20231023154906-f2188065a4f6/go.mod h1:m8opgTNq+LeP5fcOGaixkRPTN5oMr5lrJNtnu7ldxbY=
|
||||
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=
|
||||
@ -205,18 +205,18 @@ cosmossdk.io/math v1.1.3-rc.1 h1:NebCNWDqb1MJRNfvxr4YY7d8FSYgkuB3L75K6xvM+Zo=
|
||||
cosmossdk.io/math v1.1.3-rc.1/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/circuit v0.0.0-20231006095526-33390754f9fe h1:xcQTAlbv1l8PBHXI5/xv7AQLUe/tBvewH6JR2Zt1F4g=
|
||||
cosmossdk.io/x/circuit v0.0.0-20231006095526-33390754f9fe/go.mod h1:syo6njNlaE1KLXRFd1gZQr/7pMstANp2zMqVUC+u4h4=
|
||||
cosmossdk.io/x/evidence v0.0.0-20230925151519-64e0e8980834 h1:h4ooSV3X5BxEfl3EUbOlXNFMnEc/mXTXF5mdl17CQLg=
|
||||
cosmossdk.io/x/evidence v0.0.0-20230925151519-64e0e8980834/go.mod h1:yUgv71a56ZEJu7c8BXWCliDrQ7Ag+FCZ//rYKw9S93U=
|
||||
cosmossdk.io/x/feegrant v0.0.0-20231020161330-8acf4f8853ca h1:YuagGZRMuE6lg913jEVGHTf6b4cWjt+gJdnhTmFQ1LA=
|
||||
cosmossdk.io/x/feegrant v0.0.0-20231020161330-8acf4f8853ca/go.mod h1:vmiW+2cIfGZULh6ReN03sawbhn8UUGrttNMxiIiduKI=
|
||||
cosmossdk.io/x/nft v0.0.0-20231006095526-33390754f9fe h1:xDWsbJp/9Tdwh2w8/KT7E0sxb52ASTn1M+UO4pq6kko=
|
||||
cosmossdk.io/x/nft v0.0.0-20231006095526-33390754f9fe/go.mod h1:QQROAXjZWeJzH6dNHUNCPhs7zHrYjknH8gYynf0IvXs=
|
||||
cosmossdk.io/x/circuit v0.0.0-20231023160833-026631cd833c h1:rmOHiuzDW3Er00Mg++jxr+YZox05x9SP+jbM38se0MA=
|
||||
cosmossdk.io/x/circuit v0.0.0-20231023160833-026631cd833c/go.mod h1:xqLjv08l2XgIZLOuNUQpdxSeggQXopbq1PV6ZfHOyOE=
|
||||
cosmossdk.io/x/evidence v0.0.0-20231023160833-026631cd833c h1:k0U55yMjTLWfs+wT1Ffnj7lahS8FSGTjqXL2Zke0oF8=
|
||||
cosmossdk.io/x/evidence v0.0.0-20231023160833-026631cd833c/go.mod h1:N//0zHq1MoGysusHeZC/LmH0Lw3u55QR/mUr5UMzCSw=
|
||||
cosmossdk.io/x/feegrant v0.0.0-20231023160833-026631cd833c h1:1DEtQYVuCI9hA5nCJSkN6PJooi7kdBiZc2sFbzMcuXY=
|
||||
cosmossdk.io/x/feegrant v0.0.0-20231023160833-026631cd833c/go.mod h1:vmiW+2cIfGZULh6ReN03sawbhn8UUGrttNMxiIiduKI=
|
||||
cosmossdk.io/x/nft v0.0.0-20231023160833-026631cd833c h1:EFBlwazEIqkvKV5L1JfQZ6lhUJF9cMguAqQk1xSmbfM=
|
||||
cosmossdk.io/x/nft v0.0.0-20231023160833-026631cd833c/go.mod h1:PELWSey8Y7pq8iSgqEav82APBbgMb/SDbbjyuP8tvWc=
|
||||
cosmossdk.io/x/tx v0.11.0 h1:Ak2LIC06bXqPbpMIEorkQbwVddRvRys1sL3Cjm+KPfs=
|
||||
cosmossdk.io/x/tx v0.11.0/go.mod h1:tzuC7JlfGivYuIO32JbvvY3Ft9s6FK1+r0/nGHiHwtM=
|
||||
cosmossdk.io/x/upgrade v0.0.0-20230925151519-64e0e8980834 h1:M/yPP4g31SSgYEku5d5Xk+UGkjp47RKXFk1bYGnWJdY=
|
||||
cosmossdk.io/x/upgrade v0.0.0-20230925151519-64e0e8980834/go.mod h1:+5jCm6Lk/CrQhQvtJFy/tmuLfhQKNMn/U0vwrRz/dxQ=
|
||||
cosmossdk.io/x/upgrade v0.0.0-20231023160833-026631cd833c h1:wqlSXbvd3SEX4cDJWamiARHtZHZxOzneJNNaSzHwwkw=
|
||||
cosmossdk.io/x/upgrade v0.0.0-20231023160833-026631cd833c/go.mod h1:OGcabvCst54+IOZQodvOAbAxEhhlhk6mvGQV8zRh7wI=
|
||||
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=
|
||||
|
||||
Loading…
Reference in New Issue
Block a user