@@ -2,7 +2,6 @@ package cmd
22
33import (
44 "context"
5- "os"
65
76 "github.com/cosmos/cosmos-sdk/x/crisis"
87 "github.com/rs/zerolog"
@@ -18,7 +17,6 @@ import (
1817 "github.com/cosmos/cosmos-sdk/client/pruning"
1918 "github.com/cosmos/cosmos-sdk/client/snapshot"
2019 sdkserver "github.com/cosmos/cosmos-sdk/server"
21- authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
2220 banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
2321 rosettaCmd "github.com/cosmos/rosetta/cmd"
2422
@@ -27,7 +25,6 @@ import (
2725
2826 "pkg.akt.dev/node/app"
2927 "pkg.akt.dev/node/cmd/akash/cmd/testnetify"
30- utilcli "pkg.akt.dev/node/util/cli"
3128)
3229
3330// NewRootCmd creates a new root command for akash. It is called once in the
@@ -41,39 +38,14 @@ func NewRootCmd() (*cobra.Command, sdkutil.EncodingConfig) {
4138 Short : "Akash Blockchain Application" ,
4239 Long : "Akash CLI Utility.\n \n Akash is a peer-to-peer marketplace for computing resources and \n a deployment platform for heavily distributed applications. \n Find out more at https://akash.network" ,
4340 SilenceUsage : true ,
44- PersistentPreRunE : GetPersistentPreRunE (encodingConfig , []string {"AKASH" }),
41+ PersistentPreRunE : cli . GetPersistentPreRunE (encodingConfig , []string {"AKASH" }, cli . DefaultHome ),
4542 }
4643
4744 initRootCmd (rootCmd , encodingConfig )
4845
4946 return rootCmd , encodingConfig
5047}
5148
52- // GetPersistentPreRunE persistent prerun hook for root command
53- func GetPersistentPreRunE (encodingConfig sdkutil.EncodingConfig , envPrefixes []string ) func (* cobra.Command , []string ) error {
54- return func (cmd * cobra.Command , _ []string ) error {
55- if err := utilcli .InterceptConfigsPreRunHandler (cmd , envPrefixes , false , "" , nil ); err != nil {
56- return err
57- }
58-
59- initClientCtx := sdkclient.Context {}.
60- WithCodec (encodingConfig .Codec ).
61- WithInterfaceRegistry (encodingConfig .InterfaceRegistry ).
62- WithTxConfig (encodingConfig .TxConfig ).
63- WithLegacyAmino (encodingConfig .Amino ).
64- WithInput (os .Stdin ).
65- WithAccountRetriever (authtypes.AccountRetriever {}).
66- WithBroadcastMode (cflags .BroadcastBlock ).
67- WithHomeDir (app .DefaultHome )
68-
69- if err := sdkclient .SetCmdClientContextHandler (initClientCtx , cmd ); err != nil {
70- return err
71- }
72-
73- return nil
74- }
75- }
76-
7749// Execute executes the root command.
7850func Execute (rootCmd * cobra.Command , envPrefix string ) error {
7951 // Create and set a client.Context on the command's Context. During the pre-run
0 commit comments