Repository navigation
refactor(key)!: rename --entropy and --password flags - #384
chukwudiikeh wants to merge 3 commits into
Conversation
a69825e to
292e821
Compare
|
@tvpeter @vadim-anfv please can you review when you have time. Built on #383, so only the last commit is new here. Used --word_count. |
292e821 to
2dfb344
Compare
GenerateKeyCommand and RestoreKeyCommand repeated the same steps to derive the master key from a mnemonic, and the duplication is how bitcoindevkit#372 happened. Move them into key_from_mnemonic, called by both, and use the Display impl of Mnemonic instead of the manual fold, which gives the same output. Fixes bitcoindevkit#382
Rename key generate --entropy to --word_count (-e to -w), since the value is a number of words, and --password to --passphrase (env PASSWORD to PASSPHRASE) in key generate and key restore, the BIP-39 term. Expand the passphrase doc comment shown by --help, and update the tests and changelog. Fixes bitcoindevkit#381
2dfb344 to
bb5cc68
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #384 +/- ##
==========================================
- Coverage 59.63% 59.61% -0.03%
==========================================
Files 25 25
Lines 4544 4536 -8
==========================================
- Hits 2710 2704 -6
+ Misses 1834 1832 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Reviewing #383 first, and #384 after it is rebased on top of the merged #383, so the two land in order. One small thing: the description says this depends on #382, which is the issue. |
Fixes #381
Depends on #382. This branch is built on top of it because both change the same code; only the last commit (
refactor(key)!: ...) belongs to this PR. I'll rebase once #382 is merged.key generate --entropytakes a number of words, not an amount of entropy, and--passwordis the BIP-39 passphrase. This PR renames:key generate --entropy→--word_count(-e→-w). TheWORD_COUNTenv var is unchanged.--password→--passphrase(envPASSWORD→PASSPHRASE) inkey generateandkey restore, along with the struct fields.The passphrase doc comment, shown by--help, now says that restoring needs the same mnemonic and passphrase, and that a different passphrase gives a different key rather than an error.I used--word_countto match most flags andkey derive --derivation_path; if--word-countis preferred, it's a one-word change.Changed
BREAKING:
key generate --entropy/-eis now--word_count/-w, and--password/PASSWORDis now--passphrase/PASSPHRASEinkey generateandkey restore.