diff --git a/qa/rpc-tests/cryptoconditions.py b/qa/rpc-tests/cryptoconditions.py index 23c6479fe..b99d31216 100755 --- a/qa/rpc-tests/cryptoconditions.py +++ b/qa/rpc-tests/cryptoconditions.py @@ -68,7 +68,7 @@ class CryptoConditionsTest (BitcoinTestFramework): assert_greater_than(result['balance'], 0.0) balance = result['balance'] - # Begin actual CC tests + ###### Begin actual CC tests ###### # Faucet tests faucet = rpc.faucetaddress() @@ -77,6 +77,10 @@ class CryptoConditionsTest (BitcoinTestFramework): for x in ['myCCaddress', 'FaucetCCaddress', 'Faucetmarker', 'myaddress']: assert_equal(faucet[x][0], 'R') + # no funds in the faucet yet + result = rpc.faucetget() + assert_equal(result['result'], 'error') + result = rpc.faucetinfo() assert_equal(result['result'], 'success') @@ -86,9 +90,6 @@ class CryptoConditionsTest (BitcoinTestFramework): result = rpc.faucetfund("-1") assert_equal(result['result'], 'error') - # why does this fail? - #result = rpc.faucetfund("1987") - # we need at least 1 + txfee to get result = rpc.faucetfund("2") assert_equal(result['result'], 'success') diff --git a/src/cc/faucet.cpp b/src/cc/faucet.cpp index 403b56c3e..6cfa9c941 100644 --- a/src/cc/faucet.cpp +++ b/src/cc/faucet.cpp @@ -169,7 +169,7 @@ std::string FaucetGet(uint64_t txfee) mtx.vout.push_back(CTxOut(nValue,CScript() << ParseHex(HexStr(mypk)) << OP_CHECKSIG)); return(FinalizeCCTx(-1LL,cp,mtx,mypk,txfee,opret)); } else fprintf(stderr,"cant find faucet inputs\n"); - return(0); + return(""); } std::string FaucetFund(uint64_t txfee,int64_t funds) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 142b7696c..10b1f1676 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -5179,7 +5179,10 @@ UniValue faucetget(const UniValue& params, bool fHelp) { result.push_back(Pair("result", "success")); result.push_back(Pair("hex", hex)); - } else result.push_back(Pair("error", "couldnt create faucet get transaction")); + } else { + result.push_back(Pair("result", "error")); + result.push_back(Pair("error", "couldnt create faucet get transaction")); + } return(result); }