mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
Fix RPC failure testing (2 of 2)
Commit 9db8eecac1 improved the
assert_raises_jsonrpc() function for better testing of RPC failure
modes. This commit completes the job by removing remaining broken
try-except RPC testing from the individual test cases and replacing it
with calls to assert_raises_jsonrpc().
This commit is contained in:
@@ -105,7 +105,7 @@ class GetBlockTemplateProposalTest(BitcoinTestFramework):
|
||||
|
||||
# Test 3: Truncated final tx
|
||||
lastbyte = txlist[-1].pop()
|
||||
assert_raises(JSONRPCException, assert_template, node, tmpl, txlist, 'n/a')
|
||||
assert_raises_jsonrpc(-22, "Block decode failed", assert_template, node, tmpl, txlist, 'n/a')
|
||||
txlist[-1].append(lastbyte)
|
||||
|
||||
# Test 4: Add an invalid tx to the end (duplicate of gen tx)
|
||||
@@ -126,7 +126,7 @@ class GetBlockTemplateProposalTest(BitcoinTestFramework):
|
||||
|
||||
# Test 7: Bad tx count
|
||||
txlist.append(b'')
|
||||
assert_raises(JSONRPCException, assert_template, node, tmpl, txlist, 'n/a')
|
||||
assert_raises_jsonrpc(-22, 'Block decode failed', assert_template, node, tmpl, txlist, 'n/a')
|
||||
txlist.pop()
|
||||
|
||||
# Test 8: Bad bits
|
||||
|
||||
Reference in New Issue
Block a user