1
0

ecc.ECPubkey: also accept bytearray in __init__

regression since #5947

Traceback (most recent call last):
  File "...\electrum\electrum\base_wizard.py", line 339, in on_device
    self.plugin.setup_device(device_info, self, purpose)
  File "...\electrum\electrum\plugins\ledger\ledger.py", line 598, in setup_device
    client.get_xpub("m/44'/0'", 'standard') # TODO replace by direct derivation once Nano S > 1.1
  File "...\electrum\electrum\plugins\ledger\ledger.py", line 55, in catch_exception
    return func(self, *args, **kwargs)
  File "...\electrum\electrum\plugins\ledger\ledger.py", line 124, in get_xpub
    eckey=ecc.ECPubkey(publicKey),
  File "...\electrum\electrum\ecc.py", line 145, in __init__
    self._x, self._y = _x_and_y_from_pubkey_bytes(b)
  File "...\electrum\electrum\ecc.py", line 119, in _x_and_y_from_pubkey_bytes
    ret = _libsecp256k1.secp256k1_ec_pubkey_parse(
ctypes.ArgumentError: argument 3: <class 'TypeError'>: wrong type
This commit is contained in:
SomberNight
2020-02-19 00:40:33 +01:00
parent 0845300150
commit 9c5e49f432
2 changed files with 5 additions and 2 deletions

View File

@@ -121,7 +121,7 @@ class Ledger_Client(HardwareClientBase):
publicKey = compress_public_key(nodeData['publicKey'])
depth = len(bip32_intpath)
return BIP32Node(xtype=xtype,
eckey=ecc.ECPubkey(publicKey),
eckey=ecc.ECPubkey(bytes(publicKey)),
chaincode=nodeData['chainCode'],
depth=depth,
fingerprint=fingerprint_bytes,