ttests: TestWalletOfflineSigning - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 5d7157451fb47ffda8704d253e941a29a82cefcd DIR parent 11ffc5ca8a4bc5b34fb995991718a0ef01f750e8 HTML Author: SomberNight <somber.night@protonmail.com> Date: Wed, 13 Jun 2018 19:27:07 +0200 ttests: TestWalletOfflineSigning Diffstat: M lib/tests/test_wallet_vertical.py | 369 ++++++++++++++++++++++++++++++ 1 file changed, 369 insertions(+), 0 deletions(-) --- DIR diff --git a/lib/tests/test_wallet_vertical.py b/lib/tests/test_wallet_vertical.py t@@ -46,6 +46,15 @@ class WalletIntegrityHelper: return w @classmethod + def create_imported_wallet(cls, privkeys=False): + store = storage.WalletStorage('if_this_exists_mocking_failed_648151893') + if privkeys: + k = keystore.Imported_KeyStore({}) + store.put('keystore', k.dump()) + w = lib.wallet.Imported_Wallet(store) + return w + + @classmethod def create_multisig_wallet(cls, keystores: Sequence, multisig_type: str, gap_limit=None): """Creates a multisig wallet.""" store = storage.WalletStorage('if_this_exists_mocking_failed_648151893') t@@ -768,6 +777,366 @@ class TestWalletSending(TestCaseForTestnet): self.assertEqual((0, 1000000 - 5000 - 300000, 0), wallet2.get_balance()) +class TestWalletOfflineSigning(TestCaseForTestnet): + + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.electrum_path = tempfile.mkdtemp() + cls.config = SimpleConfig({'electrum_path': cls.electrum_path}) + + @classmethod + def tearDownClass(cls): + super().tearDownClass() + shutil.rmtree(cls.electrum_path) + + @needs_test_with_all_ecc_implementations + @mock.patch.object(storage.WalletStorage, '_write') + def test_sending_offline_xprv_online_xpub_p2pkh(self, mock_write): + wallet_offline = WalletIntegrityHelper.create_standard_wallet( + # bip39: "qwe", der: m/44'/1'/0' + keystore.from_xprv('tprv8gfKwjuAaqtHgqxMh1tosAQ28XvBMkcY5NeFRA3pZMpz6MR4H4YZ3MJM4fvNPnRKeXR1Td2vQGgjorNXfo94WvT5CYDsPAqjHxSn436G1Eu'), + gap_limit=4 + ) + wallet_online = WalletIntegrityHelper.create_standard_wallet( + keystore.from_xpub('tpubDDMN69wQjDZxaJz9afZQGa48hZS7X5oSegF2hg67yddNvqfpuTN9DqvDEp7YyVf7AzXnqBqHdLhzTAStHvsoMDDb8WoJQzNrcHgDJHVYgQF'), + gap_limit=4 + ) + + # bootstrap wallet_online parazyd.org:70 /git/electrum/commit/5d7157451fb47ffda8704d253e941a29a82cefcd.gph:68: line too long