Merge bitcoindevkit/bdk-cli#373: fix(key): use password when restoring a key
55585554ae4f8b7a51dcff67571b6579b1804e13 fix(key): use password when restoring a key (Ikeh Celestine Chukwudi)
Pull request description:
Fixes #372
`RestoreKeyCommand::execute` built the extended key with `(mnemonic.clone(), &self.password).0`. The `.0` keeps only the mnemonic, so `--password` was silently dropped and a key generated with `key generate --password` restored to a different key, with no error.
This PR passes the password the same way `GenerateKeyCommand` does, and adds `test_cli_key_restore_with_password`, which checks that restoring with the same password returns the same xprv and fingerprint, and that restoring without it returns a different xprv. The new test fails on master.
### Fixed
`key restore --password` now uses the password, so passphrase-protected mnemonics restore to the correct key.
ACKs for top commit:
muawiya1:
tACK
5558555
emma31-dev:
ACK [
5558555](https://github.com/bitcoindevkit/bdk-cli/pull/373/commits/
55585554ae4f8b7a51dcff67571b6579b1804e13)
vadim-anfv:
tACK
5558555
tvpeter:
ACK
55585554ae4f8b7a51dcff67571b6579b1804e13
Tree-SHA512: 3595f75b60a99a1b63ac187e212f11137f80e26fb356dd57060f6d2ae276ff0ac59505b860047d0519be13c0919f445dbd2ed1845b9fd2949eaa2d43b789c8cb