This commit is contained in:
SomberNight 2018-04-01 16:52:24 +02:00
parent 192288c025
commit ff57c198b4
No known key found for this signature in database
GPG key ID: B33B5F232C6271E9

View file

@ -9,6 +9,8 @@ from lib import constants
from plugins.trustedcoin import trustedcoin
from . import TestCaseForTestnet
class WalletIntegrityHelper:
@ -56,7 +58,7 @@ class WalletIntegrityHelper:
# TODO passphrase/seed_extension
class TestWalletKeystoreAddressIntegrity(unittest.TestCase):
class TestWalletKeystoreAddressIntegrityForMainnet(unittest.TestCase):
@mock.patch.object(storage.WalletStorage, '_write')
def test_electrum_seed_standard(self, mock_write):
@ -289,9 +291,11 @@ class TestWalletKeystoreAddressIntegrity(unittest.TestCase):
self.assertEqual(w.get_receiving_addresses()[0], '35LeC45QgCVeRor1tJD6LiDgPbybBXisns')
self.assertEqual(w.get_change_addresses()[0], '39RhtDchc6igmx5tyoimhojFL1ZbQBrXa6')
class TestWalletKeystoreAddressIntegrityForTestnet(TestCaseForTestnet):
@mock.patch.object(storage.WalletStorage, '_write')
def test_bip39_multisig_seed_p2sh_segwit_testnet(self, mock_write):
constants.set_testnet()
# bip39 seed: finish seminar arrange erosion sunny coil insane together pretty lunch lunch rose
# der: m/49'/1'/0'
# NOTE: there is currently no bip43 standard derivation path for p2wsh-p2sh
@ -302,12 +306,11 @@ class TestWalletKeystoreAddressIntegrity(unittest.TestCase):
# bip39 seed: square page wood spy oil story rebel give milk screen slide shuffle
# der: m/49'/1'/0'
ks2 = keystore.from_xpub('Upub5QRzUGRJuWJe5MxGzwgQAeyJjzcdGTXkkq77w6EfBkCyf5iWppSaZ4caY2MgWcU9LP4a4uE5apUFN4wLoENoe9tpu26mrUxeGsH84dN3JFh')
self._check_xpub_keystore_sanity(ks2)
WalletIntegrityHelper.check_xpub_keystore_sanity(self, ks2)
self.assertTrue(isinstance(ks2, keystore.BIP32_KeyStore))
w = self._create_multisig_wallet(ks1, ks2)
w = WalletIntegrityHelper.create_multisig_wallet(ks1, ks2)
self.assertEqual(w.txin_type, 'p2wsh-p2sh')
self.assertEqual(w.get_receiving_addresses()[0], '2MzsfTfTGomPRne6TkctMmoDj6LwmVkDrMt')
self.assertEqual(w.get_change_addresses()[0], '2NFp9w8tbYYP9Ze2xQpeYBJQjx3gbXymHX7')
constants.set_mainnet()