fix typos
This commit is contained in:
@@ -745,7 +745,7 @@ def xprv_header(xtype):
|
|||||||
def xpub_header(xtype):
|
def xpub_header(xtype):
|
||||||
return ("%08x"%(XPUB_HEADER + xtype)).decode('hex')
|
return ("%08x"%(XPUB_HEADER + xtype)).decode('hex')
|
||||||
|
|
||||||
def serialize_xpub(xtype, c, k):
|
def serialize_xprv(xtype, c, k):
|
||||||
xprv = xprv_header(xtype) + chr(0)*9 + c + chr(0) + k
|
xprv = xprv_header(xtype) + chr(0)*9 + c + chr(0) + k
|
||||||
return EncodeBase58Check(xprv)
|
return EncodeBase58Check(xprv)
|
||||||
|
|
||||||
@@ -802,7 +802,7 @@ def bip32_root(seed, xtype):
|
|||||||
master_c = I[32:]
|
master_c = I[32:]
|
||||||
K, cK = get_pubkeys_from_secret(master_k)
|
K, cK = get_pubkeys_from_secret(master_k)
|
||||||
xprv = serialize_xprv(xtype, master_c, master_k)
|
xprv = serialize_xprv(xtype, master_c, master_k)
|
||||||
xpub = serialize_xpub(xtype, master_c + cK)
|
xpub = serialize_xpub(xtype, master_c, cK)
|
||||||
return xprv, xpub
|
return xprv, xpub
|
||||||
|
|
||||||
def xpub_from_pubkey(xtype, cK):
|
def xpub_from_pubkey(xtype, cK):
|
||||||
|
|||||||
@@ -1631,15 +1631,15 @@ class P2SH:
|
|||||||
class Standard_Wallet(Simple_Deterministic_Wallet):
|
class Standard_Wallet(Simple_Deterministic_Wallet):
|
||||||
wallet_type = 'standard'
|
wallet_type = 'standard'
|
||||||
|
|
||||||
def pubkeys_to_redeem_script(self, pubkeys):
|
def pubkeys_to_redeem_script(self, pubkey):
|
||||||
if self.xpub_type == 1:
|
if self.xpub_type == 1:
|
||||||
return transaction.segwit_script(pubkey)
|
return transaction.segwit_script(pubkey)
|
||||||
|
|
||||||
def pubkeys_to_address(self, pubkey):
|
def pubkeys_to_address(self, pubkey):
|
||||||
if self.xpub_type == 0:
|
if self.xpub_type == 0:
|
||||||
return bitcoin.public_key_to_p2pkh(pubkey.decode('hex'))
|
return bitcoin.public_key_to_p2pkh(pubkey.decode('hex'))
|
||||||
elif self.xpub_type == 1 and TESTNET:
|
elif self.xpub_type == 1 and bitcoin.TESTNET:
|
||||||
redeem_script = self.pubkeys_to_redeem_script(pubkeys)
|
redeem_script = self.pubkeys_to_redeem_script(pubkey)
|
||||||
return bitcoin.hash160_to_p2sh(hash_160(redeem_script.decode('hex')))
|
return bitcoin.hash160_to_p2sh(hash_160(redeem_script.decode('hex')))
|
||||||
else:
|
else:
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
|||||||
Reference in New Issue
Block a user