diff --git a/qa/rpc-tests/cryptoconditions.py b/qa/rpc-tests/cryptoconditions.py index 97b41fd12..36126cfc5 100755 --- a/qa/rpc-tests/cryptoconditions.py +++ b/qa/rpc-tests/cryptoconditions.py @@ -66,6 +66,7 @@ class CryptoConditionsTest (BitcoinTestFramework): # basic sanity tests assert_equal(result['txcount'], 101) assert_greater_than(result['balance'], 0.0) + balance = result['balance'] # Begin actual CC tests @@ -79,15 +80,34 @@ class CryptoConditionsTest (BitcoinTestFramework): result = rpc.faucetinfo() assert_equal(result['result'], 'success') - result = rpc.faucetfund("1") - assert_equal(result['result'], 'success') - result = rpc.faucetfund("0") assert_equal(result['result'], 'error') result = rpc.faucetfund("-1") assert_equal(result['result'], 'error') + result = rpc.faucetfund("1") + assert_equal(result['result'], 'success') + assert result['hex'], "hex key found" + + result = rpc.sendrawtransaction(result['hex']) + txid = result[0] + assert txid, "found txid" + + # we need the tx above to be confirmed in the next block + rpc.generate(1) + + # clear the rawmempool + rpc.getrawmempool() + result = rpc.getwalletinfo() + + # make sure our balance is less now + assert_greater_than(balance, result['balance']) + + result = rpc.faucetinfo() + assert_equal(result['result'], 'success') + assert_greater_than( result['funding'], 0 ) + # Dice tests dice = rpc.diceaddress() assert_equal(dice['result'], 'success')