-
Notifications
You must be signed in to change notification settings - Fork 75
[CHORE] Add encrypt-key command to CLI #858
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
Conversation
private val EncryptKey: Command[String] = | ||
Command(name = encryptKeyCommand, header = "Encrypt private key") { | ||
|
||
val privateKey = Opts |
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.
Shouldn't common options be defined outside commands? Or maybe even all options should replace current string constants in lines ~17-25?
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.
I prefer to leave string constants because it is convenient to use them in tests
ByteStringUtils.hash2string(decrypted) shouldBe privateKey | ||
} | ||
|
||
it should "encrypt private key (with passphrase)" in { |
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.
minor: this test looks like a perfect candidate for a property-based one.
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.
Not really. I don't want to test decryption/encryption here. It should be done in a different place. I only want to check if I get the correct JSON when I specify the correct arguments
README.md
Outdated
@@ -50,6 +50,11 @@ Possible networks: `etc`, `eth`, `mordor`, `testnet-internal` | |||
./bin/mantis cli generate-key-pairs 5 | |||
``` | |||
|
|||
- encrypt private key (could be used to setup private faucet) |
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.
Probably bit more documentation (and explanation) would be helpful. Either here or in the help for that command
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 👍
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!
Description
encrypt-key
command could be useful to set up a faucet