Skip to content

Commit

Permalink
Fix restore saved tx unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
Cryp Toon committed May 14, 2024
1 parent d15dc38 commit 44b0ba3
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/test_wallets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2011,13 +2011,12 @@ def test_wallet_transaction_sign_with_wif(self):
self.assertTrue(t.pushed)

def test_wallet_transaction_restore_saved_tx(self):
if os.getenv('UNITTEST_DATABASE') == 'mysql': # fixme
self.skipTest("Unittest not working for mysql at the moment")
if not USE_FASTECDSA:
self.skipTest("Need fastecdsa module with deterministic txid's to run this test")

w = wallet_create_or_open('test_wallet_transaction_restore', network='bitcoinlib_test',
db_uri=self.database_uri)
wk = w.get_key()
if not USE_FASTECDSA:
self.skipTest("Need fastecdsa module with deterministic txid's to run this test")
utxos = [{
'address': wk.address,
'script': '',
Expand All @@ -2028,7 +2027,7 @@ def test_wallet_transaction_restore_saved_tx(self):
}]
w.utxos_update(utxos=utxos)
to = w.get_key_change()
t = w.sweep(to.address)
t = w.sweep(to.address, fee=10000)
tx_id = t.store()
del w
wallet_empty('test_wallet_transaction_restore', db_uri=self.database_uri)
Expand All @@ -2037,8 +2036,9 @@ def test_wallet_transaction_restore_saved_tx(self):
w.get_key()
w.utxos_update(utxos=utxos)
to = w.get_key_change()
t = w.sweep(to.address)
self.assertEqual(t.store(), tx_id)
t2 = w.sweep(to.address, fee=10000)
self.assertEqual(t.txid, t2.txid)
self.assertEqual(t2.store(), tx_id)

def test_wallet_transaction_send_keyid(self):
w = Wallet.create('wallet_send_key_id', witness_type='segwit', network='bitcoinlib_test',
Expand Down

0 comments on commit 44b0ba3

Please sign in to comment.