1
0

wallet: stricter validation in export_private_key

fixes #5422
This commit is contained in:
SomberNight
2019-06-12 18:09:38 +02:00
parent c7b64f4794
commit 9e21b76c91
4 changed files with 62 additions and 8 deletions

View File

@@ -156,7 +156,8 @@ class TestCreateRestoreWallet(WalletTestCase):
passphrase=passphrase,
password=password,
encrypt_file=encrypt_file,
segwit=True)
segwit=True,
gap_limit=1)
wallet = d['wallet'] # type: Standard_Wallet
wallet.check_password(password)
self.assertEqual(passphrase, wallet.keystore.get_passphrase(password))
@@ -173,7 +174,8 @@ class TestCreateRestoreWallet(WalletTestCase):
network=None,
passphrase=passphrase,
password=password,
encrypt_file=encrypt_file)
encrypt_file=encrypt_file,
gap_limit=1)
wallet = d['wallet'] # type: Standard_Wallet
self.assertEqual(passphrase, wallet.keystore.get_passphrase(password))
self.assertEqual(text, wallet.keystore.get_seed(password))
@@ -182,14 +184,14 @@ class TestCreateRestoreWallet(WalletTestCase):
def test_restore_wallet_from_text_xpub(self):
text = 'zpub6nydoME6CFdJtMpzHW5BNoPz6i6XbeT9qfz72wsRqGdgGEYeivso6xjfw8cGcCyHwF7BNW4LDuHF35XrZsovBLWMF4qXSjmhTXYiHbWqGLt'
d = restore_wallet_from_text(text, path=self.wallet_path, network=None)
d = restore_wallet_from_text(text, path=self.wallet_path, network=None, gap_limit=1)
wallet = d['wallet'] # type: Standard_Wallet
self.assertEqual(text, wallet.keystore.get_master_public_key())
self.assertEqual('bc1q2ccr34wzep58d4239tl3x3734ttle92a8srmuw', wallet.get_receiving_addresses()[0])
def test_restore_wallet_from_text_xprv(self):
text = 'zprvAZzHPqhCMt51fskXBUYB1fTFYgG3CBjJUT4WEZTpGw6hPSDWBPZYZARC5sE9xAcX8NeWvvucFws8vZxEa65RosKAhy7r5MsmKTxr3hmNmea'
d = restore_wallet_from_text(text, path=self.wallet_path, network=None)
d = restore_wallet_from_text(text, path=self.wallet_path, network=None, gap_limit=1)
wallet = d['wallet'] # type: Standard_Wallet
self.assertEqual(text, wallet.keystore.get_master_private_key(password=None))
self.assertEqual('bc1q2ccr34wzep58d4239tl3x3734ttle92a8srmuw', wallet.get_receiving_addresses()[0])