Skip to content
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

Closed
wants to merge 5 commits into from

Conversation

rezbera
Copy link
Contributor

@rezbera rezbera commented Feb 3, 2025

No description provided.

Copy link

codecov bot commented Feb 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 21.17%. Comparing base (1aff871) to head (ab12c53).

❗ There is a different number of reports uploaded between BASE (1aff871) and HEAD (ab12c53). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (1aff871) HEAD (ab12c53)
2 1
Additional details and impacted files

Impacted file tree graph

@@             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     

see 347 files with indirect coverage changes

@@ -125,7 +124,7 @@ func InitCmd(mm interface {
if config.RootDir == "" {
config.RootDir = clientCtx.HomeDir
}

config.Moniker = args[0]
Copy link
Contributor Author

@rezbera rezbera Feb 3, 2025

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

Comment on lines -158 to -161
nodeID, _, err := genutil.InitializeNodeValidatorFilesFromMnemonic(config, mnemonic, consensusKeyAlgo)
if err != nil {
return err
}
Copy link
Contributor Author

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
Copy link
Contributor Author

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)

@rezbera rezbera closed this Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant