Skip to content

Commit f82c709

Browse files
committed
[tests] clarify assertions in getblocktemplate test
1 parent 66c570a commit f82c709

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

test/functional/getblocktemplate_proposals.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ def template_to_hex(tmpl, txlist):
6464

6565
def assert_template(node, tmpl, txlist, expect):
6666
rsp = node.getblocktemplate({'data': template_to_hex(tmpl, txlist), 'mode': 'proposal'})
67-
if rsp != expect:
68-
raise AssertionError('unexpected: %s' % (rsp,))
67+
assert_equal(rsp, expect)
6968

7069
class GetBlockTemplateProposalTest(BitcoinTestFramework):
7170

@@ -88,7 +87,7 @@ def run_test(self):
8887
txlist = [bytearray(coinbase_tx.serialize())]
8988

9089
self.log.info("getblocktemplate: Test capability advertised")
91-
assert('proposal' in tmpl['capabilities'])
90+
assert 'proposal' in tmpl['capabilities']
9291

9392
self.log.info("getblocktemplate: Test bad input hash for coinbase transaction")
9493
txlist[0][4 + 1] += 1
@@ -131,8 +130,7 @@ def run_test(self):
131130
rawtmpl = template_to_bytearray(tmpl, txlist)
132131
rawtmpl[4 + 32] = (rawtmpl[4 + 32] + 1) % 0x100
133132
rsp = node.getblocktemplate({'data': b2x(rawtmpl), 'mode': 'proposal'})
134-
if rsp != 'bad-txnmrklroot':
135-
raise AssertionError('unexpected: %s' % (rsp,))
133+
assert_equal(rsp, 'bad-txnmrklroot')
136134

137135
self.log.info("getblocktemplate: Test bad timestamps")
138136
realtime = tmpl['curtime']

0 commit comments

Comments
 (0)