mirror of
https://github.com/XRPLF/clio.git
synced 2025-12-06 17:27:58 +00:00
@@ -85,8 +85,8 @@ public:
|
||||
|
||||
private:
|
||||
class HandlerImpl final {
|
||||
std::map<std::string, BookChange> tally_ = {};
|
||||
std::optional<uint32_t> offerCancel_ = {};
|
||||
std::map<std::string, BookChange> tally_;
|
||||
std::optional<uint32_t> offerCancel_;
|
||||
|
||||
public:
|
||||
[[nodiscard]] std::vector<BookChange>
|
||||
@@ -154,7 +154,11 @@ private:
|
||||
auto const g = to_string(deltaGets.issue());
|
||||
auto const p = to_string(deltaPays.issue());
|
||||
|
||||
auto const noswap = isXRP(deltaGets) ? true : (isXRP(deltaPays) ? false : (g < p));
|
||||
auto const noswap = [&]() {
|
||||
if (isXRP(deltaGets))
|
||||
return true;
|
||||
return isXRP(deltaPays) ? false : (g < p);
|
||||
}();
|
||||
|
||||
auto first = noswap ? deltaGets : deltaPays;
|
||||
auto second = noswap ? deltaPays : deltaGets;
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
#include <boost/json/object.hpp>
|
||||
#include <boost/json/value.hpp>
|
||||
#include <boost/json/value_to.hpp>
|
||||
#include <ripple/protocol/ErrorCodes.h>
|
||||
|
||||
#include <expected>
|
||||
#include <functional>
|
||||
|
||||
@@ -196,10 +196,7 @@ accountFromStringStrict(std::string const& account)
|
||||
result = ripple::parseBase58<ripple::AccountID>(account);
|
||||
}
|
||||
|
||||
if (result) {
|
||||
return result.value();
|
||||
}
|
||||
return {};
|
||||
return result;
|
||||
}
|
||||
|
||||
std::pair<std::shared_ptr<ripple::STTx const>, std::shared_ptr<ripple::STObject const>>
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include "rpc/common/Types.hpp"
|
||||
|
||||
#include <boost/json/value.hpp>
|
||||
#include <ripple/protocol/ErrorCodes.h>
|
||||
|
||||
#include <string_view>
|
||||
|
||||
|
||||
@@ -120,10 +120,10 @@ struct VoidOutput {};
|
||||
*/
|
||||
struct Context {
|
||||
boost::asio::yield_context yield;
|
||||
std::shared_ptr<web::ConnectionBase> session = {};
|
||||
std::shared_ptr<web::ConnectionBase> session = {}; // NOLINT(readability-redundant-member-init)
|
||||
bool isAdmin = false;
|
||||
std::string clientIp = {};
|
||||
uint32_t apiVersion = 0u; // invalid by default
|
||||
std::string clientIp = {}; // NOLINT(readability-redundant-member-init)
|
||||
uint32_t apiVersion = 0u; // invalid by default
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
#include <fmt/core.h>
|
||||
#include <ripple/basics/base_uint.h>
|
||||
#include <ripple/protocol/AccountID.h>
|
||||
#include <ripple/protocol/ErrorCodes.h>
|
||||
#include <ripple/protocol/UintTypes.h>
|
||||
#include <ripple/protocol/tokens.h>
|
||||
|
||||
|
||||
@@ -77,19 +77,19 @@ public:
|
||||
std::expected<uint32_t, std::string>
|
||||
parse(boost::json::object const& request) const override;
|
||||
|
||||
inline uint32_t
|
||||
uint32_t
|
||||
getDefaultVersion() const
|
||||
{
|
||||
return defaultVersion_;
|
||||
}
|
||||
|
||||
inline uint32_t
|
||||
uint32_t
|
||||
getMinVersion() const
|
||||
{
|
||||
return minVersion_;
|
||||
}
|
||||
|
||||
inline uint32_t
|
||||
uint32_t
|
||||
getMaxVersion() const
|
||||
{
|
||||
return maxVersion_;
|
||||
|
||||
@@ -40,7 +40,6 @@
|
||||
#include <ripple/basics/strHex.h>
|
||||
#include <ripple/protocol/AMMCore.h>
|
||||
#include <ripple/protocol/AccountID.h>
|
||||
#include <ripple/protocol/ErrorCodes.h>
|
||||
#include <ripple/protocol/Indexes.h>
|
||||
#include <ripple/protocol/Issue.h>
|
||||
#include <ripple/protocol/LedgerHeader.h>
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
#include <ripple/basics/base_uint.h>
|
||||
#include <ripple/basics/strHex.h>
|
||||
#include <ripple/protocol/AccountID.h>
|
||||
#include <ripple/protocol/ErrorCodes.h>
|
||||
#include <ripple/protocol/Indexes.h>
|
||||
#include <ripple/protocol/LedgerFormats.h>
|
||||
#include <ripple/protocol/LedgerHeader.h>
|
||||
@@ -67,16 +66,16 @@ AccountChannelsHandler::addChannel(std::vector<ChannelResponse>& jsonChannels, r
|
||||
}
|
||||
|
||||
if (auto const& v = channelSle[~ripple::sfExpiration])
|
||||
channel.expiration = *v;
|
||||
channel.expiration = v;
|
||||
|
||||
if (auto const& v = channelSle[~ripple::sfCancelAfter])
|
||||
channel.cancelAfter = *v;
|
||||
channel.cancelAfter = v;
|
||||
|
||||
if (auto const& v = channelSle[~ripple::sfSourceTag])
|
||||
channel.sourceTag = *v;
|
||||
channel.sourceTag = v;
|
||||
|
||||
if (auto const& v = channelSle[~ripple::sfDestinationTag])
|
||||
channel.destinationTag = *v;
|
||||
channel.destinationTag = v;
|
||||
|
||||
jsonChannels.push_back(channel);
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#include <boost/json/value.hpp>
|
||||
#include <boost/json/value_to.hpp>
|
||||
#include <ripple/basics/strHex.h>
|
||||
#include <ripple/protocol/ErrorCodes.h>
|
||||
#include <ripple/protocol/Indexes.h>
|
||||
#include <ripple/protocol/LedgerFormats.h>
|
||||
#include <ripple/protocol/LedgerHeader.h>
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
#include <boost/json/value_to.hpp>
|
||||
#include <ripple/basics/strHex.h>
|
||||
#include <ripple/protocol/AccountID.h>
|
||||
#include <ripple/protocol/ErrorCodes.h>
|
||||
#include <ripple/protocol/Indexes.h>
|
||||
#include <ripple/protocol/LedgerFormats.h>
|
||||
#include <ripple/protocol/LedgerHeader.h>
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
#include <ripple/basics/base_uint.h>
|
||||
#include <ripple/basics/strHex.h>
|
||||
#include <ripple/protocol/AccountID.h>
|
||||
#include <ripple/protocol/ErrorCodes.h>
|
||||
#include <ripple/protocol/Indexes.h>
|
||||
#include <ripple/protocol/Keylet.h>
|
||||
#include <ripple/protocol/LedgerFormats.h>
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
#include <boost/json/value.hpp>
|
||||
#include <boost/json/value_to.hpp>
|
||||
#include <ripple/basics/strHex.h>
|
||||
#include <ripple/protocol/ErrorCodes.h>
|
||||
#include <ripple/protocol/Indexes.h>
|
||||
#include <ripple/protocol/LedgerFormats.h>
|
||||
#include <ripple/protocol/LedgerHeader.h>
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
#include <boost/json/value_to.hpp>
|
||||
#include <ripple/basics/strHex.h>
|
||||
#include <ripple/protocol/AccountID.h>
|
||||
#include <ripple/protocol/ErrorCodes.h>
|
||||
#include <ripple/protocol/Indexes.h>
|
||||
#include <ripple/protocol/LedgerFormats.h>
|
||||
#include <ripple/protocol/LedgerHeader.h>
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
#include <ripple/basics/chrono.h>
|
||||
#include <ripple/basics/strHex.h>
|
||||
#include <ripple/protocol/AccountID.h>
|
||||
#include <ripple/protocol/ErrorCodes.h>
|
||||
#include <ripple/protocol/LedgerHeader.h>
|
||||
#include <ripple/protocol/jss.h>
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
#include <boost/json/value.hpp>
|
||||
#include <boost/json/value_to.hpp>
|
||||
#include <ripple/basics/strHex.h>
|
||||
#include <ripple/protocol/ErrorCodes.h>
|
||||
#include <ripple/protocol/Indexes.h>
|
||||
#include <ripple/protocol/LedgerFormats.h>
|
||||
#include <ripple/protocol/LedgerHeader.h>
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
#include <ripple/basics/strHex.h>
|
||||
#include <ripple/beast/utility/Zero.h>
|
||||
#include <ripple/protocol/AccountID.h>
|
||||
#include <ripple/protocol/ErrorCodes.h>
|
||||
#include <ripple/protocol/Indexes.h>
|
||||
#include <ripple/protocol/LedgerFormats.h>
|
||||
#include <ripple/protocol/LedgerHeader.h>
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
#include <boost/json/value_to.hpp>
|
||||
#include <ripple/basics/base_uint.h>
|
||||
#include <ripple/basics/strHex.h>
|
||||
#include <ripple/protocol/ErrorCodes.h>
|
||||
#include <ripple/protocol/LedgerFormats.h>
|
||||
#include <ripple/protocol/LedgerHeader.h>
|
||||
#include <ripple/protocol/STLedgerEntry.h>
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
#include <ripple/basics/strHex.h>
|
||||
#include <ripple/json/json_value.h>
|
||||
#include <ripple/protocol/AccountID.h>
|
||||
#include <ripple/protocol/ErrorCodes.h>
|
||||
#include <ripple/protocol/Indexes.h>
|
||||
#include <ripple/protocol/Issue.h>
|
||||
#include <ripple/protocol/LedgerFormats.h>
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
#include <ripple/basics/base_uint.h>
|
||||
#include <ripple/basics/chrono.h>
|
||||
#include <ripple/basics/strHex.h>
|
||||
#include <ripple/protocol/ErrorCodes.h>
|
||||
#include <ripple/protocol/LedgerHeader.h>
|
||||
#include <ripple/protocol/jss.h>
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
#include <ripple/basics/base_uint.h>
|
||||
#include <ripple/basics/strHex.h>
|
||||
#include <ripple/protocol/AccountID.h>
|
||||
#include <ripple/protocol/ErrorCodes.h>
|
||||
#include <ripple/protocol/LedgerHeader.h>
|
||||
#include <ripple/protocol/jss.h>
|
||||
#include <ripple/protocol/nft.h>
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
#include <boost/json/value_to.hpp>
|
||||
#include <ripple/basics/base_uint.h>
|
||||
#include <ripple/protocol/AccountID.h>
|
||||
#include <ripple/protocol/ErrorCodes.h>
|
||||
#include <ripple/protocol/Indexes.h>
|
||||
#include <ripple/protocol/Keylet.h>
|
||||
#include <ripple/protocol/LedgerFormats.h>
|
||||
@@ -103,7 +102,7 @@ NFTOffersHandlerBase::iterateOfferDirectory(
|
||||
if (not sharedPtrBackend_->fetchLedgerObject(directory.key, lgrInfo.seq, yield))
|
||||
return Error{Status{RippledError::rpcOBJECT_NOT_FOUND, "notFound"}};
|
||||
|
||||
auto output = Output{input.nftID};
|
||||
auto output = Output{.nftID = input.nftID, .offers = {}, .limit = {}, .marker = {}};
|
||||
auto offers = std::vector<ripple::SLE>{};
|
||||
auto reserve = input.limit;
|
||||
auto cursor = uint256{};
|
||||
|
||||
@@ -57,13 +57,13 @@ public:
|
||||
* @brief A struct to hold the output data of the command
|
||||
*/
|
||||
struct Output {
|
||||
std::string nftID = {};
|
||||
std::vector<ripple::SLE> offers = {};
|
||||
std::string nftID;
|
||||
std::vector<ripple::SLE> offers;
|
||||
|
||||
// validated should be sent via framework
|
||||
bool validated = true;
|
||||
std::optional<uint32_t> limit = {};
|
||||
std::optional<std::string> marker = {};
|
||||
std::optional<uint32_t> limit;
|
||||
std::optional<std::string> marker;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
#include <ripple/basics/base_uint.h>
|
||||
#include <ripple/basics/strHex.h>
|
||||
#include <ripple/protocol/AccountID.h>
|
||||
#include <ripple/protocol/ErrorCodes.h>
|
||||
#include <ripple/protocol/Indexes.h>
|
||||
#include <ripple/protocol/LedgerHeader.h>
|
||||
#include <ripple/protocol/jss.h>
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
#include <fmt/core.h>
|
||||
#include <ripple/basics/strHex.h>
|
||||
#include <ripple/protocol/AccountID.h>
|
||||
#include <ripple/protocol/ErrorCodes.h>
|
||||
#include <ripple/protocol/Indexes.h>
|
||||
#include <ripple/protocol/LedgerFormats.h>
|
||||
#include <ripple/protocol/LedgerHeader.h>
|
||||
|
||||
@@ -90,10 +90,10 @@ public:
|
||||
* @brief A struct to hold the admin section of the output
|
||||
*/
|
||||
struct AdminSection {
|
||||
boost::json::object counters = {};
|
||||
std::optional<boost::json::object> backendCounters = {};
|
||||
boost::json::object subscriptions = {};
|
||||
boost::json::object etl = {};
|
||||
boost::json::object counters;
|
||||
std::optional<boost::json::object> backendCounters;
|
||||
boost::json::object subscriptions;
|
||||
boost::json::object etl;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -101,7 +101,7 @@ public:
|
||||
*/
|
||||
struct ValidatedLedgerSection {
|
||||
uint32_t age = 0;
|
||||
std::string hash = {};
|
||||
std::string hash;
|
||||
ripple::LedgerIndex seq = {};
|
||||
std::optional<ripple::Fees> fees = std::nullopt;
|
||||
};
|
||||
@@ -123,7 +123,7 @@ public:
|
||||
*/
|
||||
struct InfoSection {
|
||||
std::optional<AdminSection> adminSection = std::nullopt;
|
||||
std::string completeLedgers = {};
|
||||
std::string completeLedgers;
|
||||
uint32_t loadFactor = 1u;
|
||||
std::chrono::time_point<std::chrono::system_clock> time = std::chrono::system_clock::now();
|
||||
std::chrono::seconds uptime = {};
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
#include <ripple/basics/base_uint.h>
|
||||
#include <ripple/basics/chrono.h>
|
||||
#include <ripple/basics/strHex.h>
|
||||
#include <ripple/protocol/ErrorCodes.h>
|
||||
#include <ripple/protocol/LedgerHeader.h>
|
||||
#include <ripple/protocol/jss.h>
|
||||
|
||||
|
||||
@@ -66,14 +66,16 @@ public:
|
||||
*/
|
||||
struct Output {
|
||||
uint32_t date = 0u;
|
||||
std::string hash{};
|
||||
std::string hash = {}; // NOLINT(readability-redundant-member-init)
|
||||
uint32_t ledgerIndex = 0u;
|
||||
std::optional<boost::json::object> meta{};
|
||||
std::optional<boost::json::object> tx{};
|
||||
std::optional<std::string> metaStr{};
|
||||
std::optional<std::string> txStr{};
|
||||
std::optional<std::string> ctid{}; // ctid when binary=true
|
||||
std::optional<ripple::LedgerHeader> ledgerHeader{}; // ledger hash when apiVersion >= 2
|
||||
std::optional<boost::json::object> meta = std::nullopt; // NOLINT(readability-redundant-member-init)
|
||||
std::optional<boost::json::object> tx = std::nullopt; // NOLINT(readability-redundant-member-init)
|
||||
std::optional<std::string> metaStr = std::nullopt; // NOLINT(readability-redundant-member-init)
|
||||
std::optional<std::string> txStr = std::nullopt; // NOLINT(readability-redundant-member-init)
|
||||
std::optional<std::string> ctid =
|
||||
std::nullopt; // NOLINT(readability-redundant-member-init) ctid when binary=true
|
||||
std::optional<ripple::LedgerHeader> ledgerHeader =
|
||||
std::nullopt; // NOLINT(readability-redundant-member-init) ledger hash when apiVersion >= 2
|
||||
uint32_t apiVersion = 0u;
|
||||
bool validated = true;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user