Merge #9843: Fix segwit getblocktemplate test
b23dcd2
Fix segwit getblocktemplate test. (John Newbery)
Tree-SHA512: db87a99432397bd9aa3b66580a92a69467aa4c8a9e3a191629429f80137a59f6ecb13d129d880ebe404d903e13b153aca3ca99e3b1a94e171a4b8a50fb690f3f
This commit is contained in:
commit
c78adbf450
1 changed files with 2 additions and 13 deletions
|
@ -248,20 +248,9 @@ class SegWitTest(BitcoinTestFramework):
|
||||||
assert(tmpl['transactions'][0]['txid'] == txid)
|
assert(tmpl['transactions'][0]['txid'] == txid)
|
||||||
assert(tmpl['transactions'][0]['sigops'] == 8)
|
assert(tmpl['transactions'][0]['sigops'] == 8)
|
||||||
|
|
||||||
print("Verify non-segwit miners get a valid GBT response after the fork")
|
print("Non-segwit miners are not able to use GBT response after activation.")
|
||||||
send_to_witness(1, self.nodes[0], find_unspent(self.nodes[0], 50), self.pubkey[0], False, Decimal("49.998"))
|
send_to_witness(1, self.nodes[0], find_unspent(self.nodes[0], 50), self.pubkey[0], False, Decimal("49.998"))
|
||||||
try:
|
assert_raises_jsonrpc(-8, "Support for 'segwit' rule requires explicit client support", self.nodes[0].getblocktemplate, {})
|
||||||
tmpl = self.nodes[0].getblocktemplate({})
|
|
||||||
assert(len(tmpl['transactions']) == 1) # Doesn't include witness tx
|
|
||||||
assert(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(('!segwit' in tmpl['rules']) or ('segwit' not in tmpl['rules']))
|
|
||||||
except JSONRPCException:
|
|
||||||
# This is an acceptable outcome
|
|
||||||
pass
|
|
||||||
|
|
||||||
print("Verify behaviour of importaddress, addwitnessaddress and listunspent")
|
print("Verify behaviour of importaddress, addwitnessaddress and listunspent")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue