From 389cecb012397ed64806b6a289cf36271cf0eefd Mon Sep 17 00:00:00 2001 From: Alex Kremer Date: Wed, 26 Aug 2026 17:55:14 +0100 Subject: [PATCH] Fix merge conflicts --- src/rpc/handlers/AccountTx.hpp | 8 ++++---- src/rpc/handlers/MPTokenIssuanceHistory.hpp | 4 ++-- src/util/CMakeLists.txt | 1 + src/util/LedgerUtils.cpp | 9 +++------ src/util/LedgerUtils.hpp | 10 +++------- tests/unit/util/TxUtilTests.cpp | 4 ++-- 6 files changed, 15 insertions(+), 21 deletions(-) diff --git a/src/rpc/handlers/AccountTx.hpp b/src/rpc/handlers/AccountTx.hpp index 3ef5e2486..63036133b 100644 --- a/src/rpc/handlers/AccountTx.hpp +++ b/src/rpc/handlers/AccountTx.hpp @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include #include @@ -114,9 +114,9 @@ public: static RpcSpecConstRef spec([[maybe_unused]] uint32_t apiVersion) { - // TODO: reaches into rpcspec's detail namespace; goes away when account_tx moves - // to the shared spec, where the tx_type validator calls this internally. - auto const& typesKeysInLowercase = spec::detail::txTypesInLowercase(); + // TODO: goes away when account_tx moves to the shared spec, where the tx_type + // validator calls this internally. + auto const& typesKeysInLowercase = spec::txTypesInLowercase(); static auto const kRpcSpecForV1 = RpcSpec{ {JS(account), validation::Required{}, validation::CustomValidators::accountValidator}, {JS(ledger_hash), validation::CustomValidators::uint256HexStringValidator}, diff --git a/src/rpc/handlers/MPTokenIssuanceHistory.hpp b/src/rpc/handlers/MPTokenIssuanceHistory.hpp index b5f565bff..8d71f3e38 100644 --- a/src/rpc/handlers/MPTokenIssuanceHistory.hpp +++ b/src/rpc/handlers/MPTokenIssuanceHistory.hpp @@ -9,13 +9,13 @@ #include "rpc/common/Specs.hpp" #include "rpc/common/Types.hpp" #include "rpc/common/Validators.hpp" -#include "util/TxUtils.hpp" #include "util/log/Logger.hpp" #include #include #include #include +#include #include #include #include @@ -124,7 +124,7 @@ public: static RpcSpecConstRef spec([[maybe_unused]] uint32_t apiVersion) { - auto const& typesKeysInLowercase = util::getTxTypesInLowercase(); + auto const& typesKeysInLowercase = spec::txTypesInLowercase(); static auto const kRpcSpec = RpcSpec{ {JS(mpt_issuance_id), validation::Required{}, diff --git a/src/util/CMakeLists.txt b/src/util/CMakeLists.txt index 185682ace..eba68cfa2 100644 --- a/src/util/CMakeLists.txt +++ b/src/util/CMakeLists.txt @@ -59,6 +59,7 @@ target_link_libraries( fmt::fmt openssl::openssl xrpl::libxrpl + rpcspec::rpcspec Threads::Threads clio_options clio_rpc_center diff --git a/src/util/LedgerUtils.cpp b/src/util/LedgerUtils.cpp index 4e72c7797..8ac0e8846 100644 --- a/src/util/LedgerUtils.cpp +++ b/src/util/LedgerUtils.cpp @@ -1,25 +1,22 @@ #include "util/LedgerUtils.hpp" -#include +#include #include #include namespace util { -// TODO: both lookups reach into rpcspec's detail namespace; they switch to the public -// rpcspec ledger-types API in the next PR. - xrpl::LedgerEntryType LedgerTypes::getLedgerEntryTypeFromStr(std::string const& entryName) { - return rpc::spec::detail::ledgerEntryTypeFromStr(entryName); + return rpc::spec::ledgerEntryTypeFromStr(entryName); } xrpl::LedgerEntryType LedgerTypes::getAccountOwnedLedgerTypeFromStr(std::string const& entryName) { - return rpc::spec::detail::accountOwnedLedgerTypeFromStr(entryName); + return rpc::spec::accountOwnedLedgerTypeFromStr(entryName); } } // namespace util diff --git a/src/util/LedgerUtils.hpp b/src/util/LedgerUtils.hpp index 710dc32c2..261804bb8 100644 --- a/src/util/LedgerUtils.hpp +++ b/src/util/LedgerUtils.hpp @@ -1,7 +1,7 @@ #pragma once #include -#include +#include #include #include #include @@ -22,9 +22,7 @@ namespace util { * @brief A helper class that provides lists of different ledger type category. */ class LedgerTypes { - // TODO: reaches into rpcspec's detail namespace; switches to the public rpcspec - // ledger-types API in the next PR. - static constexpr auto const& kLedgerTypes = rpc::spec::detail::kLedgerTypesTable; + static constexpr auto const& kLedgerTypes = rpc::spec::kLedgerTypesTable; public: /** @@ -49,10 +47,8 @@ public: static constexpr auto getDeletionBlockerLedgerTypes() { - // TODO: LedgerCategory comes from rpcspec's detail namespace; switches to the - // public rpcspec ledger-types API in the next PR. constexpr auto kFilter = [](auto const& item) { - return item.category == rpc::spec::detail::LedgerCategory::DeletionBlocker; + return item.category == rpc::spec::LedgerCategory::DeletionBlocker; }; constexpr auto kDeletionBlockersCount = diff --git a/tests/unit/util/TxUtilTests.cpp b/tests/unit/util/TxUtilTests.cpp index fd941357d..fdc037e69 100644 --- a/tests/unit/util/TxUtilTests.cpp +++ b/tests/unit/util/TxUtilTests.cpp @@ -1,7 +1,7 @@ #include "util/JsonUtils.hpp" #include -#include +#include #include #include @@ -12,7 +12,7 @@ TEST(TxUtilTests, txTypesInLowercase) { // TODO: reaches into rpcspec's detail namespace; switches to the public rpcspec // tx-types API in the next PR. - auto const& types = rpc::spec::detail::txTypesInLowercase(); + auto const& types = rpc::spec::txTypesInLowercase(); ASSERT_TRUE( std::size_t( std::distance(