diff options
author | John Newbery <john@johnnewbery.com> | 2017-03-07 14:08:59 -0500 |
---|---|---|
committer | John Newbery <john@johnnewbery.com> | 2017-03-15 11:56:25 -0400 |
commit | c9bd0f64212cd600daf30c9c59035bfe9f07b81b (patch) | |
tree | 9f587fadcbbd92fb983a770af4a1cf5084bc8b01 /qa/rpc-tests/prioritise_transaction.py | |
parent | ce01e6226ce52b88c644b0cb89852278edbdf33b (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/prioritise_transaction.py')
-rwxr-xr-x | qa/rpc-tests/prioritise_transaction.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/qa/rpc-tests/prioritise_transaction.py b/qa/rpc-tests/prioritise_transaction.py index 10f596b2cb..0b04ad17ab 100755 --- a/qa/rpc-tests/prioritise_transaction.py +++ b/qa/rpc-tests/prioritise_transaction.py @@ -107,13 +107,9 @@ class PrioritiseTransactionTest(BitcoinTestFramework): tx_hex = self.nodes[0].signrawtransaction(raw_tx)["hex"] tx_id = self.nodes[0].decoderawtransaction(tx_hex)["txid"] - try: - self.nodes[0].sendrawtransaction(tx_hex) - except JSONRPCException as exp: - assert_equal(exp.error['code'], -26) # insufficient fee - assert(tx_id not in self.nodes[0].getrawmempool()) - else: - assert(False) + # This will raise an exception due to min relay fee not being met + assert_raises_jsonrpc(-26, "66: min relay fee not met", self.nodes[0].sendrawtransaction, tx_hex) + assert(tx_id not in self.nodes[0].getrawmempool()) # This is a less than 1000-byte transaction, so just set the fee # to be the minimum for a 1000 byte transaction and check that it is |