trezor: use serialize_xpub
This commit is contained in:
parent
4cfe98216e
commit
6f083a712d
|
@ -4,7 +4,7 @@ from struct import pack
|
||||||
from electrum.i18n import _
|
from electrum.i18n import _
|
||||||
from electrum.util import PrintError, UserCancelled
|
from electrum.util import PrintError, UserCancelled
|
||||||
from electrum.keystore import bip39_normalize_passphrase
|
from electrum.keystore import bip39_normalize_passphrase
|
||||||
from electrum.bitcoin import EncodeBase58Check
|
from electrum.bitcoin import serialize_xpub
|
||||||
|
|
||||||
|
|
||||||
class GuiMixin(object):
|
class GuiMixin(object):
|
||||||
|
@ -151,10 +151,7 @@ class TrezorClientBase(GuiMixin, PrintError):
|
||||||
address_n = self.expand_path(bip32_path)
|
address_n = self.expand_path(bip32_path)
|
||||||
creating = False #self.next_account_number() == 0
|
creating = False #self.next_account_number() == 0
|
||||||
node = self.get_public_node(address_n, creating).node
|
node = self.get_public_node(address_n, creating).node
|
||||||
xpub = ("0488B21E".decode('hex') + chr(node.depth)
|
return serialize_xpub(0, node.chain_code, node.public_key, node.depth, self.i4b(node.fingerprint), self.i4b(node.child_num))
|
||||||
+ self.i4b(node.fingerprint) + self.i4b(node.child_num)
|
|
||||||
+ node.chain_code + node.public_key)
|
|
||||||
return EncodeBase58Check(xpub)
|
|
||||||
|
|
||||||
#def address_from_derivation(self, derivation):
|
#def address_from_derivation(self, derivation):
|
||||||
# return self.get_address('Bitcoin', self.expand_path(derivation))
|
# return self.get_address('Bitcoin', self.expand_path(derivation))
|
||||||
|
|
Loading…
Reference in New Issue