bip32: refactor whole module. clean-up.
This commit is contained in:
@@ -4,7 +4,7 @@ import sys
|
||||
|
||||
from electrum.util import bfh, bh2u, UserCancelled, UserFacingException
|
||||
from electrum.bitcoin import TYPE_ADDRESS, TYPE_SCRIPT
|
||||
from electrum.bip32 import deserialize_xpub
|
||||
from electrum.bip32 import BIP32Node
|
||||
from electrum import constants
|
||||
from electrum.i18n import _
|
||||
from electrum.transaction import deserialize, Transaction
|
||||
@@ -227,13 +227,13 @@ class KeepKeyPlugin(HW_PluginBase):
|
||||
label, language)
|
||||
|
||||
def _make_node_path(self, xpub, address_n):
|
||||
_, depth, fingerprint, child_num, chain_code, key = deserialize_xpub(xpub)
|
||||
bip32node = BIP32Node.from_xkey(xpub)
|
||||
node = self.types.HDNodeType(
|
||||
depth=depth,
|
||||
fingerprint=int.from_bytes(fingerprint, 'big'),
|
||||
child_num=int.from_bytes(child_num, 'big'),
|
||||
chain_code=chain_code,
|
||||
public_key=key,
|
||||
depth=bip32node.depth,
|
||||
fingerprint=int.from_bytes(bip32node.fingerprint, 'big'),
|
||||
child_num=int.from_bytes(bip32node.child_number, 'big'),
|
||||
chain_code=bip32node.chaincode,
|
||||
public_key=bip32node.eckey.get_public_key_bytes(compressed=True),
|
||||
)
|
||||
return self.types.HDNodePathType(node=node, address_n=address_n)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user