def setUp(self): bitcoin.set_testnet() self.user_dir = tempfile.mkdtemp() self.wallet_path = os.path.join(self.user_dir, "multisig2") self.storage = WalletStorage(self.wallet_path) self.storage.put('wallet_type', "2of3") k = [keystore.from_seed('almost cross mistake border loud enable birth worth end helmet flash cliff', '')] k.append(keystore.from_keys('tpubD6NzVbkrYhZ4XikksiCN1DTVgBZUQcKeN5XkbeqhDZei5z15sb34cES57n7BS7zxuN5QSwRtFidx4VMYk9VBoX76CCsek6P2mzWkTj3UtiK')) k.append(keystore.from_keys('tpubD6NzVbkrYhZ4XgqM6axUN9ZhvBhCawMKRsT9Lqxs6fMjj5TAB9cE7vJATk1vuGrpBVaqVPKrSPXeDYJMbLWKN9svbKEW38WAWQq5nU3nqT1')) for i, one_k in enumerate(k): self.storage.put('x%d/' % (i + 1), one_k.dump()) self.wallet = wallet.Multisig_Wallet(self.storage) for i in range(2): self.wallet.create_new_address(False) # normal addresses self.wallet.create_new_address(True) # change addresses self.wallet.storage.write()
def test_keystore_from_drkv(self): keystore = from_keys(self.drkv) self.assertEqual(keystore.xpub, self.xpub) self.assertEqual(keystore.xprv, self.xprv)
def test_keystore_from_xpub(self): keystore = from_keys(self.xpub) self.assertEqual(keystore.xpub, self.xpub) self.assertEqual(keystore.xprv, None)