aboutsummaryrefslogtreecommitdiff
path: root/qa/rpc-tests/bipdersig.py
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2017-03-07 14:08:59 -0500
committerJohn Newbery <john@johnnewbery.com>2017-03-15 11:56:25 -0400
commitc9bd0f64212cd600daf30c9c59035bfe9f07b81b (patch)
tree9f587fadcbbd92fb983a770af4a1cf5084bc8b01 /qa/rpc-tests/bipdersig.py
parentce01e6226ce52b88c644b0cb89852278edbdf33b (diff)
Fix RPC failure testing (2 of 2)
Commit 9db8eecac1c713c760c0217b6acb7455c657fa8b 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().
Diffstat (limited to 'qa/rpc-tests/bipdersig.py')
-rwxr-xr-xqa/rpc-tests/bipdersig.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/qa/rpc-tests/bipdersig.py b/qa/rpc-tests/bipdersig.py
index fa54bc2749..371cc41bb7 100755
--- a/qa/rpc-tests/bipdersig.py
+++ b/qa/rpc-tests/bipdersig.py
@@ -68,12 +68,8 @@ class BIP66Test(BitcoinTestFramework):
if (self.nodes[0].getblockcount() != cnt + 1051):
raise AssertionError("Failed to mine a version=3 block")
- # Mine 1 old-version blocks
- try:
- self.nodes[1].generate(1)
- raise AssertionError("Succeeded to mine a version=2 block after 950 version=3 blocks")
- except JSONRPCException:
- pass
+ # Mine 1 old-version blocks. This should fail
+ assert_raises_jsonrpc(-1, "CreateNewBlock: TestBlockValidity failed: bad-version(0x00000002)", self.nodes[1].generate, 1)
self.sync_all()
if (self.nodes[0].getblockcount() != cnt + 1051):
raise AssertionError("Accepted a version=2 block after 950 version=3 blocks")