-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(init-cli): Refactor the Init CLI command to be callable from runtime #2468
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2468 +/- ##
===========================================
- Coverage 32.36% 21.17% -11.20%
===========================================
Files 350 3 -347
Lines 15592 85 -15507
Branches 20 20
===========================================
- Hits 5047 18 -5029
+ Misses 10182 66 -10116
+ Partials 363 1 -362 |
@@ -125,7 +124,7 @@ func InitCmd(mm interface { | |||
if config.RootDir == "" { | |||
config.RootDir = clientCtx.HomeDir | |||
} | |||
|
|||
config.Moniker = args[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reordered setting the moniker so its closer to where other config
updates are done
nodeID, _, err := genutil.InitializeNodeValidatorFilesFromMnemonic(config, mnemonic, consensusKeyAlgo) | ||
if err != nil { | ||
return err | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved this core logic to Init
func InitCmd(mm interface { | ||
DefaultGenesis() map[string]json.RawMessage | ||
ValidateGenesis(genesisData map[string]json.RawMessage) error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We run ValidateGenesis in initChain
and hence we don't use it here (i.e. this was unused)
No description provided.