mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-24 13:45:52 +00:00
refactor: Duplicate ledger_index pattern for RPC handlers (#2755)
Co-authored-by: Ayaz Salikhov <mathbunnyru@users.noreply.github.com>
This commit is contained in:
@@ -110,13 +110,8 @@ tag_invoke(boost::json::value_to_tag<TransactionEntryHandler::Input>, boost::jso
|
||||
if (jsonObject.contains(JS(ledger_hash)))
|
||||
input.ledgerHash = boost::json::value_to<std::string>(jv.at(JS(ledger_hash)));
|
||||
|
||||
if (jsonObject.contains(JS(ledger_index))) {
|
||||
if (!jsonObject.at(JS(ledger_index)).is_string()) {
|
||||
input.ledgerIndex = util::integralValueAs<uint32_t>(jv.at(JS(ledger_index)));
|
||||
} else if (jsonObject.at(JS(ledger_index)).as_string() != "validated") {
|
||||
input.ledgerIndex = std::stoi(boost::json::value_to<std::string>(jv.at(JS(ledger_index))));
|
||||
}
|
||||
}
|
||||
if (jsonObject.contains(JS(ledger_index)))
|
||||
input.ledgerIndex = util::getLedgerIndex(jv.at(JS(ledger_index)));
|
||||
|
||||
return input;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user