Skip to content

Commit c78adbf

Browse files
committed
Merge #9843: Fix segwit getblocktemplate test
b23dcd2 Fix segwit getblocktemplate test. (John Newbery) Tree-SHA512: db87a99432397bd9aa3b66580a92a69467aa4c8a9e3a191629429f80137a59f6ecb13d129d880ebe404d903e13b153aca3ca99e3b1a94e171a4b8a50fb690f3f
2 parents 4df8213 + b23dcd2 commit c78adbf

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

qa/rpc-tests/segwit.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -248,20 +248,9 @@ def run_test(self):
248248
assert(tmpl['transactions'][0]['txid'] == txid)
249249
assert(tmpl['transactions'][0]['sigops'] == 8)
250250

251-
print("Verify non-segwit miners get a valid GBT response after the fork")
251+
print("Non-segwit miners are not able to use GBT response after activation.")
252252
send_to_witness(1, self.nodes[0], find_unspent(self.nodes[0], 50), self.pubkey[0], False, Decimal("49.998"))
253-
try:
254-
tmpl = self.nodes[0].getblocktemplate({})
255-
assert(len(tmpl['transactions']) == 1) # Doesn't include witness tx
256-
assert(tmpl['sizelimit'] == 1000000)
257-
assert('weightlimit' not in tmpl)
258-
assert(tmpl['sigoplimit'] == 20000)
259-
assert(tmpl['transactions'][0]['hash'] == txid)
260-
assert(tmpl['transactions'][0]['sigops'] == 2)
261-
assert(('!segwit' in tmpl['rules']) or ('segwit' not in tmpl['rules']))
262-
except JSONRPCException:
263-
# This is an acceptable outcome
264-
pass
253+
assert_raises_jsonrpc(-8, "Support for 'segwit' rule requires explicit client support", self.nodes[0].getblocktemplate, {})
265254

266255
print("Verify behaviour of importaddress, addwitnessaddress and listunspent")
267256

0 commit comments

Comments
 (0)