rpc_wallet_tests: changed "Insufficient funds" error message to a proper "Insufficient transparent funds". This is because we are now throwing the insufficient transparent balance rpc error inside load_utxo.

This commit is contained in:
furszy 2020-11-01 12:08:04 -03:00
parent 3a1b51900c
commit ca9fc49fc4
No known key found for this signature in database
GPG Key ID: 5DD23CCC686AA623
3 changed files with 4 additions and 3 deletions

View File

@ -84,7 +84,7 @@ class WalletShieldingCoinbaseTest (BitcoinTestFramework):
recipients= [{"address":myzaddr, "amount": Decimal('1')}]
myopid = self.nodes[3].z_sendmany(mytaddr, recipients)
wait_and_assert_operationid_status(self.nodes[3], myopid, "failed", "Insufficient funds, no UTXOs found for taddr from address.", 10)
wait_and_assert_operationid_status(self.nodes[3], myopid, "failed", "Insufficient transparent funds, no UTXOs found for taddr from address.", 10)
# This send will fail because our wallet does not allow any change when shielding a coinbase utxo,
# as it's currently not possible to specify a change address in z_sendmany.

View File

@ -240,7 +240,7 @@ bool AsyncRPCOperation_sendmany::main_impl() {
if (!useanyutxo_ && isSingleZaddrOutput) {
bool b = find_utxos(true, txValues);
if (!b) {
throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, "Insufficient funds, no UTXOs found for taddr from address.");
throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, "Insufficient transparent funds, no UTXOs found for taddr from address.");
}
} else {
bool b = find_utxos(false, txValues);
@ -851,6 +851,7 @@ bool AsyncRPCOperation_sendmany::find_utxos(bool fAcceptCoinbase, TxValues& txVa
true, // fOnlySpendable
mindepth_, // nMinDepth
&destinations); // onlyFilterByDests
if (t_inputs_.empty()) return false;
// sort in ascending order, so smaller utxos appear first
std::sort(t_inputs_.begin(), t_inputs_.end(), [](const COutput& i, const COutput& j) -> bool {

View File

@ -1209,7 +1209,7 @@ BOOST_AUTO_TEST_CASE(rpc_z_sendmany_internals)
operation->main();
BOOST_CHECK(operation->isFailed());
std::string msg = operation->getErrorMessage();
BOOST_CHECK( msg.find("Insufficient funds, no UTXOs found") != string::npos);
BOOST_CHECK( msg.find("Insufficient transparent funds") != string::npos);
}
// minconf cannot be zero when sending from zaddr