Merge pull request #2964 from SomberNight/tests_wallet_keystore_bip39
tests: wallet-keystore integrity (bip39)
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user