|
44 | 44 | from test_framework.test_framework import BitcoinTestFramework
|
45 | 45 | from test_framework.util import (
|
46 | 46 | assert_equal,
|
| 47 | + assert_greater_than_or_equal, |
47 | 48 | assert_is_hex_string,
|
48 | 49 | assert_raises_rpc_error,
|
49 | 50 | try_rpc,
|
@@ -124,11 +125,11 @@ def run_test(self):
|
124 | 125 | self.log.info("Verify sigops are counted in GBT with pre-BIP141 rules before the fork")
|
125 | 126 | txid = self.nodes[0].sendtoaddress(self.nodes[0].getnewaddress(), 1)
|
126 | 127 | tmpl = self.nodes[0].getblocktemplate({'rules': ['segwit']})
|
127 |
| - assert tmpl['sizelimit'] == 1000000 |
| 128 | + assert_equal(tmpl['sizelimit'], 1000000) |
128 | 129 | assert 'weightlimit' not in tmpl
|
129 |
| - assert tmpl['sigoplimit'] == 20000 |
130 |
| - assert tmpl['transactions'][0]['hash'] == txid |
131 |
| - assert tmpl['transactions'][0]['sigops'] == 2 |
| 130 | + assert_equal(tmpl['sigoplimit'], 20000) |
| 131 | + assert_equal(tmpl['transactions'][0]['hash'], txid) |
| 132 | + assert_equal(tmpl['transactions'][0]['sigops'], 2) |
132 | 133 | assert '!segwit' not in tmpl['rules']
|
133 | 134 | self.generate(self.nodes[0], 1) # block 162
|
134 | 135 |
|
@@ -232,11 +233,11 @@ def run_test(self):
|
232 | 233 | self.log.info("Verify sigops are counted in GBT with BIP141 rules after the fork")
|
233 | 234 | txid = self.nodes[0].sendtoaddress(self.nodes[0].getnewaddress(), 1)
|
234 | 235 | tmpl = self.nodes[0].getblocktemplate({'rules': ['segwit']})
|
235 |
| - assert tmpl['sizelimit'] >= 3999577 # actual maximum size is lower due to minimum mandatory non-witness data |
236 |
| - assert tmpl['weightlimit'] == 4000000 |
237 |
| - assert tmpl['sigoplimit'] == 80000 |
238 |
| - assert tmpl['transactions'][0]['txid'] == txid |
239 |
| - assert tmpl['transactions'][0]['sigops'] == 8 |
| 236 | + assert_greater_than_or_equal(tmpl['sizelimit'], 3999577) # actual maximum size is lower due to minimum mandatory non-witness data |
| 237 | + assert_equal(tmpl['weightlimit'], 4000000) |
| 238 | + assert_equal(tmpl['sigoplimit'], 80000) |
| 239 | + assert_equal(tmpl['transactions'][0]['txid'], txid) |
| 240 | + assert_equal(tmpl['transactions'][0]['sigops'], 8) |
240 | 241 | assert '!segwit' in tmpl['rules']
|
241 | 242 |
|
242 | 243 | self.generate(self.nodes[0], 1) # Mine a block to clear the gbt cache
|
|
0 commit comments