Skip to content

Commit

Permalink
export two functions
Browse files Browse the repository at this point in the history
  • Loading branch information
kocubinski committed Oct 28, 2024
1 parent 9addef4 commit e9c4005
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions simapp/v2/simdv2/cmd/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,20 @@ import (
v2 "github.com/cosmos/cosmos-sdk/x/genutil/v2/cli"
)

// commandDependencies is a struct that contains all the dependencies needed to initialize the root command.
// CommandDependencies is a struct that contains all the dependencies needed to initialize the root command.
// an alternative design could fetch these even later from the command context
type commandDependencies[T transaction.Tx] struct {
type CommandDependencies[T transaction.Tx] struct {
globalAppConfig coreserver.ConfigMap
txConfig client.TxConfig
moduleManager *runtimev2.MM[T]
simApp *simapp.SimApp[T]
consensusComponent serverv2.ServerComponent[T]
}

func initRootCmd[T transaction.Tx](
func InitRootCmd[T transaction.Tx](
rootCmd *cobra.Command,
logger log.Logger,
deps commandDependencies[T],
deps CommandDependencies[T],
) (serverv2.ConfigWriter, error) {
cfg := sdk.GetConfig()
cfg.Seal()
Expand Down
6 changes: 3 additions & 3 deletions simapp/v2/simdv2/cmd/root_di.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func NewRootCmd[T transaction.Tx](
Use: "simdv2",
SilenceErrors: true,
}
configWriter, err := initRootCmd(rootCommand, log.NewNopLogger(), commandDependencies[T]{})
configWriter, err := InitRootCmd(rootCommand, log.NewNopLogger(), CommandDependencies[T]{})
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -70,7 +70,7 @@ func NewRootCmd[T transaction.Tx](
}
}

commandDeps := commandDependencies[T]{
commandDeps := CommandDependencies[T]{
globalAppConfig: configMap,
txConfig: clientCtx.TxConfig,
moduleManager: moduleManager,
Expand All @@ -83,7 +83,7 @@ func NewRootCmd[T transaction.Tx](
PersistentPreRunE: rootCommandPersistentPreRun(clientCtx),
}
factory.EnhanceRootCommand(rootCommand)
_, err = initRootCmd(rootCommand, logger, commandDeps)
_, err = InitRootCmd(rootCommand, logger, commandDeps)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit e9c4005

Please sign in to comment.