From e4452dc2dd021223e5376def0b8011c587b38ddf Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Thu, 23 Aug 2018 04:22:11 +0200 Subject: [PATCH] Get tests passing again, by changing our test to check for an exception, which is the new behavior --- qa/rpc-tests/cryptoconditions.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/qa/rpc-tests/cryptoconditions.py b/qa/rpc-tests/cryptoconditions.py index 3b4700858..21dc96560 100755 --- a/qa/rpc-tests/cryptoconditions.py +++ b/qa/rpc-tests/cryptoconditions.py @@ -5,7 +5,7 @@ from test_framework.test_framework import BitcoinTestFramework from test_framework.authproxy import JSONRPCException -from test_framework.util import assert_equal, assert_greater_than, \ +from test_framework.util import assert_equal, assert_raises, assert_greater_than, \ initialize_chain_clean, initialize_chain, start_nodes, start_node, connect_nodes_bi, \ stop_nodes, sync_blocks, sync_mempools, wait_bitcoinds, rpc_port @@ -117,10 +117,16 @@ class CryptoConditionsTest (BitcoinTestFramework): assert_equal(result['result'], 'success') assert result['hex'], "hex key found" - # broadcast the xtn - result = rpc.sendrawtransaction(result['hex']) - txid = result[0] - assert txid, "found txid" + # try to broadcast the xtn, but we will get 'faucet is only for brand new addresses' + assert_raises(JSONRPCException, rpc.sendrawtransaction, [ result['hex'] ]) + + newaddr = rpc.getnewaddress() + assert newaddr, "got a new address" + result = rpc.validateaddress(newaddr) + newpubkey = result['pubkey'] + assert newpubkey, "got a pubkey for new address" + + # TODO: stop this node, restart with diff pubkey # confirm above tx rpc.generate(1)