Apparently m/48' (where 48 is the purpose number in a BIP 44 path) is
the standard path for use with multisigs. This is mistakenly called BIP
48 in many places, but no such BIP 48 actually exists. Anyways, Trezor
requires multisigs use m/48' for multisigs, so we need to use them in
our tests.
We are really targeting descriptor wallets, so we should be testing
those.
Because descriptor wallets also change how the imports will work w.r.t
rescans and the next address to give out, the getkeypool path checks are
changed to just check that the begin with the correct path prefix.
self.rpc is already setup when the test starts, no need to set it again.
Additionally, use the parent class setUp so we aren't duplicating as
much code.
78a8801f94 Support multisig xpub descriptors (benk10)
Pull request description:
Trezor Model T has an option when displaying a multisig address to also show all xpubs used as cosigners of the multisig. Currently, the display address function did not support using xpubs, so here I added support in Trezor for such descriptors, which will make xpubs show up correctly.
ACKs for top commit:
achow101:
ACK 78a8801f94
Tree-SHA512: 707e56b3cbac5f21ccdaeba912e751f23fe5fff637c18366cbe76b618840d4ba38fd2442919e2ff61f770c8381e59a6147d385a44d2def5dad07d89a09730eed
967138c2db Add test for multisig `displayaddress` (benk10)
a25baf858d Support multisig descriptors in `displayaddress` (benk10)
59f8c1d56a Support multisig `displayaddress` (ColdCard) (benk10)
5083bf4e6b Support multisig `displayaddress` (Trezor) (benk10)
Pull request description:
Added support for multisig addresses in the `displayaddress` command for Coldcard, Trezor, and Keepkey.
This PR is based on #279 and should replace it.
For now, I mostly preserved justinmoon's API as he described it in [this message](https://github.com/bitcoin-core/HWI/pull/279#issue-341248821). I'll just add a few notes on that:
- To prevent Coldcard format of sending all paths from being inconsistent with that of Trezor I allowed sending multiple paths to the Trezor too and it will simply find the correct one. That shouldn't be necessary but I just chose to add that to maintain consistency. That's not mandatory on Trezor though, so it still works just fine with either a single or multiple paths.
- I also left the `--sh_wpkh` and `--wpkh` flags for now. I think it will be best to rename them to something like `--wrapped-segwit` and `bech32` or `--native-segwit`, but wanted to raise that up here too before changing.
- ~~As for descriptor support, I did not add it yet since I didn't want this PR to be too big. I plan to add that support in a separate PR after this one is done, but if you think I should have it all in this PR that's possible too.~~
**Edit:** I also added descriptor support for multisig, [see this comment](https://github.com/bitcoin-core/HWI/pull/324#issuecomment-621926077).
The tests should cover Coldcard, Trezor, and Keepkey with 2-3 multi-sig. The setup for the test is borrowed mostly from the `sign_tx` tests code.
ACKs for top commit:
achow101:
ACK 967138c2db
Tree-SHA512: ddc9336581998507a88e4da6a4a028ba520a19e9a4df2a85733865efc6f0857c1cde8ffbdd84980867e06cf7e7d14a89e4cc5531fd2920c522268a91dc82df9d
32989bb03a tests, trezor: Go back to using the master branch of trezor-firmware (Andrew Chow)
2862be4800 trezor: Update passphrase workflow and messages (Andrew Chow)
c3c6963b00 trezorlib: Initialize needs to be sent if there is no active session (Andrew Chow)
48498105e9 trezor: use GetPublicNode instead of Ping for promptpin (Andrew Chow)
Pull request description:
Trezor firmware versions 2.3 and 1.9 changed a couple of things that were causing HWI to not work with them. This PR fixes those things.
* Changed `promptpin` to use `GetPublicKey` message. The `Ping` message used previously no longer has a pin prompt option.
* Updated messages and passphrase callback to match new passphrase workflow
* Check for a session being initialized by doing a `GetPublicKey` and seeing if a `FirmwareError` is returned. If so, send an `Initialize` to start a session.
Top commit has no ACKs.
Tree-SHA512: f31a780d5ad447f6a5af3d54ceda78042c1fdeec09b6b7d6d9acae512d9a22286b809e42a95778a2d128edec677ef156c8327584eb4fc75aa21b4a39975a747a
15b213a6dc add test for getkeypool --all (Gregory Sanders)
a232005e73 getkeypool: --all option for descriptor wallets (Gregory Sanders)
Pull request description:
needs tests, putting this up for concept ACKs first. Seems to work(TM).
resolves https://github.com/bitcoin-core/HWI/issues/315
ACKs for top commit:
achow101:
ACK 15b213a6dc
Tree-SHA512: 5c9cd747d231af5a37020e894c8ff46d8d39906fa86533b8c53b8191054bfd764daa18cd7a58ab449d5824298e908535c4b552d93289f49e298918fb0124b098
Instead of adding all the device tests to a single overall
test suite that is run, do each device test as its own test suite
with its own test runner. The change allows us to not have too
many extra emulators/simulators running at once. Previously, when
the tests were being loaded, if that device had a global emulator,
it was started. These emulators were also left running during other
device tests. By splitting up the tests per device, we can ensure
that the emulators are only being run for their tests.