Skip to content

Commit

Permalink
remove addquery/txcommands
Browse files Browse the repository at this point in the history
  • Loading branch information
Yaroms committed Dec 13, 2024
1 parent 5eb2d82 commit 6b55d8c
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions cmd/lavad/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func NewRootCmd() (*cobra.Command, appparams.EncodingConfig) {
},
}

initRootCmd(rootCmd, encodingConfig, tempApplication.ModuleBasics)
initRootCmd(rootCmd, encodingConfig)
addLogFlagsToSubCommands(rootCmd)

if err := autoCliOpts(initClientCtx, tempApplication).EnhanceRootCommand(rootCmd); err != nil {
Expand Down Expand Up @@ -151,7 +151,7 @@ func NewLavaProtocolRootCmd() *cobra.Command {

tempApplication := app.New(log.NewNopLogger(), dbm.NewMemDB(), nil, true, map[int64]bool{}, app.DefaultNodeHome, 5, encodingConfig, sims.EmptyAppOptions{})

initLavaProtocolRootCmd(rootCmd, tempApplication.ModuleBasics)
initLavaProtocolRootCmd(rootCmd)
addLogFlagsToSubCommands(rootCmd)

if err := autoCliOpts(initClientCtx, tempApplication).EnhanceRootCommand(rootCmd); err != nil {
Expand Down Expand Up @@ -184,15 +184,14 @@ func autoCliOpts(initClientCtx client.Context, tempApp *app.LavaApp) autocli.App

func initLavaProtocolRootCmd(
rootCmd *cobra.Command,
moduleBasics module.BasicManager,
) {
rootCmd.AddCommand(
tmcli.NewCompletionCmd(rootCmd, true),
)

rootCmd.AddCommand(
queryCommand(moduleBasics),
txCommand(moduleBasics),
queryCommand(),
txCommand(),
keys.Commands(),
)

Expand Down Expand Up @@ -233,7 +232,6 @@ func initTendermintConfig() *tmcfg.Config {
func initRootCmd(
rootCmd *cobra.Command,
encodingConfig appparams.EncodingConfig,
moduleBasics module.BasicManager,
) {
gentxModule, ok := app.ModuleBasics[genutiltypes.ModuleName].(genutil.AppModuleBasic)
if !ok {
Expand Down Expand Up @@ -275,8 +273,8 @@ func initRootCmd(
// add keybase, auxiliary RPC, query, and tx child commands
rootCmd.AddCommand(
server.StatusCommand(),
queryCommand(moduleBasics),
txCommand(moduleBasics),
queryCommand(),
txCommand(),
keys.Commands(),
)
}
Expand All @@ -301,7 +299,7 @@ func setLogLevelFieldNameFromFlag(cmd *cobra.Command) error {
}

// queryCommand returns the sub-command to send queries to the app
func queryCommand(moduleBasics module.BasicManager) *cobra.Command {
func queryCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "query",
Aliases: []string{"q"},
Expand All @@ -319,14 +317,13 @@ func queryCommand(moduleBasics module.BasicManager) *cobra.Command {
authcmd.QueryTxCmd(),
)

moduleBasics.AddQueryCommands(cmd)
cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID")

return cmd
}

// txCommand returns the sub-command to send transactions to the app
func txCommand(moduleBasics module.BasicManager) *cobra.Command {
func txCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "tx",
Short: "Transactions subcommands",
Expand All @@ -346,7 +343,6 @@ func txCommand(moduleBasics module.BasicManager) *cobra.Command {
authcmd.GetDecodeCommand(),
)

moduleBasics.AddTxCommands(cmd)
cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID")

return cmd
Expand Down

0 comments on commit 6b55d8c

Please sign in to comment.