qa: Use custom assert_greater_than() over naked assert
What changed, and why it matters
This is a tiny test-only cleanup that swaps a plain Python assert for a custom helper that prints better error messages when a test fails. It does not change any production code, network behavior, or security logic.
No security action needed. Treat as a normal test-quality refactor.
Security signals we found
No strong security signals were identified.
Evidence from the diff
In test/functional/p2p_opportunistic_1p1c.py, the assertion assert a > b was replaced with assert_greater_than(a, b). Both expressions evaluate the same comparison; the helper only improves diagnostic output on failure. No runtime behavior of Bitcoin Core is affected.
Changed components
test/functional/p2p_opportunistic_1p1c.pyInspect captured patch +1 / −1
diff --git a/test/functional/p2p_opportunistic_1p1c.py b/test/functional/p2p_opportunistic_1p1c.py
index f1d42d10..77616de1 100755
--- a/test/functional/p2p_opportunistic_1p1c.py
+++ b/test/functional/p2p_opportunistic_1p1c.py
@@ -63,7 +63,7 @@ def cleanup(func):
self.nodes[0].disconnect_p2ps()
# Do not clear the node's mempool, as each test requires mempool min feerate > min
# relay feerate. However, do check that this is the case.
- assert self.nodes[0].getmempoolinfo()["mempoolminfee"] > self.nodes[0].getnetworkinfo()["relayfee"]
+ assert_greater_than(self.nodes[0].getmempoolinfo()["mempoolminfee"], self.nodes[0].getnetworkinfo()["relayfee"])
# Ensure we do not try to spend the same UTXOs in subsequent tests, as they will look like RBF attempts.
self.wallet.rescan_utxos(include_mempool=True)
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.