@@ -48,7 +48,7 @@ const (
48
48
func NewRootCmd () (rootCMD * cobra.Command , params params.EncodingConfig ) {
49
49
tempApp := app .NewOdinApp (log .NewNopLogger (), dbm .NewMemDB (), nil , true , map [int64 ]bool {}, simtestutil.EmptyAppOptions {}, 100 )
50
50
encodingConfig := app .MakeEncodingConfig ()
51
-
51
+
52
52
initClientCtx := client.Context {}.
53
53
WithCodec (encodingConfig .Marshaler ).
54
54
WithInterfaceRegistry (encodingConfig .InterfaceRegistry ).
@@ -58,23 +58,14 @@ func NewRootCmd() (rootCMD *cobra.Command, params params.EncodingConfig) {
58
58
WithAccountRetriever (types.AccountRetriever {}).
59
59
WithHomeDir (app .DefaultNodeHome ).
60
60
WithViper ("ODIN" )
61
-
61
+
62
62
rootCmd := & cobra.Command {
63
63
Use : "odind" ,
64
64
Short : "OdinChain App" ,
65
65
PersistentPreRunE : func (cmd * cobra.Command , _ []string ) error {
66
66
// set the default command outputs
67
67
cmd .SetOut (cmd .OutOrStdout ())
68
68
cmd .SetErr (cmd .ErrOrStderr ())
69
-
70
- // If default keyring flag is not set, set it to file
71
- if ! cmd .Flags ().Changed (flags .FlagKeyringBackend ) {
72
- cmd .Flags ().Set (flags .FlagKeyringBackend , keyring .BackendFile )
73
- }
74
- // If default FlagKeyringDir is not set, set it to homedir
75
- if ! cmd .Flags ().Changed (flags .FlagKeyringDir ) {
76
- cmd .Flags ().Set (flags .FlagKeyringDir , app .DefaultNodeHome )
77
- }
78
69
79
70
initClientCtx , err := client .ReadPersistentCommandFlags (initClientCtx , cmd .Flags ())
80
71
if err != nil {
@@ -101,7 +92,7 @@ func NewRootCmd() (rootCMD *cobra.Command, params params.EncodingConfig) {
101
92
102
93
initClientCtx = initClientCtx .WithTxConfig (txConfig )
103
94
}
104
-
95
+
105
96
if err := client .SetCmdClientContextHandler (initClientCtx , cmd ); err != nil {
106
97
return err
107
98
}
@@ -113,17 +104,17 @@ func NewRootCmd() (rootCMD *cobra.Command, params params.EncodingConfig) {
113
104
}
114
105
115
106
initRootCmd (rootCmd , encodingConfig , tempApp .BasicModuleManager )
116
-
107
+
117
108
autoCliOpts := tempApp .AutoCliOpts ()
118
109
initClientCtx , _ = config .ReadDefaultValuesFromDefaultClientConfig (initClientCtx )
119
110
120
111
autoCliOpts .ClientCtx = initClientCtx
121
112
autoCliOpts .Keyring , _ = keyring .NewAutoCLIKeyring (initClientCtx .Keyring )
122
- autoCliOpts .ClientCtx .KeyringDir = ""
123
-
113
+ autoCliOpts .ClientCtx .KeyringDir = ""
114
+
124
115
// TODO!: Add Textual signing mode to app.go
125
116
enabledSignModes := append (tx .DefaultSignModes , signing .SignMode_SIGN_MODE_TEXTUAL )
126
- autoCliOpts .TxConfigOpts = tx.ConfigOptions {
117
+ autoCliOpts .TxConfigOpts = tx.ConfigOptions {
127
118
EnabledSignModes : enabledSignModes ,
128
119
TextualCoinMetadataQueryFn : authtxconfig .NewGRPCCoinMetadataQueryFn (initClientCtx ),
129
120
}
@@ -293,4 +284,4 @@ func appExport(
293
284
}
294
285
295
286
return odinApp .ExportAppStateAndValidators (forZeroHeight , jailAllowedAddrs , modulesToExport )
296
- }
287
+ }
0 commit comments