1
0

tests: wallet-keystore integrity (bip39)

This commit is contained in:
SomberNight
2017-10-03 03:30:40 +02:00
parent 031b911dce
commit 751be88059
3 changed files with 101 additions and 31 deletions

View File

@@ -573,6 +573,13 @@ def bip39_is_checksum_valid(mnemonic):
calculated_checksum = hashed >> (256 - checksum_length)
return checksum == calculated_checksum, True
def from_bip39_seed(seed, passphrase, derivation):
k = BIP32_KeyStore({})
bip32_seed = bip39_to_seed(seed, passphrase)
t = 'segwit_p2sh' if derivation.startswith("m/49'") else 'standard' # bip43
k.add_xprv_from_seed(bip32_seed, t, derivation)
return k
# extended pubkeys
def is_xpubkey(x_pubkey):