1
0

Merge pull request #2964 from SomberNight/tests_wallet_keystore_bip39

tests: wallet-keystore integrity (bip39)
This commit is contained in:
ThomasV
2017-10-05 10:10:57 +02:00
committed by GitHub
3 changed files with 101 additions and 31 deletions

View File

@@ -577,6 +577,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):