Switch to llvm 17 tools (#1002)

Fixes #952
This commit is contained in:
Sergey Kuznetsov
2023-11-28 20:09:58 +00:00
committed by GitHub
parent 1be368dcaf
commit 35f119a268
305 changed files with 3955 additions and 1704 deletions

View File

@@ -33,12 +33,13 @@ DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros: [ Q_FOREACH, BOOST_FOREACH ]
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^<(BeastConfig)'
Priority: 0
- Regex: '^<(ripple)/'
- Regex: '^".*"$'
Priority: 1
- Regex: '^<.*\.(h|hpp)>$'
Priority: 2
- Regex: '^<(boost)/'
- Regex: '^<.*>$'
Priority: 3
- Regex: '.*'
Priority: 4

View File

@@ -7,6 +7,7 @@ Checks: '-*,
bugprone-copy-constructor-init,
bugprone-dangling-handle,
bugprone-dynamic-static-initializers,
bugprone-empty-catch,
bugprone-fold-init-type,
bugprone-forward-declaration-namespace,
bugprone-inaccurate-erase,
@@ -20,11 +21,15 @@ Checks: '-*,
bugprone-misplaced-pointer-arithmetic-in-alloc,
bugprone-misplaced-widening-cast,
bugprone-move-forwarding-reference,
bugprone-multiple-new-in-one-expression,
bugprone-multiple-statement-macro,
bugprone-no-escape,
bugprone-non-zero-enum-to-bool-conversion,
bugprone-parent-virtual-call,
bugprone-posix-return,
bugprone-redundant-branch-condition,
bugprone-reserved-identifier,
bugprone-unused-return-value,
bugprone-shared-ptr-array-mismatch,
bugprone-signal-handler,
bugprone-signed-char-misuse,
@@ -45,6 +50,7 @@ Checks: '-*,
bugprone-suspicious-semicolon,
bugprone-suspicious-string-compare,
bugprone-swapped-arguments,
bugprone-switch-missing-default-case,
bugprone-terminating-continue,
bugprone-throw-keyword-missing,
bugprone-too-small-loop-variable,
@@ -52,18 +58,23 @@ Checks: '-*,
bugprone-undelegated-constructor,
bugprone-unhandled-exception-at-new,
bugprone-unhandled-self-assignment,
bugprone-unique-ptr-array-mismatch,
bugprone-unsafe-functions,
bugprone-unused-raii,
bugprone-unused-return-value,
bugprone-use-after-move,
bugprone-virtual-near-miss,
cppcoreguidelines-init-variables,
cppcoreguidelines-prefer-member-initializer,
cppcoreguidelines-misleading-capture-default-by-value,
cppcoreguidelines-pro-type-member-init,
cppcoreguidelines-pro-type-static-cast-downcast,
cppcoreguidelines-rvalue-reference-param-not-moved,
cppcoreguidelines-use-default-member-init,
cppcoreguidelines-virtual-class-destructor,
llvm-namespace-comment,
misc-const-correctness,
misc-definitions-in-headers,
misc-header-include-cycle,
misc-include-cleaner,
misc-misplaced-const,
misc-redundant-expression,
misc-static-assert,
@@ -75,6 +86,7 @@ Checks: '-*,
modernize-make-shared,
modernize-make-unique,
modernize-pass-by-value,
modernize-type-traits,
modernize-use-emplace,
modernize-use-equals-default,
modernize-use-equals-delete,
@@ -112,6 +124,8 @@ Checks: '-*,
CheckOptions:
readability-braces-around-statements.ShortStatementLines: 2
bugprone-unsafe-functions.ReportMoreUnsafeFunctions: true
bugprone-unused-return-value.CheckedReturnTypes: ::std::error_code;::std::error_condition;::std::errc;::std::expected
HeaderFilterRegex: '^.*/(src|unitests)/.*\.(h|hpp)$'
WarningsAsErrors: '*'

View File

@@ -7,7 +7,7 @@ sources="src unittests"
formatter="clang-format -i"
version=$($formatter --version | grep -o '[0-9\.]*')
if [[ "16.0.0" > "$version" ]]; then
if [[ "17.0.0" > "$version" ]]; then
cat <<EOF
ERROR
@@ -21,6 +21,18 @@ EOF
exit 2
fi
function grep_code {
grep -l "${1}" ${sources} -r --include \*.h --include \*.cpp
}
# make all includes to be <...> style
grep_code '#include ".*"' | xargs sed -i -E 's|#include "(.*)"|#include <\1>|g'
# make local includes to be "..." style
for d in $(find ./src -maxdepth 1 -type d -execdir basename {} \;); do
grep_code "#include <$d/.*>" | xargs sed -i -E "s|#include <($d/.*)>|#include \"\1\"|g"
done
first=$(git diff $sources)
find $sources -type f \( -name '*.cpp' -o -name '*.h' -o -name '*.ipp' \) -print0 | xargs -0 $formatter
second=$(git diff $sources)

View File

@@ -1,23 +1,23 @@
name: Check format
description: Check format using clang-format-16
description: Check format using clang-format-17
runs:
using: composite
steps:
- name: Add llvm repo
run: |
echo 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-16 main' | sudo tee -a /etc/apt/sources.list
echo 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-17 main' | sudo tee -a /etc/apt/sources.list
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
shell: bash
- name: Install packages
run: |
sudo apt update -qq
sudo apt install -y jq clang-format-16
sudo apt install -y jq clang-format-17
shell: bash
- name: Run formatter
run: |
find src unittests -type f \( -name '*.cpp' -o -name '*.h' -o -name '*.ipp' \) -print0 | xargs -0 clang-format-16 -i
find src unittests -type f \( -name '*.cpp' -o -name '*.h' -o -name '*.ipp' \) -print0 | xargs -0 clang-format-17 -i
shell: bash
- name: Check for differences

View File

@@ -84,13 +84,13 @@ jobs:
- name: Add llvm repo
run: |
echo 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-16 main' >> /etc/apt/sources.list
echo 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-17 main' >> /etc/apt/sources.list
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
- name: Install packages
run: |
apt update -qq
apt install -y jq clang-tidy-16
apt install -y jq clang-tidy-17
- name: Install ccache
run: |

View File

@@ -17,7 +17,9 @@
*/
//==============================================================================
#include <main/Build.h>
#include "main/Build.h"
#include <string>
namespace Build {
static constexpr char versionString[] = "@VERSION@";

View File

@@ -8,7 +8,7 @@ if (lint)
endif ()
message (STATUS "Using clang-tidy from CLIO_CLANG_TIDY_BIN")
else ()
find_program (_CLANG_TIDY_BIN NAMES "clang-tidy-16" "clang-tidy" REQUIRED)
find_program (_CLANG_TIDY_BIN NAMES "clang-tidy-17" "clang-tidy" REQUIRED)
endif ()
if (NOT _CLANG_TIDY_BIN)

View File

@@ -91,7 +91,7 @@ The button for that is near the bottom of the PR's page on GitHub.
This is a non-exhaustive list of recommended style guidelines. These are not always strictly enforced and serve as a way to keep the codebase coherent.
## Formatting
Code must conform to `clang-format` version 16, unless the result would be unreasonably difficult to read or maintain.
Code must conform to `clang-format` version 17, unless the result would be unreasonably difficult to read or maintain.
To change your code to conform use `clang-format -i <your changed files>`.
## Avoid

View File

@@ -263,7 +263,7 @@ There is an example of docker-compose file, Prometheus and Grafana configs in [e
## Using clang-tidy for static analysis
Minimum clang-tidy version required is 16.0.
Minimum clang-tidy version required is 17.0.
Clang-tidy could be run by cmake during building the project.
For that provide the option `-o lint=True` for `conan install` command:
```sh
@@ -273,7 +273,7 @@ By default cmake will try to find clang-tidy automatically in your system.
To force cmake use desired binary set `CLIO_CLANG_TIDY_BIN` environment variable as path to clang-tidy binary.
E.g.:
```sh
export CLIO_CLANG_TIDY_BIN=/opt/homebrew/opt/llvm@16/bin/clang-tidy
export CLIO_CLANG_TIDY_BIN=/opt/homebrew/opt/llvm@17/bin/clang-tidy
```
## Developing against `rippled` in standalone mode

View File

@@ -17,10 +17,20 @@
*/
//==============================================================================
#include <data/BackendCounters.h>
#include <util/Assert.h>
#include "data/BackendCounters.h"
#include <util/prometheus/Prometheus.h>
#include "util/Assert.h"
#include "util/prometheus/Label.h"
#include "util/prometheus/Prometheus.h"
#include <boost/json/object.hpp>
#include <chrono>
#include <cstdint>
#include <memory>
#include <string>
#include <utility>
#include <vector>
namespace data {
@@ -223,7 +233,8 @@ BackendCounters::AsyncOperationCounters::report() const
{name_ + "_pending", pendingCounter_.get().value()},
{name_ + "_completed", completedCounter_.get().value()},
{name_ + "_retry", retryCounter_.get().value()},
{name_ + "_error", errorCounter_.get().value()}};
{name_ + "_error", errorCounter_.get().value()}
};
}
} // namespace data

View File

@@ -19,7 +19,7 @@
#pragma once
#include <util/prometheus/Prometheus.h>
#include "util/prometheus/Prometheus.h"
#include <boost/json/object.hpp>

View File

@@ -19,10 +19,10 @@
#pragma once
#include <data/BackendInterface.h>
#include <data/CassandraBackend.h>
#include <util/config/Config.h>
#include <util/log/Logger.h>
#include "data/BackendInterface.h"
#include "data/CassandraBackend.h"
#include "util/config/Config.h"
#include "util/log/Logger.h"
#include <boost/algorithm/string.hpp>

View File

@@ -17,12 +17,31 @@
*/
//==============================================================================
#include <data/BackendInterface.h>
#include <util/Assert.h>
#include <util/log/Logger.h>
#include "data/BackendInterface.h"
#include "data/Types.h"
#include "util/Assert.h"
#include "util/log/Logger.h"
#include <boost/asio/spawn.hpp>
#include <ripple/basics/base_uint.h>
#include <ripple/basics/strHex.h>
#include <ripple/protocol/Fees.h>
#include <ripple/protocol/Indexes.h>
#include <ripple/protocol/SField.h>
#include <ripple/protocol/STLedgerEntry.h>
#include <ripple/protocol/Serializer.h>
#include <chrono>
#include <cstddef>
#include <cstdint>
#include <mutex>
#include <optional>
#include <shared_mutex>
#include <sstream>
#include <string>
#include <utility>
#include <vector>
// local to compilation unit loggers
namespace {
@@ -156,7 +175,7 @@ BackendInterface::fetchBookOffers(
// TODO try to speed this up. This can take a few seconds. The goal is
// to get it down to a few hundred milliseconds.
BookOffersPage page;
const ripple::uint256 bookEnd = ripple::getQualityNext(book);
ripple::uint256 const bookEnd = ripple::getQualityNext(book);
ripple::uint256 uTipIndex = book;
std::vector<ripple::uint256> keys;
auto getMillis = [](auto diff) { return std::chrono::duration_cast<std::chrono::milliseconds>(diff).count(); };
@@ -179,7 +198,8 @@ BackendInterface::fetchBookOffers(
while (keys.size() < limit) {
++numPages;
ripple::STLedgerEntry const sle{
ripple::SerialIter{offerDir->blob.data(), offerDir->blob.size()}, offerDir->key};
ripple::SerialIter{offerDir->blob.data(), offerDir->blob.size()}, offerDir->key
};
auto indexes = sle.getFieldV256(ripple::sfIndexes);
keys.insert(keys.end(), indexes.begin(), indexes.end());
auto next = sle.getFieldU64(ripple::sfIndexNext);

View File

@@ -19,16 +19,16 @@
#pragma once
#include <data/DBHelpers.h>
#include <data/LedgerCache.h>
#include <data/Types.h>
#include <util/config/Config.h>
#include <util/log/Logger.h>
#include "data/DBHelpers.h"
#include "data/LedgerCache.h"
#include "data/Types.h"
#include "util/config/Config.h"
#include "util/log/Logger.h"
#include <ripple/protocol/Fees.h>
#include <ripple/protocol/LedgerHeader.h>
#include <boost/asio/spawn.hpp>
#include <boost/json.hpp>
#include <ripple/protocol/Fees.h>
#include <ripple/protocol/LedgerHeader.h>
#include <thread>
#include <type_traits>
@@ -86,7 +86,7 @@ synchronous(FnType&& func)
boost::asio::io_context ctx;
using R = typename boost::result_of<FnType(boost::asio::yield_context)>::type;
if constexpr (!std::is_same<R, void>::value) {
if constexpr (!std::is_same_v<R, void>) {
R res;
boost::asio::spawn(ctx, [_ = boost::asio::make_work_guard(ctx), &func, &res](auto yield) {
res = func(yield);
@@ -521,7 +521,7 @@ public:
* @param data A vector of NFTsData objects representing the NFTs
*/
virtual void
writeNFTs(std::vector<NFTsData>&& data) = 0;
writeNFTs(std::vector<NFTsData> const& data) = 0;
/**
* @brief Write a new set of account transactions.
@@ -529,7 +529,7 @@ public:
* @param data A vector of AccountTransactionsData objects representing the account transactions
*/
virtual void
writeAccountTransactions(std::vector<AccountTransactionsData>&& data) = 0;
writeAccountTransactions(std::vector<AccountTransactionsData> data) = 0;
/**
* @brief Write NFTs transactions.
@@ -537,7 +537,7 @@ public:
* @param data A vector of NFTTransactionsData objects
*/
virtual void
writeNFTTransactions(std::vector<NFTTransactionsData>&& data) = 0;
writeNFTTransactions(std::vector<NFTTransactionsData> const& data) = 0;
/**
* @brief Write a new successor.

View File

@@ -19,20 +19,20 @@
#pragma once
#include <data/BackendInterface.h>
#include <data/cassandra/Concepts.h>
#include <data/cassandra/Handle.h>
#include <data/cassandra/Schema.h>
#include <data/cassandra/SettingsProvider.h>
#include <data/cassandra/impl/ExecutionStrategy.h>
#include <util/Assert.h>
#include <util/LedgerUtils.h>
#include <util/Profiler.h>
#include <util/log/Logger.h>
#include "data/BackendInterface.h"
#include "data/cassandra/Concepts.h"
#include "data/cassandra/Handle.h"
#include "data/cassandra/Schema.h"
#include "data/cassandra/SettingsProvider.h"
#include "data/cassandra/impl/ExecutionStrategy.h"
#include "util/Assert.h"
#include "util/LedgerUtils.h"
#include "util/Profiler.h"
#include "util/log/Logger.h"
#include <boost/asio/spawn.hpp>
#include <ripple/protocol/LedgerHeader.h>
#include <ripple/protocol/nft.h>
#include <boost/asio/spawn.hpp>
namespace data::cassandra {
@@ -741,7 +741,7 @@ public:
}
void
writeAccountTransactions(std::vector<AccountTransactionsData>&& data) override
writeAccountTransactions(std::vector<AccountTransactionsData> data) override
{
std::vector<Statement> statements;
statements.reserve(data.size() * 10); // assume 10 transactions avg
@@ -765,7 +765,7 @@ public:
}
void
writeNFTTransactions(std::vector<NFTTransactionsData>&& data) override
writeNFTTransactions(std::vector<NFTTransactionsData> const& data) override
{
std::vector<Statement> statements;
statements.reserve(data.size());
@@ -797,7 +797,7 @@ public:
}
void
writeNFTs(std::vector<NFTsData>&& data) override
writeNFTs(std::vector<NFTsData> const& data) override
{
std::vector<Statement> statements;
statements.reserve(data.size() * 3);

View File

@@ -20,18 +20,16 @@
/** @file */
#pragma once
#include <util/Assert.h>
#include "data/Types.h"
#include "util/Assert.h"
#include <boost/container/flat_set.hpp>
#include <ripple/basics/Log.h>
#include <ripple/basics/StringUtilities.h>
#include <ripple/protocol/SField.h>
#include <ripple/protocol/STAccount.h>
#include <ripple/protocol/TxMeta.h>
#include <boost/container/flat_set.hpp>
#include <data/Types.h>
/**
* @brief Struct used to keep track of what to write to account_transactions/account_tx tables.
*/

View File

@@ -17,8 +17,19 @@
*/
//==============================================================================
#include <data/LedgerCache.h>
#include <util/Assert.h>
#include "data/LedgerCache.h"
#include "data/Types.h"
#include "util/Assert.h"
#include <ripple/basics/base_uint.h>
#include <cstddef>
#include <cstdint>
#include <mutex>
#include <optional>
#include <shared_mutex>
#include <vector>
namespace data {

View File

@@ -19,13 +19,15 @@
#pragma once
#include "data/Types.h"
#include "util/prometheus/Prometheus.h"
#include <ripple/basics/base_uint.h>
#include <ripple/basics/hardened_hash.h>
#include <data/Types.h>
#include <map>
#include <mutex>
#include <shared_mutex>
#include <util/prometheus/Prometheus.h>
#include <utility>
#include <vector>

View File

@@ -23,7 +23,6 @@
#include <ripple/protocol/AccountID.h>
#include <optional>
#include <string>
#include <utility>
#include <vector>

View File

@@ -19,7 +19,7 @@
#pragma once
#include <data/cassandra/Types.h>
#include "data/cassandra/Types.h"
#include <boost/asio/spawn.hpp>
#include <boost/json.hpp>

View File

@@ -17,7 +17,18 @@
*/
//==============================================================================
#include <data/cassandra/Handle.h>
#include "data/cassandra/Handle.h"
#include "data/cassandra/Types.h"
#include <cassandra.h>
#include <functional>
#include <stdexcept>
#include <string>
#include <string_view>
#include <utility>
#include <vector>
namespace data::cassandra {

View File

@@ -19,16 +19,16 @@
#pragma once
#include <data/cassandra/Error.h>
#include <data/cassandra/Types.h>
#include <data/cassandra/impl/Batch.h>
#include <data/cassandra/impl/Cluster.h>
#include <data/cassandra/impl/Future.h>
#include <data/cassandra/impl/ManagedObject.h>
#include <data/cassandra/impl/Result.h>
#include <data/cassandra/impl/Session.h>
#include <data/cassandra/impl/Statement.h>
#include <util/Expected.h>
#include "data/cassandra/Error.h"
#include "data/cassandra/Types.h"
#include "data/cassandra/impl/Batch.h"
#include "data/cassandra/impl/Cluster.h"
#include "data/cassandra/impl/Future.h"
#include "data/cassandra/impl/ManagedObject.h"
#include "data/cassandra/impl/Result.h"
#include "data/cassandra/impl/Session.h"
#include "data/cassandra/impl/Statement.h"
#include "util/Expected.h"
#include <cassandra.h>

View File

@@ -19,13 +19,13 @@
#pragma once
#include <data/cassandra/Concepts.h>
#include <data/cassandra/Handle.h>
#include <data/cassandra/SettingsProvider.h>
#include <data/cassandra/Types.h>
#include <util/Expected.h>
#include <util/config/Config.h>
#include <util/log/Logger.h>
#include "data/cassandra/Concepts.h"
#include "data/cassandra/Handle.h"
#include "data/cassandra/SettingsProvider.h"
#include "data/cassandra/Types.h"
#include "util/Expected.h"
#include "util/config/Config.h"
#include "util/log/Logger.h"
#include <fmt/compile.h>

View File

@@ -17,17 +17,27 @@
*/
//==============================================================================
#include <data/cassandra/SettingsProvider.h>
#include <data/cassandra/impl/Cluster.h>
#include <data/cassandra/impl/Statement.h>
#include <util/Constants.h>
#include <util/config/Config.h>
#include "data/cassandra/SettingsProvider.h"
#include <boost/json.hpp>
#include "data/cassandra/Types.h"
#include "data/cassandra/impl/Cluster.h"
#include "util/Constants.h"
#include "util/config/Config.h"
#include <boost/json/conversion.hpp>
#include <boost/json/value.hpp>
#include <cerrno>
#include <chrono>
#include <cstdint>
#include <filesystem>
#include <fstream>
#include <ios>
#include <iterator>
#include <optional>
#include <stdexcept>
#include <string>
#include <thread>
#include <system_error>
namespace data::cassandra {

View File

@@ -19,11 +19,11 @@
#pragma once
#include <data/cassandra/Handle.h>
#include <data/cassandra/Types.h>
#include <util/Expected.h>
#include <util/config/Config.h>
#include <util/log/Logger.h>
#include "data/cassandra/Handle.h"
#include "data/cassandra/Types.h"
#include "util/Expected.h"
#include "util/config/Config.h"
#include "util/log/Logger.h"
namespace data::cassandra {

View File

@@ -19,7 +19,7 @@
#pragma once
#include <util/Expected.h>
#include "util/Expected.h"
#include <string>

View File

@@ -19,12 +19,12 @@
#pragma once
#include <data/cassandra/Concepts.h>
#include <data/cassandra/Handle.h>
#include <data/cassandra/Types.h>
#include <data/cassandra/impl/RetryPolicy.h>
#include <util/Expected.h>
#include <util/log/Logger.h>
#include "data/cassandra/Concepts.h"
#include "data/cassandra/Handle.h"
#include "data/cassandra/Types.h"
#include "data/cassandra/impl/RetryPolicy.h"
#include "util/Expected.h"
#include "util/log/Logger.h"
#include <boost/asio.hpp>

View File

@@ -17,12 +17,17 @@
*/
//==============================================================================
#include <data/cassandra/Error.h>
#include <data/cassandra/impl/Batch.h>
#include <data/cassandra/impl/Statement.h>
#include <util/Expected.h>
#include "data/cassandra/impl/Batch.h"
#include <exception>
#include "data/cassandra/Error.h"
#include "data/cassandra/Types.h"
#include "data/cassandra/impl/ManagedObject.h"
#include "data/cassandra/impl/Statement.h"
#include "util/Expected.h"
#include <cassandra.h>
#include <stdexcept>
#include <vector>
namespace {

View File

@@ -19,8 +19,8 @@
#pragma once
#include <data/cassandra/Types.h>
#include <data/cassandra/impl/ManagedObject.h>
#include "data/cassandra/Types.h"
#include "data/cassandra/impl/ManagedObject.h"
#include <cassandra.h>

View File

@@ -17,15 +17,18 @@
*/
//==============================================================================
#include <data/cassandra/impl/Cluster.h>
#include <data/cassandra/impl/SslContext.h>
#include <data/cassandra/impl/Statement.h>
#include <util/Expected.h>
#include "data/cassandra/impl/Cluster.h"
#include "data/cassandra/impl/ManagedObject.h"
#include "data/cassandra/impl/SslContext.h"
#include "util/log/Logger.h"
#include <cassandra.h>
#include <fmt/core.h>
#include <exception>
#include <vector>
#include <stdexcept>
#include <string>
#include <variant>
namespace {
constexpr auto clusterDeleter = [](CassCluster* ptr) { cass_cluster_free(ptr); };
@@ -88,7 +91,8 @@ Cluster::setupConnection(Settings const& settings)
std::visit(
overloadSet{
[this](Settings::ContactPoints const& points) { setupContactPoints(points); },
[this](Settings::SecureConnectionBundle const& bundle) { setupSecureBundle(bundle); }},
[this](Settings::SecureConnectionBundle const& bundle) { setupSecureBundle(bundle); }
},
settings.connectionInfo
);
}

View File

@@ -19,8 +19,8 @@
#pragma once
#include <data/cassandra/impl/ManagedObject.h>
#include <util/log/Logger.h>
#include "data/cassandra/impl/ManagedObject.h"
#include "util/log/Logger.h"
#include <cassandra.h>

View File

@@ -19,10 +19,10 @@
#pragma once
#include <data/cassandra/impl/ManagedObject.h>
#include "data/cassandra/impl/ManagedObject.h"
#include <ripple/basics/base_uint.h>
#include <cassandra.h>
#include <ripple/basics/base_uint.h>
#include <string>
#include <string_view>

View File

@@ -19,14 +19,14 @@
#pragma once
#include <data/BackendCounters.h>
#include <data/BackendInterface.h>
#include <data/cassandra/Handle.h>
#include <data/cassandra/Types.h>
#include <data/cassandra/impl/AsyncExecutor.h>
#include <util/Assert.h>
#include <util/Expected.h>
#include <util/log/Logger.h>
#include "data/BackendCounters.h"
#include "data/BackendInterface.h"
#include "data/cassandra/Handle.h"
#include "data/cassandra/Types.h"
#include "data/cassandra/impl/AsyncExecutor.h"
#include "util/Assert.h"
#include "util/Expected.h"
#include "util/log/Logger.h"
#include <boost/asio.hpp>
#include <boost/asio/spawn.hpp>

View File

@@ -17,12 +17,19 @@
*/
//==============================================================================
#include <data/cassandra/Error.h>
#include <data/cassandra/impl/Future.h>
#include <data/cassandra/impl/Result.h>
#include "data/cassandra/impl/Future.h"
#include <exception>
#include <vector>
#include "data/cassandra/Error.h"
#include "data/cassandra/Types.h"
#include "data/cassandra/impl/ManagedObject.h"
#include "data/cassandra/impl/Result.h"
#include <cassandra.h>
#include <cstddef>
#include <memory>
#include <string>
#include <utility>
namespace {
constexpr auto futureDeleter = [](CassFuture* ptr) { cass_future_free(ptr); };

View File

@@ -19,8 +19,8 @@
#pragma once
#include <data/cassandra/Types.h>
#include <data/cassandra/impl/ManagedObject.h>
#include "data/cassandra/Types.h"
#include "data/cassandra/impl/ManagedObject.h"
#include <cassandra.h>

View File

@@ -17,7 +17,13 @@
*/
//==============================================================================
#include <data/cassandra/impl/Result.h>
#include "data/cassandra/impl/Result.h"
#include "data/cassandra/impl/ManagedObject.h"
#include <cassandra.h>
#include <cstddef>
namespace {
constexpr auto resultDeleter = [](CassResult const* ptr) { cass_result_free(ptr); };

View File

@@ -19,13 +19,13 @@
#pragma once
#include <data/cassandra/impl/ManagedObject.h>
#include <data/cassandra/impl/Tuple.h>
#include <util/Expected.h>
#include "data/cassandra/impl/ManagedObject.h"
#include "data/cassandra/impl/Tuple.h"
#include "util/Expected.h"
#include <cassandra.h>
#include <ripple/basics/base_uint.h>
#include <ripple/protocol/AccountID.h>
#include <cassandra.h>
#include <compare>
#include <iterator>

View File

@@ -19,10 +19,10 @@
#pragma once
#include <data/cassandra/Handle.h>
#include <data/cassandra/Types.h>
#include <util/Expected.h>
#include <util/log/Logger.h>
#include "data/cassandra/Handle.h"
#include "data/cassandra/Types.h"
#include "util/Expected.h"
#include "util/log/Logger.h"
#include <boost/asio.hpp>

View File

@@ -19,7 +19,7 @@
#pragma once
#include <data/cassandra/impl/ManagedObject.h>
#include "data/cassandra/impl/ManagedObject.h"
#include <cassandra.h>

View File

@@ -17,7 +17,14 @@
*/
//==============================================================================
#include <data/cassandra/impl/SslContext.h>
#include "data/cassandra/impl/SslContext.h"
#include "data/cassandra/impl/ManagedObject.h"
#include <cassandra.h>
#include <stdexcept>
#include <string>
namespace {
constexpr auto contextDeleter = [](CassSsl* ptr) { cass_ssl_free(ptr); };

View File

@@ -19,7 +19,7 @@
#pragma once
#include <data/cassandra/impl/ManagedObject.h>
#include "data/cassandra/impl/ManagedObject.h"
#include <cassandra.h>

View File

@@ -19,16 +19,16 @@
#pragma once
#include <data/cassandra/Types.h>
#include <data/cassandra/impl/Collection.h>
#include <data/cassandra/impl/ManagedObject.h>
#include <data/cassandra/impl/Tuple.h>
#include <util/Expected.h>
#include "data/cassandra/Types.h"
#include "data/cassandra/impl/Collection.h"
#include "data/cassandra/impl/ManagedObject.h"
#include "data/cassandra/impl/Tuple.h"
#include "util/Expected.h"
#include <ripple/basics/base_uint.h>
#include <ripple/protocol/STAccount.h>
#include <cassandra.h>
#include <fmt/core.h>
#include <ripple/basics/base_uint.h>
#include <ripple/protocol/STAccount.h>
#include <chrono>
#include <compare>

View File

@@ -17,7 +17,11 @@
*/
//==============================================================================
#include <data/cassandra/impl/Tuple.h>
#include "data/cassandra/impl/Tuple.h"
#include "data/cassandra/impl/ManagedObject.h"
#include <cassandra.h>
namespace {
constexpr auto tupleDeleter = [](CassTuple* ptr) { cass_tuple_free(ptr); };

View File

@@ -19,10 +19,10 @@
#pragma once
#include <data/cassandra/impl/ManagedObject.h>
#include "data/cassandra/impl/ManagedObject.h"
#include <ripple/basics/base_uint.h>
#include <cassandra.h>
#include <ripple/basics/base_uint.h>
#include <functional>
#include <string>
@@ -75,7 +75,7 @@ public:
}
// clio only uses bigint (int64_t) so we convert any incoming type
else if constexpr (std::is_convertible_v<DecayedType, int64_t>) {
auto const rc = cass_tuple_set_int64(*this, idx, value);
auto const rc = cass_tuple_set_int64(*this, idx, std::forward<Type>(value));
throwErrorIfNeeded(rc, "Bind int64");
} else if constexpr (std::is_same_v<DecayedType, ripple::uint256>) {
auto const rc = cass_tuple_set_bytes(

View File

@@ -20,13 +20,15 @@
/** @file */
#pragma once
#include "util/Assert.h"
#include <ripple/basics/base_uint.h>
#include <condition_variable>
#include <mutex>
#include <optional>
#include <queue>
#include <sstream>
#include <util/Assert.h>
namespace etl {
/**

View File

@@ -17,13 +17,27 @@
*/
//==============================================================================
#include <etl/ETLService.h>
#include <util/Assert.h>
#include <util/Constants.h>
#include "etl/ETLService.h"
#include "data/BackendInterface.h"
#include "util/Assert.h"
#include "util/Constants.h"
#include "util/config/Config.h"
#include "util/log/Logger.h"
#include <boost/asio/io_context.hpp>
#include <ripple/beast/core/CurrentThreadName.h>
#include <ripple/protocol/LedgerHeader.h>
#include <chrono>
#include <cstddef>
#include <cstdint>
#include <memory>
#include <optional>
#include <stdexcept>
#include <thread>
#include <utility>
#include <vector>
namespace etl {
// Database must be populated when this starts

View File

@@ -19,25 +19,25 @@
#pragma once
#include <data/BackendInterface.h>
#include <data/LedgerCache.h>
#include <etl/LoadBalancer.h>
#include <etl/Source.h>
#include <etl/SystemState.h>
#include <etl/impl/AmendmentBlock.h>
#include <etl/impl/CacheLoader.h>
#include <etl/impl/ExtractionDataPipe.h>
#include <etl/impl/Extractor.h>
#include <etl/impl/LedgerFetcher.h>
#include <etl/impl/LedgerLoader.h>
#include <etl/impl/LedgerPublisher.h>
#include <etl/impl/Transformer.h>
#include <feed/SubscriptionManager.h>
#include <util/log/Logger.h>
#include "data/BackendInterface.h"
#include "data/LedgerCache.h"
#include "etl/LoadBalancer.h"
#include "etl/Source.h"
#include "etl/SystemState.h"
#include "etl/impl/AmendmentBlock.h"
#include "etl/impl/CacheLoader.h"
#include "etl/impl/ExtractionDataPipe.h"
#include "etl/impl/Extractor.h"
#include "etl/impl/LedgerFetcher.h"
#include "etl/impl/LedgerLoader.h"
#include "etl/impl/LedgerPublisher.h"
#include "etl/impl/Transformer.h"
#include "feed/SubscriptionManager.h"
#include "util/log/Logger.h"
#include <ripple/proto/org/xrpl/rpc/v1/xrp_ledger.grpc.pb.h>
#include <boost/asio/steady_timer.hpp>
#include <grpcpp/grpcpp.h>
#include <ripple/proto/org/xrpl/rpc/v1/xrp_ledger.grpc.pb.h>
#include <memory>

View File

@@ -17,8 +17,16 @@
*/
//==============================================================================
#include <etl/ETLState.h>
#include <rpc/JS.h>
#include "etl/ETLState.h"
#include "rpc/JS.h"
#include <boost/json/conversion.hpp>
#include <boost/json/value.hpp>
#include <boost/json/value_to.hpp>
#include <ripple/protocol/jss.h>
#include <cstdint>
namespace etl {

View File

@@ -19,7 +19,7 @@
#pragma once
#include <data/BackendInterface.h>
#include "data/BackendInterface.h"
#include <boost/json.hpp>

View File

@@ -17,26 +17,36 @@
*/
//==============================================================================
#include <data/DBHelpers.h>
#include <etl/ETLService.h>
#include <etl/NFTHelpers.h>
#include <etl/ProbingSource.h>
#include <etl/Source.h>
#include <rpc/RPCHelpers.h>
#include <util/Assert.h>
#include <util/Profiler.h>
#include <util/Random.h>
#include <util/log/Logger.h>
#include "etl/LoadBalancer.h"
#include <ripple/beast/net/IPEndpoint.h>
#include <ripple/protocol/STLedgerEntry.h>
#include <boost/asio/strand.hpp>
#include <boost/beast/http.hpp>
#include <boost/beast/ssl.hpp>
#include <boost/json.hpp>
#include <boost/json/src.hpp>
#include "data/BackendInterface.h"
#include "etl/ETLHelpers.h"
#include "etl/ETLService.h"
#include "etl/ETLState.h"
#include "etl/ProbingSource.h"
#include "etl/Source.h"
#include "util/Assert.h"
#include "util/Random.h"
#include "util/log/Logger.h"
#include <boost/asio/io_context.hpp>
#include <boost/asio/spawn.hpp>
#include <boost/json/array.hpp>
#include <boost/json/object.hpp>
#include <boost/json/value.hpp>
#include <fmt/core.h>
#include <algorithm>
#include <chrono>
#include <cstddef>
#include <cstdint>
#include <memory>
#include <optional>
#include <stdexcept>
#include <string>
#include <thread>
#include <utility>
#include <vector>
using namespace util;

View File

@@ -19,16 +19,16 @@
#pragma once
#include <data/BackendInterface.h>
#include <etl/ETLHelpers.h>
#include <etl/ETLState.h>
#include <feed/SubscriptionManager.h>
#include <util/config/Config.h>
#include <util/log/Logger.h>
#include "data/BackendInterface.h"
#include "etl/ETLHelpers.h"
#include "etl/ETLState.h"
#include "feed/SubscriptionManager.h"
#include "util/config/Config.h"
#include "util/log/Logger.h"
#include <ripple/proto/org/xrpl/rpc/v1/xrp_ledger.grpc.pb.h>
#include <boost/asio.hpp>
#include <grpcpp/grpcpp.h>
#include <ripple/proto/org/xrpl/rpc/v1/xrp_ledger.grpc.pb.h>
namespace etl {
class Source;

View File

@@ -17,15 +17,33 @@
*/
//==============================================================================
#include <ripple/protocol/STBase.h>
#include <ripple/protocol/STTx.h>
#include <ripple/protocol/TxMeta.h>
#include <vector>
#include "data/DBHelpers.h"
#include <data/BackendInterface.h>
#include <data/DBHelpers.h>
#include <data/Types.h>
#include <fmt/core.h>
#include <ripple/basics/base_uint.h>
#include <ripple/basics/strHex.h>
#include <ripple/protocol/AccountID.h>
#include <ripple/protocol/LedgerFormats.h>
#include <ripple/protocol/SField.h>
#include <ripple/protocol/STArray.h>
#include <ripple/protocol/STBase.h>
#include <ripple/protocol/STLedgerEntry.h>
#include <ripple/protocol/STObject.h>
#include <ripple/protocol/STTx.h>
#include <ripple/protocol/Serializer.h>
#include <ripple/protocol/TER.h>
#include <ripple/protocol/TxFormats.h>
#include <ripple/protocol/TxMeta.h>
#include <algorithm>
#include <cstdint>
#include <iterator>
#include <optional>
#include <sstream>
#include <stdexcept>
#include <string>
#include <utility>
#include <vector>
namespace etl {
@@ -114,7 +132,8 @@ getNFTokenMintData(ripple::TxMeta const& txMeta, ripple::STTx const& sttx)
return {
{NFTTransactionsData(*diff.first, txMeta, sttx.getTransactionID())},
NFTsData(*diff.first, *owner, sttx.getFieldVL(ripple::sfURI), txMeta)};
NFTsData(*diff.first, *owner, sttx.getFieldVL(ripple::sfURI), txMeta)
};
}
std::pair<std::vector<NFTTransactionsData>, std::optional<NFTsData>>
@@ -198,7 +217,8 @@ getNFTokenAcceptOfferData(ripple::TxMeta const& txMeta, ripple::STTx const& sttx
.downcast<ripple::STObject>()
.getAccountID(ripple::sfOwner);
return {
{NFTTransactionsData(tokenID, txMeta, sttx.getTransactionID())}, NFTsData(tokenID, owner, txMeta, false)};
{NFTTransactionsData(tokenID, txMeta, sttx.getTransactionID())}, NFTsData(tokenID, owner, txMeta, false)
};
}
// Otherwise we have to infer the new owner from the affected nodes.
@@ -247,7 +267,8 @@ getNFTokenAcceptOfferData(ripple::TxMeta const& txMeta, ripple::STTx const& sttx
if (nft != nfts.end()) {
return {
{NFTTransactionsData(tokenID, txMeta, sttx.getTransactionID())},
NFTsData(tokenID, nodeOwner, txMeta, false)};
NFTsData(tokenID, nodeOwner, txMeta, false)
};
}
}

View File

@@ -20,7 +20,7 @@
/** @file */
#pragma once
#include <data/DBHelpers.h>
#include "data/DBHelpers.h"
#include <ripple/protocol/STTx.h>
#include <ripple/protocol/TxMeta.h>

View File

@@ -17,7 +17,32 @@
*/
//==============================================================================
#include <etl/ProbingSource.h>
#include "etl/ProbingSource.h"
#include "data/BackendInterface.h"
#include "etl/ETLHelpers.h"
#include "etl/LoadBalancer.h"
#include "etl/Source.h"
#include "feed/SubscriptionManager.h"
#include "util/config/Config.h"
#include "util/log/Logger.h"
#include <boost/asio/io_context.hpp>
#include <boost/asio/spawn.hpp>
#include <boost/asio/ssl/context.hpp>
#include <boost/json/object.hpp>
#include <boost/uuid/nil_generator.hpp>
#include <boost/uuid/uuid.hpp>
#include <grpcpp/support/status.h>
#include <cstdint>
#include <functional>
#include <memory>
#include <mutex>
#include <optional>
#include <string>
#include <utility>
#include <vector>
namespace etl {
@@ -173,7 +198,8 @@ ProbingSource::make_SSLHooks() noexcept
plainSrc_->resume();
}
return SourceHooks::Action::STOP;
}};
}
};
}
SourceHooks
@@ -200,6 +226,7 @@ ProbingSource::make_PlainHooks() noexcept
sslSrc_->resume();
}
return SourceHooks::Action::STOP;
}};
}
};
};
} // namespace etl

View File

@@ -19,9 +19,9 @@
#pragma once
#include <etl/Source.h>
#include <util/config/Config.h>
#include <util/log/Logger.h>
#include "etl/Source.h"
#include "util/config/Config.h"
#include "util/log/Logger.h"
#include <boost/asio.hpp>
#include <boost/beast/core.hpp>

View File

@@ -17,22 +17,22 @@
*/
//==============================================================================
#include <data/DBHelpers.h>
#include <etl/ETLService.h>
#include <etl/LoadBalancer.h>
#include <etl/ProbingSource.h>
#include <etl/Source.h>
#include <rpc/RPCHelpers.h>
#include <util/Profiler.h>
#include "etl/Source.h"
#include <ripple/beast/net/IPEndpoint.h>
#include <ripple/protocol/STLedgerEntry.h>
#include <boost/asio/strand.hpp>
#include <boost/beast/http.hpp>
#include <boost/beast/ssl.hpp>
#include <boost/json.hpp>
#include "util/log/Logger.h"
#include <thread>
#include <boost/asio/ip/tcp.hpp>
#include <boost/asio/post.hpp>
#include <boost/asio/ssl/stream_base.hpp>
#include <boost/beast/core/error.hpp>
#include <boost/beast/core/role.hpp>
#include <boost/beast/core/stream_traits.hpp>
#include <boost/beast/http/field.hpp>
#include <boost/beast/websocket/rfc6455.hpp>
#include <boost/beast/websocket/stream_base.hpp>
#include <memory>
#include <string>
namespace etl {

View File

@@ -19,17 +19,16 @@
#pragma once
#include <data/BackendInterface.h>
#include <etl/ETLHelpers.h>
#include <etl/LoadBalancer.h>
#include <etl/impl/AsyncData.h>
#include <etl/impl/ForwardCache.h>
#include <feed/SubscriptionManager.h>
#include <util/Assert.h>
#include <util/config/Config.h>
#include <util/log/Logger.h>
#include "data/BackendInterface.h"
#include "etl/ETLHelpers.h"
#include "etl/LoadBalancer.h"
#include "etl/impl/AsyncData.h"
#include "etl/impl/ForwardCache.h"
#include "feed/SubscriptionManager.h"
#include "util/Assert.h"
#include "util/config/Config.h"
#include "util/log/Logger.h"
#include <ripple/proto/org/xrpl/rpc/v1/xrp_ledger.grpc.pb.h>
#include <boost/algorithm/string.hpp>
#include <boost/asio.hpp>
#include <boost/beast/core.hpp>
@@ -39,6 +38,8 @@
#include <boost/uuid/uuid.hpp>
#include <boost/uuid/uuid_generators.hpp>
#include <grpcpp/grpcpp.h>
#include <ripple/proto/org/xrpl/rpc/v1/xrp_ledger.grpc.pb.h>
#include <utility>
namespace feed {

View File

@@ -19,10 +19,11 @@
#pragma once
#include <etl/SystemState.h>
#include <util/log/Logger.h>
#include "etl/SystemState.h"
#include "util/log/Logger.h"
#include <boost/asio/io_context.hpp>
#include <boost/asio/post.hpp>
#include <boost/asio/steady_timer.hpp>
#include <chrono>

View File

@@ -19,13 +19,13 @@
#pragma once
#include <data/BackendInterface.h>
#include <etl/NFTHelpers.h>
#include <util/Assert.h>
#include <util/log/Logger.h>
#include "data/BackendInterface.h"
#include "etl/NFTHelpers.h"
#include "util/Assert.h"
#include "util/log/Logger.h"
#include <ripple/proto/org/xrpl/rpc/v1/xrp_ledger.grpc.pb.h>
#include <grpcpp/grpcpp.h>
#include <ripple/proto/org/xrpl/rpc/v1/xrp_ledger.grpc.pb.h>
namespace etl::detail {

View File

@@ -19,16 +19,16 @@
#pragma once
#include <data/BackendInterface.h>
#include <util/log/Logger.h>
#include "data/BackendInterface.h"
#include "util/log/Logger.h"
#include <ripple/proto/org/xrpl/rpc/v1/xrp_ledger.grpc.pb.h>
#include <boost/algorithm/string.hpp>
#include <boost/asio/spawn.hpp>
#include <boost/beast/core.hpp>
#include <boost/beast/core/string.hpp>
#include <boost/beast/websocket.hpp>
#include <grpcpp/grpcpp.h>
#include <ripple/proto/org/xrpl/rpc/v1/xrp_ledger.grpc.pb.h>
#include <chrono>
#include <mutex>
@@ -217,7 +217,8 @@ private:
{"ledger_index", ledgerIndex},
{"binary", true},
{"out_of_order", true},
{"limit", LIMIT}};
{"limit", LIMIT}
};
if (marker)
request["marker"] = *marker;

View File

@@ -19,8 +19,8 @@
#pragma once
#include <etl/ETLHelpers.h>
#include <util/log/Logger.h>
#include "etl/ETLHelpers.h"
#include "util/log/Logger.h"
#include <memory>
#include <vector>

View File

@@ -19,10 +19,10 @@
#pragma once
#include <etl/SystemState.h>
#include <util/Assert.h>
#include <util/Profiler.h>
#include <util/log/Logger.h>
#include "etl/SystemState.h"
#include "util/Assert.h"
#include "util/Profiler.h"
#include "util/log/Logger.h"
#include <ripple/beast/core/CurrentThreadName.h>

View File

@@ -17,12 +17,21 @@
*/
//==============================================================================
#include <etl/Source.h>
#include <etl/impl/ForwardCache.h>
#include <rpc/RPCHelpers.h>
#include "etl/impl/ForwardCache.h"
#include "etl/Source.h"
#include "rpc/RPCHelpers.h"
#include "util/log/Logger.h"
#include <boost/asio/spawn.hpp>
#include <boost/json.hpp>
#include <boost/json/object.hpp>
#include <atomic>
#include <memory>
#include <mutex>
#include <optional>
#include <shared_mutex>
#include <string>
namespace etl::detail {

View File

@@ -19,10 +19,10 @@
#pragma once
#include <data/BackendInterface.h>
#include <etl/ETLHelpers.h>
#include <util/config/Config.h>
#include <util/log/Logger.h>
#include "data/BackendInterface.h"
#include "etl/ETLHelpers.h"
#include "util/config/Config.h"
#include "util/log/Logger.h"
#include <boost/asio.hpp>
#include <boost/json.hpp>

View File

@@ -19,12 +19,12 @@
#pragma once
#include <data/BackendInterface.h>
#include <etl/Source.h>
#include <util/log/Logger.h>
#include "data/BackendInterface.h"
#include "etl/Source.h"
#include "util/log/Logger.h"
#include <ripple/proto/org/xrpl/rpc/v1/xrp_ledger.grpc.pb.h>
#include <grpcpp/grpcpp.h>
#include <ripple/proto/org/xrpl/rpc/v1/xrp_ledger.grpc.pb.h>
#include <optional>
#include <utility>

View File

@@ -19,14 +19,14 @@
#pragma once
#include <data/BackendInterface.h>
#include <etl/NFTHelpers.h>
#include <etl/SystemState.h>
#include <etl/impl/LedgerFetcher.h>
#include <util/Assert.h>
#include <util/LedgerUtils.h>
#include <util/Profiler.h>
#include <util/log/Logger.h>
#include "data/BackendInterface.h"
#include "etl/NFTHelpers.h"
#include "etl/SystemState.h"
#include "etl/impl/LedgerFetcher.h"
#include "util/Assert.h"
#include "util/LedgerUtils.h"
#include "util/Profiler.h"
#include "util/log/Logger.h"
#include <ripple/beast/core/CurrentThreadName.h>
@@ -240,8 +240,8 @@ public:
if (not state_.get().isStopping) {
backend_->writeAccountTransactions(std::move(insertTxResult.accountTxData));
backend_->writeNFTs(std::move(insertTxResult.nfTokensData));
backend_->writeNFTTransactions(std::move(insertTxResult.nfTokenTxData));
backend_->writeNFTs(insertTxResult.nfTokensData);
backend_->writeNFTTransactions(insertTxResult.nfTokenTxData);
}
backend_->finishWrites(sequence);

View File

@@ -19,12 +19,12 @@
#pragma once
#include <data/BackendInterface.h>
#include <etl/SystemState.h>
#include <feed/SubscriptionManager.h>
#include <util/Assert.h>
#include <util/LedgerUtils.h>
#include <util/log/Logger.h>
#include "data/BackendInterface.h"
#include "etl/SystemState.h"
#include "feed/SubscriptionManager.h"
#include "util/Assert.h"
#include "util/LedgerUtils.h"
#include "util/log/Logger.h"
#include <ripple/protocol/LedgerHeader.h>

View File

@@ -19,18 +19,18 @@
#pragma once
#include <data/BackendInterface.h>
#include <etl/SystemState.h>
#include <etl/impl/AmendmentBlock.h>
#include <etl/impl/LedgerLoader.h>
#include <util/Assert.h>
#include <util/LedgerUtils.h>
#include <util/Profiler.h>
#include <util/log/Logger.h>
#include "data/BackendInterface.h"
#include "etl/SystemState.h"
#include "etl/impl/AmendmentBlock.h"
#include "etl/impl/LedgerLoader.h"
#include "util/Assert.h"
#include "util/LedgerUtils.h"
#include "util/Profiler.h"
#include "util/log/Logger.h"
#include <grpcpp/grpcpp.h>
#include <ripple/beast/core/CurrentThreadName.h>
#include <ripple/proto/org/xrpl/rpc/v1/xrp_ledger.grpc.pb.h>
#include <grpcpp/grpcpp.h>
#include <chrono>
#include <memory>
@@ -199,8 +199,8 @@ private:
<< rawData.transactions_list().transactions_size();
backend_->writeAccountTransactions(std::move(insertTxResultOp->accountTxData));
backend_->writeNFTs(std::move(insertTxResultOp->nfTokensData));
backend_->writeNFTTransactions(std::move(insertTxResultOp->nfTokenTxData));
backend_->writeNFTs(insertTxResultOp->nfTokensData);
backend_->writeNFTTransactions(insertTxResultOp->nfTokenTxData);
auto [success, duration] =
::util::timed<std::chrono::duration<double>>([&]() { return backend_->finishWrites(lgrInfo.seq); });

View File

@@ -17,10 +17,39 @@
*/
//==============================================================================
#include <feed/SubscriptionManager.h>
#include <rpc/BookChangesHelper.h>
#include <rpc/RPCHelpers.h>
#include <util/Assert.h>
#include "feed/SubscriptionManager.h"
#include "data/BackendInterface.h"
#include "data/Types.h"
#include "rpc/BookChangesHelper.h"
#include "rpc/RPCHelpers.h"
#include "util/Assert.h"
#include <boost/asio/post.hpp>
#include <boost/asio/spawn.hpp>
#include <boost/json/object.hpp>
#include <boost/json/serialize.hpp>
#include <ripple/basics/base_uint.h>
#include <ripple/basics/strHex.h>
#include <ripple/protocol/AccountID.h>
#include <ripple/protocol/Book.h>
#include <ripple/protocol/Fees.h>
#include <ripple/protocol/LedgerFormats.h>
#include <ripple/protocol/LedgerHeader.h>
#include <ripple/protocol/SField.h>
#include <ripple/protocol/STAmount.h>
#include <ripple/protocol/STObject.h>
#include <ripple/protocol/TER.h>
#include <ripple/protocol/TxFormats.h>
#include <cstdint>
#include <memory>
#include <mutex>
#include <optional>
#include <string>
#include <unordered_set>
#include <utility>
#include <vector>
namespace feed {
@@ -240,7 +269,8 @@ SubscriptionManager::pubTransaction(data::TransactionAndMetadata const& blobs, r
// determine the OrderBook
ripple::Book const book{
data->getFieldAmount(ripple::sfTakerGets).issue(),
data->getFieldAmount(ripple::sfTakerPays).issue()};
data->getFieldAmount(ripple::sfTakerPays).issue()
};
if (alreadySent.find(book) == alreadySent.end()) {
bookSubscribers_.publish(pubMsg, book);
alreadySent.insert(book);

View File

@@ -19,14 +19,14 @@
#pragma once
#include <data/BackendInterface.h>
#include <util/config/Config.h>
#include <util/log/Logger.h>
#include <util/prometheus/Prometheus.h>
#include <web/interface/ConnectionBase.h>
#include "data/BackendInterface.h"
#include "util/config/Config.h"
#include "util/log/Logger.h"
#include "util/prometheus/Prometheus.h"
#include "web/interface/ConnectionBase.h"
#include <ripple/protocol/LedgerHeader.h>
#include <fmt/format.h>
#include <ripple/protocol/LedgerHeader.h>
#include <memory>

View File

@@ -17,27 +17,43 @@
*/
//==============================================================================
#include <grpc/impl/codegen/port_platform.h>
#include "data/BackendFactory.h"
#include "etl/ETLHelpers.h"
#include "etl/ETLService.h"
#include "main/Build.h"
#include "rpc/Counters.h"
#include "rpc/RPCEngine.h"
#include "rpc/WorkQueue.h"
#include "rpc/common/impl/HandlerProvider.h"
#include "util/TerminationHandler.h"
#include "util/config/Config.h"
#include "util/log/Logger.h"
#include "util/prometheus/Prometheus.h"
#include "web/DOSGuard.h"
#include "web/IntervalSweepHandler.h"
#include "web/RPCServerHandler.h"
#include "web/Server.h"
#include "web/WhitelistHandler.h"
#include <data/BackendFactory.h>
#include <etl/ETLService.h>
#include <rpc/Counters.h>
#include <rpc/RPCEngine.h>
#include <rpc/common/impl/HandlerProvider.h>
#include <util/TerminationHandler.h>
#include <util/config/Config.h>
#include <util/prometheus/Prometheus.h>
#include <web/RPCServerHandler.h>
#include <web/Server.h>
#include <boost/date_time/posix_time/posix_time_types.hpp>
#include <boost/filesystem/path.hpp>
#include <boost/json.hpp>
#include <boost/program_options.hpp>
#include <boost/asio/buffer.hpp>
#include <boost/asio/io_context.hpp>
#include <boost/asio/ssl/context.hpp>
#include <boost/program_options/options_description.hpp>
#include <boost/program_options/parsers.hpp>
#include <boost/program_options/positional_options.hpp>
#include <boost/program_options/value_semantic.hpp>
#include <boost/program_options/variables_map.hpp>
#include <cstdint>
#include <cstdlib>
#include <exception>
#include <fstream>
#include <main/Build.h>
#include <functional>
#include <ios>
#include <iostream>
#include <memory>
#include <optional>
#include <ostream>
#include <sstream>
#include <string>
#include <thread>

View File

@@ -20,7 +20,6 @@
#pragma once
#include <ripple/basics/base_uint.h>
#include <ripple/protocol/digest.h>
namespace rpc {

View File

@@ -20,7 +20,7 @@
/** @file */
#pragma once
#include <rpc/RPCHelpers.h>
#include "rpc/RPCHelpers.h"
#include <set>

View File

@@ -17,9 +17,22 @@
*/
//==============================================================================
#include <rpc/Counters.h>
#include <rpc/JS.h>
#include <rpc/RPCHelpers.h>
#include "rpc/Counters.h"
#include "rpc/JS.h"
#include "rpc/WorkQueue.h"
#include "util/prometheus/Label.h"
#include "util/prometheus/Prometheus.h"
#include <boost/json/object.hpp>
#include <fmt/core.h>
#include <ripple/protocol/jss.h>
#include <chrono>
#include <functional>
#include <mutex>
#include <string>
#include <utility>
namespace rpc {

View File

@@ -19,8 +19,8 @@
#pragma once
#include <rpc/WorkQueue.h>
#include <util/prometheus/Prometheus.h>
#include "rpc/WorkQueue.h"
#include "util/prometheus/Prometheus.h"
#include <boost/json.hpp>

View File

@@ -17,10 +17,22 @@
*/
//==============================================================================
#include <rpc/Errors.h>
#include <rpc/JS.h>
#include "rpc/Errors.h"
#include "rpc/JS.h"
#include <boost/json/object.hpp>
#include <ripple/protocol/ErrorCodes.h>
#include <ripple/protocol/jss.h>
#include <algorithm>
#include <cstdint>
#include <iterator>
#include <optional>
#include <stdexcept>
#include <string>
#include <string_view>
#include <variant>
using namespace std;

View File

@@ -20,9 +20,8 @@
/** @file */
#pragma once
#include <ripple/protocol/ErrorCodes.h>
#include <boost/json/object.hpp>
#include <ripple/protocol/ErrorCodes.h>
#include <optional>
#include <string>

View File

@@ -17,8 +17,25 @@
*/
//==============================================================================
#include <rpc/Factories.h>
#include <rpc/common/Types.h>
#include "rpc/Factories.h"
#include "data/Types.h"
#include "rpc/Errors.h"
#include "rpc/common/APIVersion.h"
#include "rpc/common/Types.h"
#include "util/Expected.h"
#include "util/Taggable.h"
#include "web/Context.h"
#include <boost/asio/spawn.hpp>
#include <boost/json/array.hpp>
#include <boost/json/object.hpp>
#include <boost/json/value.hpp>
#include <ripple/protocol/ErrorCodes.h>
#include <functional>
#include <memory>
#include <string>
using namespace std;
using namespace util;

View File

@@ -19,12 +19,12 @@
#pragma once
#include <data/BackendInterface.h>
#include <rpc/Errors.h>
#include <rpc/common/APIVersion.h>
#include <util/Expected.h>
#include <web/Context.h>
#include <web/interface/ConnectionBase.h>
#include "data/BackendInterface.h"
#include "rpc/Errors.h"
#include "rpc/common/APIVersion.h"
#include "util/Expected.h"
#include "web/Context.h"
#include "web/interface/ConnectionBase.h"
#include <boost/asio/spawn.hpp>
#include <boost/json.hpp>

View File

@@ -19,7 +19,7 @@
#pragma once
#include <util/JsonUtils.h>
#include "util/JsonUtils.h"
#include <ripple/protocol/jss.h>

View File

@@ -19,19 +19,19 @@
#pragma once
#include <data/BackendInterface.h>
#include <etl/Source.h>
#include <rpc/Counters.h>
#include <rpc/Errors.h>
#include <rpc/RPCHelpers.h>
#include <rpc/common/AnyHandler.h>
#include <rpc/common/Types.h>
#include <rpc/common/impl/ForwardingProxy.h>
#include <util/Taggable.h>
#include <util/config/Config.h>
#include <util/log/Logger.h>
#include <web/Context.h>
#include <web/DOSGuard.h>
#include "data/BackendInterface.h"
#include "etl/Source.h"
#include "rpc/Counters.h"
#include "rpc/Errors.h"
#include "rpc/RPCHelpers.h"
#include "rpc/common/AnyHandler.h"
#include "rpc/common/Types.h"
#include "rpc/common/impl/ForwardingProxy.h"
#include "util/Taggable.h"
#include "util/config/Config.h"
#include "util/log/Logger.h"
#include "web/Context.h"
#include "web/DOSGuard.h"
#include <boost/asio/spawn.hpp>
#include <boost/json.hpp>

View File

@@ -17,18 +17,84 @@
*/
//==============================================================================
#include <data/BackendInterface.h>
#include <data/DBHelpers.h>
#include <rpc/Errors.h>
#include <rpc/RPCHelpers.h>
#include <util/Profiler.h>
#include <util/log/Logger.h>
#include "rpc/RPCHelpers.h"
#include "data/BackendInterface.h"
#include "data/Types.h"
#include "rpc/Errors.h"
#include "rpc/JS.h"
#include "rpc/common/Types.h"
#include "util/Profiler.h"
#include "util/log/Logger.h"
#include "web/Context.h"
#include <boost/algorithm/string/case_conv.hpp>
#include <boost/asio/spawn.hpp>
#include <boost/format/format_fwd.hpp>
#include <boost/format/free_funcs.hpp>
#include <boost/json/array.hpp>
#include <boost/json/object.hpp>
#include <boost/json/parse.hpp>
#include <boost/json/string.hpp>
#include <boost/json/value.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/lexical_cast/bad_lexical_cast.hpp>
#include <fmt/core.h>
#include <ripple/basics/Slice.h>
#include <ripple/basics/StringUtilities.h>
#include <ripple/basics/XRPAmount.h>
#include <ripple/basics/base_uint.h>
#include <ripple/basics/chrono.h>
#include <ripple/basics/strHex.h>
#include <ripple/beast/utility/Zero.h>
#include <ripple/json/json_value.h>
#include <ripple/protocol/AccountID.h>
#include <ripple/protocol/Book.h>
#include <ripple/protocol/ErrorCodes.h>
#include <ripple/protocol/Indexes.h>
#include <ripple/protocol/Issue.h>
#include <ripple/protocol/KeyType.h>
#include <ripple/protocol/Keylet.h>
#include <ripple/protocol/LedgerFormats.h>
#include <ripple/protocol/LedgerHeader.h>
#include <ripple/protocol/NFTSyntheticSerializer.h>
#include <ripple/protocol/PublicKey.h>
#include <ripple/protocol/Rate.h>
#include <ripple/protocol/SField.h>
#include <ripple/protocol/STAmount.h>
#include <ripple/protocol/STBase.h>
#include <ripple/protocol/STLedgerEntry.h>
#include <ripple/protocol/STObject.h>
#include <ripple/protocol/STTx.h>
#include <ripple/protocol/SecretKey.h>
#include <ripple/protocol/Seed.h>
#include <ripple/protocol/Serializer.h>
#include <ripple/protocol/TER.h>
#include <ripple/protocol/TxFormats.h>
#include <ripple/protocol/TxMeta.h>
#include <ripple/protocol/UintTypes.h>
#include <ripple/protocol/jss.h>
#include <ripple/protocol/nftPageMask.h>
#include <boost/algorithm/string.hpp>
#include <boost/format.hpp>
#include <ripple/protocol/tokens.h>
#include <algorithm>
#include <array>
#include <chrono>
#include <cstddef>
#include <cstdint>
#include <exception>
#include <functional>
#include <iterator>
#include <limits>
#include <map>
#include <memory>
#include <optional>
#include <sstream>
#include <string>
#include <string_view>
#include <utility>
#include <variant>
#include <vector>
// local to compilation unit loggers
namespace {
@@ -80,8 +146,6 @@ getDeliveredAmount(
if (meta->hasDeliveredAmount())
return meta->getDeliveredAmount();
if (txn->isFieldPresent(ripple::sfAmount)) {
using namespace std::chrono_literals;
// Ledger 4594095 is the first ledger in which the DeliveredAmount field
// was present when a partial payment was made and its absence indicates
// that the amount delivered is listed in the Amount field.
@@ -325,6 +389,7 @@ parseStringAsUInt(std::string const& value)
try {
index = boost::lexical_cast<std::uint32_t>(value);
} catch (boost::bad_lexical_cast const&) {
index = std::nullopt;
}
return index;
@@ -390,7 +455,7 @@ getLedgerInfoFromHashOrSeq(
)
{
std::optional<ripple::LedgerHeader> lgrInfo;
auto const err = Status{RippledError::rpcLGR_NOT_FOUND, "ledgerNotFound"};
auto err = Status{RippledError::rpcLGR_NOT_FOUND, "ledgerNotFound"};
if (ledgerHash) {
// invoke uint256's constructor to parse the hex string , instead of
// copying buffer
@@ -459,7 +524,7 @@ traverseNFTObjects(
ripple::uint256 nextPage,
std::uint32_t limit,
boost::asio::yield_context yield,
std::function<void(ripple::SLE&&)> atOwnedNode
std::function<void(ripple::SLE)> atOwnedNode
)
{
auto const firstNFTPage = ripple::keylet::nftpage_min(accountID);
@@ -511,7 +576,7 @@ traverseOwnedNodes(
std::uint32_t limit,
std::optional<std::string> jsonCursor,
boost::asio::yield_context yield,
std::function<void(ripple::SLE&&)> atOwnedNode,
std::function<void(ripple::SLE)> atOwnedNode,
bool nftIncluded
)
{
@@ -565,7 +630,7 @@ traverseOwnedNodes(
std::uint32_t sequence,
std::uint32_t limit,
boost::asio::yield_context yield,
std::function<void(ripple::SLE&&)> atOwnedNode
std::function<void(ripple::SLE)> atOwnedNode
)
{
auto cursor = AccountCursor({beast::zero, 0});
@@ -750,7 +815,8 @@ keypairFromRequst(boost::json::object const& request)
if (count > 1) {
return Status{
RippledError::rpcINVALID_PARAMS,
"Exactly one of the following must be specified: passphrase, secret, seed, or seed_hex"};
"Exactly one of the following must be specified: passphrase, secret, seed, or seed_hex"
};
}
std::optional<ripple::KeyType> keyType;
@@ -1129,22 +1195,26 @@ parseBook(ripple::Currency pays, ripple::AccountID payIssuer, ripple::Currency g
{
if (isXRP(pays) && !isXRP(payIssuer)) {
return Status{
RippledError::rpcSRC_ISR_MALFORMED, "Unneeded field 'taker_pays.issuer' for XRP currency specification."};
RippledError::rpcSRC_ISR_MALFORMED, "Unneeded field 'taker_pays.issuer' for XRP currency specification."
};
}
if (!isXRP(pays) && isXRP(payIssuer)) {
return Status{
RippledError::rpcSRC_ISR_MALFORMED, "Invalid field 'taker_pays.issuer', expected non-XRP issuer."};
RippledError::rpcSRC_ISR_MALFORMED, "Invalid field 'taker_pays.issuer', expected non-XRP issuer."
};
}
if (ripple::isXRP(gets) && !ripple::isXRP(getIssuer)) {
return Status{
RippledError::rpcDST_ISR_MALFORMED, "Unneeded field 'taker_gets.issuer' for XRP currency specification."};
RippledError::rpcDST_ISR_MALFORMED, "Unneeded field 'taker_gets.issuer' for XRP currency specification."
};
}
if (!ripple::isXRP(gets) && ripple::isXRP(getIssuer)) {
return Status{
RippledError::rpcDST_ISR_MALFORMED, "Invalid field 'taker_gets.issuer', expected non-XRP issuer."};
RippledError::rpcDST_ISR_MALFORMED, "Invalid field 'taker_gets.issuer', expected non-XRP issuer."
};
}
if (pays == gets && payIssuer == getIssuer)
@@ -1209,12 +1279,14 @@ parseBook(boost::json::object const& request)
if (isXRP(pay_currency) && !isXRP(pay_issuer)) {
return Status{
RippledError::rpcSRC_ISR_MALFORMED, "Unneeded field 'taker_pays.issuer' for XRP currency specification."};
RippledError::rpcSRC_ISR_MALFORMED, "Unneeded field 'taker_pays.issuer' for XRP currency specification."
};
}
if (!isXRP(pay_currency) && isXRP(pay_issuer)) {
return Status{
RippledError::rpcSRC_ISR_MALFORMED, "Invalid field 'taker_pays.issuer', expected non-XRP issuer."};
RippledError::rpcSRC_ISR_MALFORMED, "Invalid field 'taker_pays.issuer', expected non-XRP issuer."
};
}
if ((!isXRP(pay_currency)) && (!taker_pays.contains("issuer")))
@@ -1231,7 +1303,8 @@ parseBook(boost::json::object const& request)
if (get_issuer == ripple::noAccount()) {
return Status{
RippledError::rpcDST_ISR_MALFORMED, "Invalid field 'taker_gets.issuer', bad issuer account one."};
RippledError::rpcDST_ISR_MALFORMED, "Invalid field 'taker_gets.issuer', bad issuer account one."
};
}
} else {
get_issuer = ripple::xrpAccount();
@@ -1239,12 +1312,14 @@ parseBook(boost::json::object const& request)
if (ripple::isXRP(get_currency) && !ripple::isXRP(get_issuer)) {
return Status{
RippledError::rpcDST_ISR_MALFORMED, "Unneeded field 'taker_gets.issuer' for XRP currency specification."};
RippledError::rpcDST_ISR_MALFORMED, "Unneeded field 'taker_gets.issuer' for XRP currency specification."
};
}
if (!ripple::isXRP(get_currency) && ripple::isXRP(get_issuer)) {
return Status{
RippledError::rpcDST_ISR_MALFORMED, "Invalid field 'taker_gets.issuer', expected non-XRP issuer."};
RippledError::rpcDST_ISR_MALFORMED, "Invalid field 'taker_gets.issuer', expected non-XRP issuer."
};
}
if (pay_currency == get_currency && pay_issuer == get_issuer)
@@ -1307,7 +1382,8 @@ isAmendmentEnabled(
auto const& amendments = backend->fetchLedgerObject(ripple::keylet::amendments().key, seq, yield);
ripple::SLE const amendmentsSLE{
ripple::SerialIter{amendments->data(), amendments->size()}, ripple::keylet::amendments().key};
ripple::SerialIter{amendments->data(), amendments->size()}, ripple::keylet::amendments().key
};
auto const listAmendments = amendmentsSLE.getFieldV256(ripple::sfAmendments);
return std::find(listAmendments.begin(), listAmendments.end(), amendmentId) != listAmendments.end();

View File

@@ -24,21 +24,20 @@
* This file contains a variety of utility functions used when executing the handlers.
*/
#include <data/BackendInterface.h>
#include <rpc/Amendments.h>
#include <rpc/JS.h>
#include <rpc/common/Types.h>
#include <util/JsonUtils.h>
#include <web/Context.h>
#include "data/BackendInterface.h"
#include "rpc/Amendments.h"
#include "rpc/JS.h"
#include "rpc/common/Types.h"
#include "util/JsonUtils.h"
#include "web/Context.h"
#include <boost/regex.hpp>
#include <fmt/core.h>
#include <ripple/protocol/Indexes.h>
#include <ripple/protocol/Rate.h>
#include <ripple/protocol/STLedgerEntry.h>
#include <ripple/protocol/STTx.h>
#include <boost/regex.hpp>
#include <fmt/core.h>
namespace rpc {
enum class NFTokenjson { ENABLE, DISABLE };
@@ -157,7 +156,7 @@ traverseOwnedNodes(
std::uint32_t sequence,
std::uint32_t limit,
boost::asio::yield_context yield,
std::function<void(ripple::SLE&&)> atOwnedNode
std::function<void(ripple::SLE)> atOwnedNode
);
// Remove the account check from traverseOwnedNodes
@@ -170,7 +169,7 @@ traverseOwnedNodes(
std::uint32_t limit,
std::optional<std::string> jsonCursor,
boost::asio::yield_context yield,
std::function<void(ripple::SLE&&)> atOwnedNode,
std::function<void(ripple::SLE)> atOwnedNode,
bool nftIncluded = false
);

View File

@@ -17,7 +17,12 @@
*/
//==============================================================================
#include <rpc/WorkQueue.h>
#include "rpc/WorkQueue.h"
#include "util/prometheus/Label.h"
#include "util/prometheus/Prometheus.h"
#include <cstdint>
namespace rpc {

View File

@@ -19,9 +19,9 @@
#pragma once
#include <util/config/Config.h>
#include <util/log/Logger.h>
#include <util/prometheus/Prometheus.h>
#include "util/config/Config.h"
#include "util/log/Logger.h"
#include "util/prometheus/Prometheus.h"
#include <boost/asio.hpp>
#include <boost/asio/spawn.hpp>

View File

@@ -19,8 +19,8 @@
#pragma once
#include <rpc/common/Types.h>
#include <util/Expected.h>
#include "rpc/common/Types.h"
#include "util/Expected.h"
#include <boost/json.hpp>

View File

@@ -19,9 +19,9 @@
#pragma once
#include <rpc/common/Concepts.h>
#include <rpc/common/Types.h>
#include <rpc/common/impl/Processors.h>
#include "rpc/common/Concepts.h"
#include "rpc/common/Types.h"
#include "rpc/common/impl/Processors.h"
namespace rpc {

View File

@@ -19,7 +19,7 @@
#pragma once
#include <rpc/common/Types.h>
#include "rpc/common/Types.h"
#include <boost/json/value_from.hpp>
#include <boost/json/value_to.hpp>

View File

@@ -17,10 +17,13 @@
*/
//==============================================================================
#include <rpc/RPCHelpers.h>
#include <rpc/common/MetaProcessors.h>
#include "rpc/common/MetaProcessors.h"
#include "rpc/Errors.h"
#include "rpc/common/Types.h"
#include <boost/json/value.hpp>
#include <ripple/protocol/ErrorCodes.h>
#include <string_view>

View File

@@ -19,10 +19,10 @@
#pragma once
#include <rpc/common/Concepts.h>
#include <rpc/common/Specs.h>
#include <rpc/common/Types.h>
#include <rpc/common/Validators.h>
#include "rpc/common/Concepts.h"
#include "rpc/common/Specs.h"
#include "rpc/common/Types.h"
#include "rpc/common/Validators.h"
#include <fmt/core.h>

View File

@@ -19,10 +19,10 @@
#pragma once
#include <rpc/common/Concepts.h>
#include <rpc/common/Specs.h>
#include <rpc/common/Types.h>
#include <util/JsonUtils.h>
#include "rpc/common/Concepts.h"
#include "rpc/common/Specs.h"
#include "rpc/common/Types.h"
#include "util/JsonUtils.h"
#include <string_view>

View File

@@ -17,7 +17,9 @@
*/
//==============================================================================
#include <rpc/common/Specs.h>
#include "rpc/common/Specs.h"
#include "rpc/common/Types.h"
#include <boost/json/value.hpp>

View File

@@ -19,9 +19,9 @@
#pragma once
#include <rpc/common/Concepts.h>
#include <rpc/common/Types.h>
#include <rpc/common/impl/Factories.h>
#include "rpc/common/Concepts.h"
#include "rpc/common/Types.h"
#include "rpc/common/impl/Factories.h"
#include <string>
#include <vector>

View File

@@ -19,14 +19,13 @@
#pragma once
#include <rpc/Errors.h>
#include <util/Expected.h>
#include <ripple/basics/base_uint.h>
#include "rpc/Errors.h"
#include "util/Expected.h"
#include <boost/asio/spawn.hpp>
#include <boost/json/value.hpp>
#include <boost/json/value_from.hpp>
#include <ripple/basics/base_uint.h>
namespace etl {
class LoadBalancer;

View File

@@ -17,14 +17,27 @@
*/
//==============================================================================
#include <ripple/basics/base_uint.h>
#include <rpc/RPCHelpers.h>
#include <rpc/common/Validators.h>
#include "rpc/common/Validators.h"
#include "rpc/Errors.h"
#include "rpc/RPCHelpers.h"
#include "rpc/common/Types.h"
#include <boost/json/object.hpp>
#include <boost/json/value.hpp>
#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>
#include <charconv>
#include <cstdint>
#include <string>
#include <string_view>
#include <system_error>
#include <unordered_set>
namespace rpc::validation {
@@ -144,8 +157,9 @@ CustomValidator IssuerValidator =
return Error{Status{RippledError::rpcINVALID_PARAMS, fmt::format("Invalid field '{}', bad issuer.", key)}};
if (issuer == ripple::noAccount()) {
return Error{Status{
RippledError::rpcINVALID_PARAMS, fmt::format("Invalid field '{}', bad issuer account one.", key)}};
return Error{
Status{RippledError::rpcINVALID_PARAMS, fmt::format("Invalid field '{}', bad issuer account one.", key)}
};
}
return MaybeError{};
@@ -157,10 +171,12 @@ CustomValidator SubscribeStreamValidator =
return Error{Status{RippledError::rpcINVALID_PARAMS, std::string(key) + "NotArray"}};
static std::unordered_set<std::string> const validStreams = {
"ledger", "transactions", "transactions_proposed", "book_changes", "manifests", "validations"};
"ledger", "transactions", "transactions_proposed", "book_changes", "manifests", "validations"
};
static std::unordered_set<std::string> const reportingNotSupportStreams = {
"peer_status", "consensus", "server"};
"peer_status", "consensus", "server"
};
for (auto const& v : value.as_array()) {
if (!v.is_string())
return Error{Status{RippledError::rpcINVALID_PARAMS, "streamNotString"}};

View File

@@ -19,9 +19,9 @@
#pragma once
#include <rpc/common/Concepts.h>
#include <rpc/common/Specs.h>
#include <rpc/common/Types.h>
#include "rpc/common/Concepts.h"
#include "rpc/common/Specs.h"
#include "rpc/common/Types.h"
#include <fmt/core.h>
@@ -118,7 +118,8 @@ public:
if (value_ == res) {
return Error{Status{
RippledError::rpcNOT_SUPPORTED,
fmt::format("Not supported field '{}'s value '{}'", std::string{key}, res)}};
fmt::format("Not supported field '{}'s value '{}'", std::string{key}, res)
}};
}
}
return {};

View File

@@ -17,11 +17,18 @@
*/
//==============================================================================
#include <rpc/common/impl/APIVersionParser.h>
#include <util/log/Logger.h>
#include "rpc/common/impl/APIVersionParser.h"
#include "rpc/common/APIVersion.h"
#include "util/Expected.h"
#include "util/log/Logger.h"
#include <boost/json/object.hpp>
#include <fmt/core.h>
#include <cstdint>
#include <string>
using namespace std;
namespace rpc::detail {

View File

@@ -19,10 +19,10 @@
#pragma once
#include <rpc/common/APIVersion.h>
#include <util/Expected.h>
#include <util/config/Config.h>
#include <util/log/Logger.h>
#include "rpc/common/APIVersion.h"
#include "util/Expected.h"
#include "util/config/Config.h"
#include "util/log/Logger.h"
#include <algorithm>
#include <string>

View File

@@ -19,8 +19,8 @@
#pragma once
#include <rpc/common/Concepts.h>
#include <rpc/common/Types.h>
#include "rpc/common/Concepts.h"
#include "rpc/common/Types.h"
#include <boost/json/value.hpp>

View File

@@ -19,13 +19,13 @@
#pragma once
#include <etl/LoadBalancer.h>
#include <etl/Source.h>
#include <rpc/Counters.h>
#include <rpc/RPCHelpers.h>
#include <rpc/common/Types.h>
#include <util/log/Logger.h>
#include <web/Context.h>
#include "etl/LoadBalancer.h"
#include "etl/Source.h"
#include "rpc/Counters.h"
#include "rpc/RPCHelpers.h"
#include "rpc/common/Types.h"
#include "util/log/Logger.h"
#include "web/Context.h"
#include <memory>
#include <string>

Some files were not shown because too many files have changed in this diff Show More