test: create assert_not_equal util and add to where imports are needed

In the functional tests there are lots of cases where we assert != which
this new util will replace, we also are adding the imports and the new assertion
This commit is contained in:
kevkevin
2024-02-27 19:41:12 -06:00
committed by kevkevinpal
parent 930b237f16
commit 7bb83f6718
41 changed files with 137 additions and 83 deletions

View File

@@ -7,6 +7,7 @@
from test_framework.address import address_to_scriptpubkey
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
assert_not_equal,
assert_approx,
assert_equal,
assert_raises_rpc_error,
@@ -166,7 +167,7 @@ class AvoidReuseTest(BitcoinTestFramework):
# Make sure it's starting out as change as expected
assert node.getaddressinfo(changeaddr)['ischange']
for logical_tx in node.listtransactions():
assert logical_tx.get('address') != changeaddr
assert_not_equal(logical_tx.get('address'), changeaddr)
# Spend it
reset_balance(node, node.getnewaddress())
@@ -174,7 +175,7 @@ class AvoidReuseTest(BitcoinTestFramework):
# It should still be change
assert node.getaddressinfo(changeaddr)['ischange']
for logical_tx in node.listtransactions():
assert logical_tx.get('address') != changeaddr
assert_not_equal(logical_tx.get('address'), changeaddr)
def test_sending_from_reused_address_without_avoid_reuse(self):
'''