improve test_usb.py::test_xpub_good
This commit is contained in:
parent
0a38118f51
commit
8c15ff6ae6
@ -7,6 +7,7 @@
|
||||
import pytest, struct
|
||||
from pycoin.key.BIP32Node import BIP32Node
|
||||
from binascii import b2a_hex
|
||||
from constants import simulator_fixed_tprv
|
||||
from ckcc_protocol.protocol import MAX_MSG_LEN, CCProtocolPacker, CCProtoError
|
||||
|
||||
@pytest.mark.skip
|
||||
@ -84,9 +85,11 @@ def test_xpub_good(dev, master_xpub, path):
|
||||
|
||||
assert k.hwif() == xpub
|
||||
|
||||
mk = BIP32Node.from_wallet_key(master_xpub)
|
||||
sk = mk.subkey_for_path(path[2:].replace("h", "'"))
|
||||
assert sk.hwif() == xpub
|
||||
is_hard = ("'" in path) or ("h" in path)
|
||||
if not is_hard or dev.is_simulator:
|
||||
mk = BIP32Node.from_wallet_key(simulator_fixed_tprv if is_hard else master_xpub)
|
||||
sk = mk.subkey_for_path(path[2:].replace("h", "'"))
|
||||
assert sk.hwif() == xpub
|
||||
|
||||
if len(path) <= 2:
|
||||
assert mk.fingerprint() == struct.pack('<I', dev.master_fingerprint)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user