mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-30 18:35:54 +02:00
scripted-diff: Use UniValue::find_value method
-BEGIN VERIFY SCRIPT- sed --regexp-extended -i 's/find_value\(([^ ,]+), /\1.find_value(/g' $(git grep -l find_value) -END VERIFY SCRIPT-
This commit is contained in:
@@ -249,7 +249,7 @@ bool RPCConsole::RPCParseCommandLine(interfaces::Node* node, std::string &strRes
|
||||
subelement = lastResult[parsed.value()];
|
||||
}
|
||||
else if (lastResult.isObject())
|
||||
subelement = find_value(lastResult, curarg);
|
||||
subelement = lastResult.find_value(curarg);
|
||||
else
|
||||
throw std::runtime_error("Invalid result query"); //no array or object: abort
|
||||
lastResult = subelement;
|
||||
@@ -448,8 +448,8 @@ void RPCExecutor::request(const QString &command, const WalletModel* wallet_mode
|
||||
{
|
||||
try // Nice formatting for standard-format error
|
||||
{
|
||||
int code = find_value(objError, "code").getInt<int>();
|
||||
std::string message = find_value(objError, "message").get_str();
|
||||
int code = objError.find_value("code").getInt<int>();
|
||||
std::string message = objError.find_value("message").get_str();
|
||||
Q_EMIT reply(RPCConsole::CMD_ERROR, QString::fromStdString(message) + " (code " + QString::number(code) + ")");
|
||||
}
|
||||
catch (const std::runtime_error&) // raised when converting to invalid type, i.e. missing code or message
|
||||
|
||||
Reference in New Issue
Block a user