@@ -37,7 +37,6 @@ import (
37
37
"github.com/cosmos/cosmos-sdk/codec"
38
38
addresscodec "github.com/cosmos/cosmos-sdk/codec/address"
39
39
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
40
- "github.com/cosmos/cosmos-sdk/crypto/keyring"
41
40
"github.com/cosmos/cosmos-sdk/server"
42
41
serverconfig "github.com/cosmos/cosmos-sdk/server/config"
43
42
servertypes "github.com/cosmos/cosmos-sdk/server/types"
@@ -46,7 +45,7 @@ import (
46
45
"github.com/cosmos/cosmos-sdk/types/tx/signing"
47
46
authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli"
48
47
"github.com/cosmos/cosmos-sdk/x/auth/tx"
49
- txmodule "github.com/cosmos/cosmos-sdk/x/auth/tx/config"
48
+ authtxconfig "github.com/cosmos/cosmos-sdk/x/auth/tx/config"
50
49
"github.com/cosmos/cosmos-sdk/x/auth/types"
51
50
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
52
51
"github.com/cosmos/cosmos-sdk/x/crisis"
@@ -86,7 +85,6 @@ func NewRootCmd() *cobra.Command {
86
85
initClientCtx := client.Context {}.
87
86
WithCodec (tempApplication .AppCodec ()).
88
87
WithInterfaceRegistry (tempApplication .InterfaceRegistry ()).
89
- WithTxConfig (tempApplication .GetTxConfig ()).
90
88
WithLegacyAmino (tempApplication .LegacyAmino ()).
91
89
WithInput (os .Stdin ).
92
90
WithAccountRetriever (types.AccountRetriever {}).
@@ -117,10 +115,10 @@ func NewRootCmd() *cobra.Command {
117
115
if ! initClientCtx .Offline {
118
116
txConfigOpts := tx.ConfigOptions {
119
117
EnabledSignModes : append (tx .DefaultSignModes , signing .SignMode_SIGN_MODE_TEXTUAL ),
120
- TextualCoinMetadataQueryFn : txmodule .NewGRPCCoinMetadataQueryFn (initClientCtx ),
118
+ TextualCoinMetadataQueryFn : authtxconfig .NewGRPCCoinMetadataQueryFn (initClientCtx ),
121
119
}
122
120
txConfigWithTextual , err := tx .NewTxConfigWithOptions (
123
- codec . NewProtoCodec ( tempApplication . InterfaceRegistry ()) ,
121
+ initClientCtx . Codec ,
124
122
txConfigOpts ,
125
123
)
126
124
if err != nil {
@@ -142,36 +140,22 @@ func NewRootCmd() *cobra.Command {
142
140
143
141
initRootCmd (rootCmd , tempApplication .ModuleBasics , tempApplication .AppCodec (), tempApplication .InterfaceRegistry (), tempApplication .GetTxConfig ())
144
142
145
- autoCliOpts , err := enrichAutoCliOpts (tempApplication .AutoCliOpts (), initClientCtx )
146
- if err != nil {
147
- panic (err )
148
- }
149
-
143
+ autoCliOpts := enrichAutoCliOpts (tempApplication .AutoCliOpts (), initClientCtx )
150
144
if err := autoCliOpts .EnhanceRootCommand (rootCmd ); err != nil {
151
145
panic (err )
152
146
}
153
147
154
148
return rootCmd
155
149
}
156
150
157
- func enrichAutoCliOpts (autoCliOpts autocli.AppOptions , clientCtx client.Context ) ( autocli.AppOptions , error ) {
151
+ func enrichAutoCliOpts (autoCliOpts autocli.AppOptions , clientCtx client.Context ) autocli.AppOptions {
158
152
autoCliOpts .AddressCodec = addresscodec .NewBech32Codec (sdk .GetConfig ().GetBech32AccountAddrPrefix ())
159
153
autoCliOpts .ValidatorAddressCodec = addresscodec .NewBech32Codec (sdk .GetConfig ().GetBech32ValidatorAddrPrefix ())
160
154
autoCliOpts .ConsensusAddressCodec = addresscodec .NewBech32Codec (sdk .GetConfig ().GetBech32ConsensusAddrPrefix ())
161
155
162
- var err error
163
- clientCtx , err = config .ReadFromClientConfig (clientCtx )
164
- if err != nil {
165
- return autocli.AppOptions {}, err
166
- }
167
-
168
156
autoCliOpts .ClientCtx = clientCtx
169
- autoCliOpts .Keyring , err = keyring .NewAutoCLIKeyring (clientCtx .Keyring )
170
- if err != nil {
171
- return autocli.AppOptions {}, err
172
- }
173
157
174
- return autoCliOpts , nil
158
+ return autoCliOpts
175
159
}
176
160
177
161
// initCometConfig helps to override default CometBFT Config values.
0 commit comments