-
Notifications
You must be signed in to change notification settings - Fork 251
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
feat: pass master key as an option #690
feat: pass master key as an option #690
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #690 +/- ##
=======================================
Coverage 57.27% 57.27%
=======================================
Files 156 156
Lines 17218 17218
=======================================
Hits 9862 9862
Misses 6392 6392
Partials 964 964 ☔ View full report in Codecov by Sentry. |
@darrenvechain looks good, you may want to document it in the docs? |
Yepp, done here: cea3ec6 |
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.
lgtm - optional nit, non-blocking imo
@@ -395,6 +395,20 @@ func masterKeyPath(ctx *cli.Context) (string, error) { | |||
} | |||
|
|||
func loadNodeMaster(ctx *cli.Context) (*node.Master, error) { | |||
|
|||
masterKey := ctx.String(masterKeyFlag.Name) | |||
if masterKey != "" { |
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.
Looks good! A small nit to avoid code repetition sugestion would be a small refactor. I think perhaps something like:
- key is set by flag
- otherwise key is set by path
3 if key is set then test beneficiary and return masterkey
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.
@otherview I made a commit to refactor this
Description
This change allows injection of a master key as a startup flag
Fixes # (issue)
Type of change
How Has This Been Tested?
./bin/thor --network main --master-key eb5cce9a3ba17cd90fd4238cb382d1c47f1c2084f71384f6de6da03a1582d5e6
Checklist: