Skip to content

Commit

Permalink
enable sign mode textual
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt committed Aug 2, 2023
1 parent b53ef0b commit 48749cb
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions cmd/minid/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ import (
servertypes "github.com/cosmos/cosmos-sdk/server/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/cosmos/cosmos-sdk/types/tx/signing"
authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli"
"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"
"github.com/cosmos/cosmos-sdk/x/crisis"
genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli"
Expand Down Expand Up @@ -89,6 +92,25 @@ func NewRootCmd() *cobra.Command {
return err
}

// 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)
txConfigWithTextual, err := tx.NewTxConfigWithOptions(
codec.NewProtoCodec(interfaceRegistry),
tx.ConfigOptions{
EnabledSignModes: enabledSignModes,
TextualCoinMetadataQueryFn: txmodule.NewGRPCCoinMetadataQueryFn(initClientCtx),
},
)
if err != nil {
return err
}

initClientCtx = initClientCtx.WithTxConfig(txConfigWithTextual)
if err := client.SetCmdClientContextHandler(initClientCtx, cmd); err != nil {
return err
}

if err := client.SetCmdClientContextHandler(initClientCtx, cmd); err != nil {
return err
}
Expand Down

0 comments on commit 48749cb

Please sign in to comment.