Skip to content

Commit

Permalink
review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
atheeshp committed Feb 16, 2024
1 parent 3550dfc commit f373afc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
21 changes: 10 additions & 11 deletions cmd/cheqd-noded/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"os"

"github.com/cheqd/cheqd-node/app"
"github.com/cheqd/cheqd-node/app/params"
appparams "github.com/cheqd/cheqd-node/app/params"
dbm "github.com/cometbft/cometbft-db"
tmconfig "github.com/cometbft/cometbft/config"
tmcli "github.com/cometbft/cometbft/libs/cli"
Expand All @@ -15,7 +15,9 @@ import (
"github.com/cosmos/cosmos-sdk/client/debug"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/client/keys"
"github.com/cosmos/cosmos-sdk/client/pruning"
"github.com/cosmos/cosmos-sdk/client/rpc"
"github.com/cosmos/cosmos-sdk/client/snapshot"
"github.com/cosmos/cosmos-sdk/server"
serverconfig "github.com/cosmos/cosmos-sdk/server/config"
servertypes "github.com/cosmos/cosmos-sdk/server/types"
Expand All @@ -33,7 +35,7 @@ var ChainID = "cheqd-mainnet-1"

// NewRootCmd creates a new root command for simd. It is called once in the
// main function.
func NewRootCmd() (*cobra.Command, params.EncodingConfig) {
func NewRootCmd() (*cobra.Command, appparams.EncodingConfig) {
// Set config for prefixes
app.SetConfig()

Expand Down Expand Up @@ -76,7 +78,7 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) {
return rootCmd, encodingConfig
}

func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) {
func initRootCmd(rootCmd *cobra.Command, encodingConfig appparams.EncodingConfig) {
cfg := sdk.GetConfig()
cfg.Seal()

Expand All @@ -86,8 +88,7 @@ func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) {
extendDebug(debug.Cmd()),
)

a := appCreator{encodingConfig}
server.AddCommands(rootCmd, app.DefaultNodeHome, a.newApp, appExport, addModuleInitFlags)
server.AddCommands(rootCmd, app.DefaultNodeHome, newApp, appExport, addModuleInitFlags)

// add keybase, auxiliary RPC, query, and tx child commands
rootCmd.AddCommand(
Expand All @@ -96,12 +97,14 @@ func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) {
queryCommand(),
txCommand(),
keys.Commands(app.DefaultNodeHome),
pruning.Cmd(newApp, app.DefaultNodeHome),
snapshot.Cmd(newApp),
)
}

// genesisCommand builds genesis-related `universus genesis` command.
// Users may provide application specific commands as a parameter
func genesisCommand(encodingConfig params.EncodingConfig, cmds ...*cobra.Command) *cobra.Command {
func genesisCommand(encodingConfig appparams.EncodingConfig, cmds ...*cobra.Command) *cobra.Command {
cmd := genutilcli.GenesisCoreCommand(encodingConfig.TxConfig, app.ModuleBasics, app.DefaultNodeHome)

for _, subCmd := range cmds {
Expand Down Expand Up @@ -170,12 +173,8 @@ func txCommand() *cobra.Command {
return cmd
}

type appCreator struct {
encCfg params.EncodingConfig
}

// newApp is an AppCreator
func (a appCreator) newApp(logger log.Logger, db dbm.DB, traceStore io.Writer, appOpts servertypes.AppOptions) servertypes.Application {
func newApp(logger log.Logger, db dbm.DB, traceStore io.Writer, appOpts servertypes.AppOptions) servertypes.Application {
return app.New(
logger, db, traceStore, true,
appOpts,
Expand Down
1 change: 0 additions & 1 deletion scripts/protocgen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ set -euox pipefail
echo "Generating gogo proto code"
cd proto

# Find all proto files but exclude "v1" paths
proto_dirs=$(find ./ -type f -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq)
for proto_dir in $proto_dirs; do
proto_files=$(find "${proto_dir}" -maxdepth 1 -name '*.proto')
Expand Down

0 comments on commit f373afc

Please sign in to comment.