Skip to content

Commit

Permalink
Fix using correct database in anti fee sniping unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
Cryp Toon committed Jul 10, 2024
1 parent 88020c3 commit 39c37c9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/test_wallets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2374,12 +2374,14 @@ def test_wallet_anti_fee_sniping(self):
block_height = Service(network='testnet', cache_uri='').blockcount()
self.assertAlmostEqual(t.locktime, block_height+1, delta=3)

w2 = wallet_create_or_open('antifeesnipingtestwallet2', network='testnet', anti_fee_sniping=True)
w2 = wallet_create_or_open('antifeesnipingtestwallet2', network='testnet', anti_fee_sniping=True,
db_uri=self.database_uri)
w2.utxo_add(w2.get_key().address, 1234567, os.urandom(32).hex(), 1)
t = w2.send_to('tb1qrjtz22q59e76mhumy0p586cqukatw5vcd0xvvz', 123456, locktime=1901070183)
self.assertEqual(t.locktime, 1901070183)

w3 = wallet_create_or_open('antifeesnipingtestwallet3', network='testnet', anti_fee_sniping=False)
w3 = wallet_create_or_open('antifeesnipingtestwallet3', network='testnet', anti_fee_sniping=False,
db_uri=self.database_uri)
w3.utxo_add(w3.get_key().address, 1234567, os.urandom(32).hex(), 1)
t = w3.send_to('tb1qrjtz22q59e76mhumy0p586cqukatw5vcd0xvvz', 123456)
self.assertEqual(t.locktime, 0)
Expand Down

0 comments on commit 39c37c9

Please sign in to comment.