aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2021-09-28 10:58:24 +0200
committerMarcoFalke <falke.marco@gmail.com>2021-09-28 10:48:51 +0200
commitfac5708afc03ab18ce2bd25039ca2032c5187f5c (patch)
tree86b02b32376a9d5087cf25e9dd1e78448ab098cf
parenta9d0cec4991ab057557af9992daa4c8146a9b9d0 (diff)
test: Use assert_equal over assert for easier debugging
-rwxr-xr-xtest/functional/feature_segwit.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/test/functional/feature_segwit.py b/test/functional/feature_segwit.py
index 79254546f1..cacc5d48b5 100755
--- a/test/functional/feature_segwit.py
+++ b/test/functional/feature_segwit.py
@@ -44,6 +44,7 @@ from test_framework.script_util import (
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
assert_equal,
+ assert_greater_than_or_equal,
assert_is_hex_string,
assert_raises_rpc_error,
try_rpc,
@@ -124,11 +125,11 @@ class SegWitTest(BitcoinTestFramework):
self.log.info("Verify sigops are counted in GBT with pre-BIP141 rules before the fork")
txid = self.nodes[0].sendtoaddress(self.nodes[0].getnewaddress(), 1)
tmpl = self.nodes[0].getblocktemplate({'rules': ['segwit']})
- assert tmpl['sizelimit'] == 1000000
+ assert_equal(tmpl['sizelimit'], 1000000)
assert 'weightlimit' not in tmpl
- assert tmpl['sigoplimit'] == 20000
- assert tmpl['transactions'][0]['hash'] == txid
- assert tmpl['transactions'][0]['sigops'] == 2
+ assert_equal(tmpl['sigoplimit'], 20000)
+ assert_equal(tmpl['transactions'][0]['hash'], txid)
+ assert_equal(tmpl['transactions'][0]['sigops'], 2)
assert '!segwit' not in tmpl['rules']
self.generate(self.nodes[0], 1) # block 162
@@ -232,11 +233,11 @@ class SegWitTest(BitcoinTestFramework):
self.log.info("Verify sigops are counted in GBT with BIP141 rules after the fork")
txid = self.nodes[0].sendtoaddress(self.nodes[0].getnewaddress(), 1)
tmpl = self.nodes[0].getblocktemplate({'rules': ['segwit']})
- assert tmpl['sizelimit'] >= 3999577 # actual maximum size is lower due to minimum mandatory non-witness data
- assert tmpl['weightlimit'] == 4000000
- assert tmpl['sigoplimit'] == 80000
- assert tmpl['transactions'][0]['txid'] == txid
- assert tmpl['transactions'][0]['sigops'] == 8
+ assert_greater_than_or_equal(tmpl['sizelimit'], 3999577) # actual maximum size is lower due to minimum mandatory non-witness data
+ assert_equal(tmpl['weightlimit'], 4000000)
+ assert_equal(tmpl['sigoplimit'], 80000)
+ assert_equal(tmpl['transactions'][0]['txid'], txid)
+ assert_equal(tmpl['transactions'][0]['sigops'], 8)
assert '!segwit' in tmpl['rules']
self.generate(self.nodes[0], 1) # Mine a block to clear the gbt cache