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

@@ -77,6 +77,7 @@ from test_framework.messages import (
sha256,
)
from test_framework.util import (
assert_not_equal,
MAX_NODES,
p2p_port,
wait_until_helper_internal,
@@ -897,7 +898,7 @@ class P2PDataStore(P2PInterface):
if success:
self.wait_until(lambda: node.getbestblockhash() == blocks[-1].hash, timeout=timeout)
else:
assert node.getbestblockhash() != blocks[-1].hash
assert_not_equal(node.getbestblockhash(), blocks[-1].hash)
def send_txs_and_test(self, txs, node, *, success=True, expect_disconnect=False, reject_reason=None):
"""Send txs to test node and test whether they're accepted to the mempool.