mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
scripted-diff: Use getInt<T> over get_int/get_int64
-BEGIN VERIFY SCRIPT- sed -i 's|\<get_int64\>|getInt<int64_t>|g' $(git grep -l get_int ':(exclude)src/univalue') sed -i 's|\<get_int\>|getInt<int>|g' $(git grep -l get_int ':(exclude)src/univalue') -END VERIFY SCRIPT-
This commit is contained in:
@@ -337,7 +337,7 @@ UniValue DescribeAddress(const CTxDestination& dest)
|
||||
|
||||
unsigned int ParseConfirmTarget(const UniValue& value, unsigned int max_target)
|
||||
{
|
||||
const int target{value.get_int()};
|
||||
const int target{value.getInt<int>()};
|
||||
const unsigned int unsigned_target{static_cast<unsigned int>(target)};
|
||||
if (target < 1 || unsigned_target > max_target) {
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Invalid conf_target, must be between %u and %u", 1, max_target));
|
||||
@@ -1023,11 +1023,11 @@ std::string RPCArg::ToString(const bool oneline) const
|
||||
static std::pair<int64_t, int64_t> ParseRange(const UniValue& value)
|
||||
{
|
||||
if (value.isNum()) {
|
||||
return {0, value.get_int64()};
|
||||
return {0, value.getInt<int64_t>()};
|
||||
}
|
||||
if (value.isArray() && value.size() == 2 && value[0].isNum() && value[1].isNum()) {
|
||||
int64_t low = value[0].get_int64();
|
||||
int64_t high = value[1].get_int64();
|
||||
int64_t low = value[0].getInt<int64_t>();
|
||||
int64_t high = value[1].getInt<int64_t>();
|
||||
if (low > high) throw JSONRPCError(RPC_INVALID_PARAMETER, "Range specified as [begin,end] must not have begin after end");
|
||||
return {low, high};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user