mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-06 12:55:51 +00:00
chore: Commits for 2.4.0-rc2 (#1964)
This commit is contained in:
@@ -23,13 +23,13 @@ class Clio(ConanFile):
|
|||||||
}
|
}
|
||||||
|
|
||||||
requires = [
|
requires = [
|
||||||
'boost/1.82.0',
|
'boost/1.83.0',
|
||||||
'cassandra-cpp-driver/2.17.0',
|
'cassandra-cpp-driver/2.17.0',
|
||||||
'fmt/10.1.1',
|
'fmt/10.1.1',
|
||||||
'protobuf/3.21.9',
|
'protobuf/3.21.9',
|
||||||
'grpc/1.50.1',
|
'grpc/1.50.1',
|
||||||
'openssl/1.1.1u',
|
'openssl/1.1.1v',
|
||||||
'xrpl/2.4.0-rc4',
|
'xrpl/2.4.0',
|
||||||
'zlib/1.3.1',
|
'zlib/1.3.1',
|
||||||
'libbacktrace/cci.20210118'
|
'libbacktrace/cci.20210118'
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -20,7 +20,6 @@
|
|||||||
#include "etl/ETLService.hpp"
|
#include "etl/ETLService.hpp"
|
||||||
|
|
||||||
#include "data/BackendInterface.hpp"
|
#include "data/BackendInterface.hpp"
|
||||||
#include "data/LedgerCache.hpp"
|
|
||||||
#include "etl/CorruptionDetector.hpp"
|
#include "etl/CorruptionDetector.hpp"
|
||||||
#include "etl/NetworkValidatedLedgersInterface.hpp"
|
#include "etl/NetworkValidatedLedgersInterface.hpp"
|
||||||
#include "feed/SubscriptionManagerInterface.hpp"
|
#include "feed/SubscriptionManagerInterface.hpp"
|
||||||
|
|||||||
@@ -31,15 +31,12 @@
|
|||||||
|
|
||||||
namespace etl {
|
namespace etl {
|
||||||
|
|
||||||
std::optional<ETLState>
|
ETLState
|
||||||
tag_invoke(boost::json::value_to_tag<std::optional<ETLState>>, boost::json::value const& jv)
|
tag_invoke(boost::json::value_to_tag<ETLState>, boost::json::value const& jv)
|
||||||
{
|
{
|
||||||
ETLState state;
|
ETLState state;
|
||||||
auto const& jsonObject = jv.as_object();
|
auto const& jsonObject = jv.as_object();
|
||||||
|
|
||||||
if (jsonObject.contains(JS(error)))
|
|
||||||
return std::nullopt;
|
|
||||||
|
|
||||||
if (jsonObject.contains(JS(result)) && jsonObject.at(JS(result)).as_object().contains(JS(info))) {
|
if (jsonObject.contains(JS(result)) && jsonObject.at(JS(result)).as_object().contains(JS(info))) {
|
||||||
auto const rippledInfo = jsonObject.at(JS(result)).as_object().at(JS(info)).as_object();
|
auto const rippledInfo = jsonObject.at(JS(result)).as_object().at(JS(info)).as_object();
|
||||||
if (rippledInfo.contains(JS(network_id)))
|
if (rippledInfo.contains(JS(network_id)))
|
||||||
|
|||||||
@@ -20,12 +20,14 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "data/BackendInterface.hpp"
|
#include "data/BackendInterface.hpp"
|
||||||
|
#include "rpc/JS.hpp"
|
||||||
|
|
||||||
#include <boost/json.hpp>
|
#include <boost/json.hpp>
|
||||||
#include <boost/json/conversion.hpp>
|
#include <boost/json/conversion.hpp>
|
||||||
#include <boost/json/object.hpp>
|
#include <boost/json/object.hpp>
|
||||||
#include <boost/json/value.hpp>
|
#include <boost/json/value.hpp>
|
||||||
#include <boost/json/value_to.hpp>
|
#include <boost/json/value_to.hpp>
|
||||||
|
#include <xrpl/protocol/jss.h>
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <optional>
|
#include <optional>
|
||||||
@@ -54,8 +56,9 @@ struct ETLState {
|
|||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (serverInfoRippled)
|
if (serverInfoRippled && not serverInfoRippled->contains(JS(error))) {
|
||||||
return boost::json::value_to<std::optional<ETLState>>(boost::json::value(*serverInfoRippled));
|
return boost::json::value_to<ETLState>(boost::json::value(*serverInfoRippled));
|
||||||
|
}
|
||||||
|
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
@@ -67,7 +70,7 @@ struct ETLState {
|
|||||||
* @param jv The json value to convert
|
* @param jv The json value to convert
|
||||||
* @return The ETLState
|
* @return The ETLState
|
||||||
*/
|
*/
|
||||||
std::optional<ETLState>
|
ETLState
|
||||||
tag_invoke(boost::json::value_to_tag<std::optional<ETLState>>, boost::json::value const& jv);
|
tag_invoke(boost::json::value_to_tag<ETLState>, boost::json::value const& jv);
|
||||||
|
|
||||||
} // namespace etl
|
} // namespace etl
|
||||||
|
|||||||
@@ -385,7 +385,7 @@ insertDeliverMaxAlias(boost::json::object& txJson, std::uint32_t const apiVersio
|
|||||||
{
|
{
|
||||||
if (txJson.contains(JS(TransactionType)) and txJson.at(JS(TransactionType)).is_string() and
|
if (txJson.contains(JS(TransactionType)) and txJson.at(JS(TransactionType)).is_string() and
|
||||||
txJson.at(JS(TransactionType)).as_string() == JS(Payment) and txJson.contains(JS(Amount))) {
|
txJson.at(JS(TransactionType)).as_string() == JS(Payment) and txJson.contains(JS(Amount))) {
|
||||||
txJson[JS(DeliverMax)] = txJson[JS(Amount)];
|
txJson.insert_or_assign(JS(DeliverMax), txJson[JS(Amount)]);
|
||||||
if (apiVersion > 1)
|
if (apiVersion > 1)
|
||||||
txJson.erase(JS(Amount));
|
txJson.erase(JS(Amount));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -419,7 +419,8 @@ TEST_F(RPCHelpersTest, DeliverMaxAliasV1)
|
|||||||
for (size_t i = 0; i < inputArray.size(); i++) {
|
for (size_t i = 0; i < inputArray.size(); i++) {
|
||||||
auto req = boost::json::parse(inputArray[i]).as_object();
|
auto req = boost::json::parse(inputArray[i]).as_object();
|
||||||
insertDeliverMaxAlias(req, 1);
|
insertDeliverMaxAlias(req, 1);
|
||||||
EXPECT_EQ(req, boost::json::parse(outputArray[i]).as_object());
|
auto const expectedReq = boost::json::parse(outputArray[i]).as_object();
|
||||||
|
EXPECT_EQ(req, expectedReq) << req << "\n" << expectedReq;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user