1
0

tests: bip32 extended version bytes

This commit is contained in:
SomberNight
2018-05-28 20:27:08 +02:00
parent 9b7a449057
commit 7218bf1d14
2 changed files with 125 additions and 2 deletions

View File

@@ -590,10 +590,12 @@ def bip39_is_checksum_valid(mnemonic):
calculated_checksum = hashed >> (256 - checksum_length)
return checksum == calculated_checksum, True
def from_bip39_seed(seed, passphrase, derivation):
def from_bip39_seed(seed, passphrase, derivation, xtype=None):
k = BIP32_KeyStore({})
bip32_seed = bip39_to_seed(seed, passphrase)
xtype = xtype_from_derivation(derivation)
if xtype is None:
xtype = xtype_from_derivation(derivation)
k.add_xprv_from_seed(bip32_seed, xtype, derivation)
return k