mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01: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:
@@ -37,7 +37,7 @@ void RPCTypeCheckObj(const UniValue& o,
|
||||
bool fStrict)
|
||||
{
|
||||
for (const auto& t : typesExpected) {
|
||||
const UniValue& v = find_value(o, t.first);
|
||||
const UniValue& v = o.find_value(t.first);
|
||||
if (!fAllowNull && v.isNull())
|
||||
throw JSONRPCError(RPC_TYPE_ERROR, strprintf("Missing %s", t.first));
|
||||
|
||||
@@ -81,7 +81,7 @@ uint256 ParseHashV(const UniValue& v, std::string strName)
|
||||
}
|
||||
uint256 ParseHashO(const UniValue& o, std::string strKey)
|
||||
{
|
||||
return ParseHashV(find_value(o, strKey), strKey);
|
||||
return ParseHashV(o.find_value(strKey), strKey);
|
||||
}
|
||||
std::vector<unsigned char> ParseHexV(const UniValue& v, std::string strName)
|
||||
{
|
||||
@@ -94,7 +94,7 @@ std::vector<unsigned char> ParseHexV(const UniValue& v, std::string strName)
|
||||
}
|
||||
std::vector<unsigned char> ParseHexO(const UniValue& o, std::string strKey)
|
||||
{
|
||||
return ParseHexV(find_value(o, strKey), strKey);
|
||||
return ParseHexV(o.find_value(strKey), strKey);
|
||||
}
|
||||
|
||||
namespace {
|
||||
@@ -1133,10 +1133,10 @@ std::vector<CScript> EvalDescriptorStringOrObject(const UniValue& scanobject, Fl
|
||||
if (scanobject.isStr()) {
|
||||
desc_str = scanobject.get_str();
|
||||
} else if (scanobject.isObject()) {
|
||||
UniValue desc_uni = find_value(scanobject, "desc");
|
||||
UniValue desc_uni = scanobject.find_value("desc");
|
||||
if (desc_uni.isNull()) throw JSONRPCError(RPC_INVALID_PARAMETER, "Descriptor needs to be provided in scan object");
|
||||
desc_str = desc_uni.get_str();
|
||||
UniValue range_uni = find_value(scanobject, "range");
|
||||
UniValue range_uni = scanobject.find_value("range");
|
||||
if (!range_uni.isNull()) {
|
||||
range = ParseDescriptorRange(range_uni);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user