diff --git a/src/rpc/RPCEngine.hpp b/src/rpc/RPCEngine.hpp index 4a1874e4..0fe41b9c 100644 --- a/src/rpc/RPCEngine.hpp +++ b/src/rpc/RPCEngine.hpp @@ -166,12 +166,12 @@ public: auto const extracted = [&result]() -> std::expected { - if (result.response.has_value()) + if (result.response.has_value()) { return std::move(result.response).value(); - else - return std::unexpected{util::ResponseExpirationCache::Error{ - .status = std::move(result.response).error(), .warnings = std::move(result.warnings) - }}; + } + return std::unexpected{util::ResponseExpirationCache::Error{ + .status = std::move(result.response).error(), .warnings = std::move(result.warnings) + }}; }(); if (extracted.has_value()) { diff --git a/src/rpc/RPCHelpers.cpp b/src/rpc/RPCHelpers.cpp index 11d11aca..43e24096 100644 --- a/src/rpc/RPCHelpers.cpp +++ b/src/rpc/RPCHelpers.cpp @@ -99,7 +99,6 @@ #include #include #include -#include #include // local to compilation unit loggers @@ -1417,10 +1416,11 @@ parseBook(boost::json::object const& request) if (!takerGets["issuer"].is_string()) return std::unexpected{Status{RippledError::rpcINVALID_PARAMS, "taker_gets.issuer should be string"}}; - if (!ripple::to_issuer(getIssuer, boost::json::value_to(takerGets.at("issuer")))) + if (!ripple::to_issuer(getIssuer, boost::json::value_to(takerGets.at("issuer")))) { return std::unexpected{ Status{RippledError::rpcDST_ISR_MALFORMED, "Invalid field 'taker_gets.issuer', bad issuer."} }; + } if (getIssuer == ripple::noAccount()) { return std::unexpected{ diff --git a/src/rpc/handlers/AMMInfo.cpp b/src/rpc/handlers/AMMInfo.cpp index 23b517df..4aad6a1f 100644 --- a/src/rpc/handlers/AMMInfo.cpp +++ b/src/rpc/handlers/AMMInfo.cpp @@ -57,7 +57,6 @@ #include #include #include -#include namespace { diff --git a/src/rpc/handlers/AccountChannels.cpp b/src/rpc/handlers/AccountChannels.cpp index 6f2ef6ee..d9dfff66 100644 --- a/src/rpc/handlers/AccountChannels.cpp +++ b/src/rpc/handlers/AccountChannels.cpp @@ -44,7 +44,6 @@ #include #include #include -#include #include namespace rpc { diff --git a/src/rpc/handlers/AccountCurrencies.cpp b/src/rpc/handlers/AccountCurrencies.cpp index 471a61fe..ba34aa39 100644 --- a/src/rpc/handlers/AccountCurrencies.cpp +++ b/src/rpc/handlers/AccountCurrencies.cpp @@ -40,7 +40,6 @@ #include #include #include -#include namespace rpc { AccountCurrenciesHandler::Result diff --git a/src/rpc/handlers/AccountInfo.cpp b/src/rpc/handlers/AccountInfo.cpp index f90c7b15..4f03c7f4 100644 --- a/src/rpc/handlers/AccountInfo.cpp +++ b/src/rpc/handlers/AccountInfo.cpp @@ -46,7 +46,6 @@ #include #include #include -#include #include namespace rpc { diff --git a/src/rpc/handlers/AccountLines.cpp b/src/rpc/handlers/AccountLines.cpp index cd3d0d4c..6021356e 100644 --- a/src/rpc/handlers/AccountLines.cpp +++ b/src/rpc/handlers/AccountLines.cpp @@ -43,7 +43,6 @@ #include #include #include -#include #include namespace rpc { diff --git a/src/rpc/handlers/AccountNFTs.cpp b/src/rpc/handlers/AccountNFTs.cpp index a9fd4541..a517a8c5 100644 --- a/src/rpc/handlers/AccountNFTs.cpp +++ b/src/rpc/handlers/AccountNFTs.cpp @@ -45,7 +45,6 @@ #include #include #include -#include namespace rpc { diff --git a/src/rpc/handlers/AccountObjects.cpp b/src/rpc/handlers/AccountObjects.cpp index 9a8658b4..574137bf 100644 --- a/src/rpc/handlers/AccountObjects.cpp +++ b/src/rpc/handlers/AccountObjects.cpp @@ -44,7 +44,6 @@ #include #include #include -#include #include namespace rpc { diff --git a/src/rpc/handlers/AccountOffers.cpp b/src/rpc/handlers/AccountOffers.cpp index 0483ed9c..c079f9e7 100644 --- a/src/rpc/handlers/AccountOffers.cpp +++ b/src/rpc/handlers/AccountOffers.cpp @@ -41,7 +41,6 @@ #include #include -#include #include namespace rpc { diff --git a/src/rpc/handlers/AccountTx.cpp b/src/rpc/handlers/AccountTx.cpp index ca919f33..cd8bb724 100644 --- a/src/rpc/handlers/AccountTx.cpp +++ b/src/rpc/handlers/AccountTx.cpp @@ -46,7 +46,6 @@ #include #include #include -#include namespace rpc { diff --git a/src/rpc/handlers/BookChanges.cpp b/src/rpc/handlers/BookChanges.cpp index 5365a49c..5078579d 100644 --- a/src/rpc/handlers/BookChanges.cpp +++ b/src/rpc/handlers/BookChanges.cpp @@ -21,7 +21,6 @@ #include "data/Types.hpp" #include "rpc/BookChangesHelper.hpp" -#include "rpc/Errors.hpp" #include "rpc/JS.hpp" #include "rpc/RPCHelpers.hpp" #include "rpc/common/Types.hpp" @@ -37,7 +36,6 @@ #include #include -#include #include namespace rpc { diff --git a/src/rpc/handlers/BookOffers.cpp b/src/rpc/handlers/BookOffers.cpp index 84e7eb21..0322ee6a 100644 --- a/src/rpc/handlers/BookOffers.cpp +++ b/src/rpc/handlers/BookOffers.cpp @@ -19,7 +19,6 @@ #include "rpc/handlers/BookOffers.hpp" -#include "rpc/Errors.hpp" #include "rpc/JS.hpp" #include "rpc/RPCHelpers.hpp" #include "rpc/common/Types.hpp" @@ -39,7 +38,6 @@ #include #include -#include namespace rpc { diff --git a/src/rpc/handlers/DepositAuthorized.cpp b/src/rpc/handlers/DepositAuthorized.cpp index 1f02ec32..b3fcb0ff 100644 --- a/src/rpc/handlers/DepositAuthorized.cpp +++ b/src/rpc/handlers/DepositAuthorized.cpp @@ -45,7 +45,6 @@ #include #include #include -#include namespace rpc { diff --git a/src/rpc/handlers/Feature.cpp b/src/rpc/handlers/Feature.cpp index 540daa50..0f054be6 100644 --- a/src/rpc/handlers/Feature.cpp +++ b/src/rpc/handlers/Feature.cpp @@ -45,7 +45,6 @@ #include #include #include -#include #include namespace rpc { diff --git a/src/rpc/handlers/GatewayBalances.cpp b/src/rpc/handlers/GatewayBalances.cpp index 8b99eca3..a312aedc 100644 --- a/src/rpc/handlers/GatewayBalances.cpp +++ b/src/rpc/handlers/GatewayBalances.cpp @@ -50,7 +50,6 @@ #include #include #include -#include #include namespace rpc { diff --git a/src/rpc/handlers/GetAggregatePrice.cpp b/src/rpc/handlers/GetAggregatePrice.cpp index 3563ae4a..9a27a845 100644 --- a/src/rpc/handlers/GetAggregatePrice.cpp +++ b/src/rpc/handlers/GetAggregatePrice.cpp @@ -54,7 +54,6 @@ #include #include #include -#include namespace rpc { diff --git a/src/rpc/handlers/Ledger.cpp b/src/rpc/handlers/Ledger.cpp index 4f70d8a8..0aa99fe7 100644 --- a/src/rpc/handlers/Ledger.cpp +++ b/src/rpc/handlers/Ledger.cpp @@ -20,7 +20,6 @@ #include "rpc/handlers/Ledger.hpp" #include "data/Types.hpp" -#include "rpc/Errors.hpp" #include "rpc/JS.hpp" #include "rpc/RPCHelpers.hpp" #include "rpc/common/Types.hpp" @@ -46,7 +45,6 @@ #include #include #include -#include namespace rpc { LedgerHandler::Result diff --git a/src/rpc/handlers/LedgerData.cpp b/src/rpc/handlers/LedgerData.cpp index 3a7be791..788c8fd8 100644 --- a/src/rpc/handlers/LedgerData.cpp +++ b/src/rpc/handlers/LedgerData.cpp @@ -46,7 +46,6 @@ #include #include #include -#include #include namespace rpc { diff --git a/src/rpc/handlers/LedgerEntry.cpp b/src/rpc/handlers/LedgerEntry.cpp index d312b981..2b39dc3a 100644 --- a/src/rpc/handlers/LedgerEntry.cpp +++ b/src/rpc/handlers/LedgerEntry.cpp @@ -54,7 +54,6 @@ #include #include #include -#include namespace rpc { diff --git a/src/rpc/handlers/MPTHolders.cpp b/src/rpc/handlers/MPTHolders.cpp index 94d8f547..22eda31c 100644 --- a/src/rpc/handlers/MPTHolders.cpp +++ b/src/rpc/handlers/MPTHolders.cpp @@ -40,7 +40,6 @@ #include #include -#include using namespace ripple; diff --git a/src/rpc/handlers/NFTHistory.cpp b/src/rpc/handlers/NFTHistory.cpp index 22385869..35f8be77 100644 --- a/src/rpc/handlers/NFTHistory.cpp +++ b/src/rpc/handlers/NFTHistory.cpp @@ -44,7 +44,6 @@ #include #include #include -#include namespace rpc { diff --git a/src/rpc/handlers/NFTInfo.cpp b/src/rpc/handlers/NFTInfo.cpp index 7dd20c7d..35950b11 100644 --- a/src/rpc/handlers/NFTInfo.cpp +++ b/src/rpc/handlers/NFTInfo.cpp @@ -37,7 +37,6 @@ #include #include -#include using namespace ripple; diff --git a/src/rpc/handlers/NFTOffersCommon.cpp b/src/rpc/handlers/NFTOffersCommon.cpp index 1dfba3c2..ddb0b327 100644 --- a/src/rpc/handlers/NFTOffersCommon.cpp +++ b/src/rpc/handlers/NFTOffersCommon.cpp @@ -48,7 +48,6 @@ #include #include #include -#include #include using namespace ripple; diff --git a/src/rpc/handlers/NFTsByIssuer.cpp b/src/rpc/handlers/NFTsByIssuer.cpp index 0e27c519..1d332b49 100644 --- a/src/rpc/handlers/NFTsByIssuer.cpp +++ b/src/rpc/handlers/NFTsByIssuer.cpp @@ -39,7 +39,6 @@ #include #include -#include using namespace ripple; diff --git a/src/rpc/handlers/NoRippleCheck.cpp b/src/rpc/handlers/NoRippleCheck.cpp index 5bc84141..31557f7f 100644 --- a/src/rpc/handlers/NoRippleCheck.cpp +++ b/src/rpc/handlers/NoRippleCheck.cpp @@ -51,7 +51,6 @@ #include #include #include -#include namespace rpc { diff --git a/src/rpc/handlers/Subscribe.cpp b/src/rpc/handlers/Subscribe.cpp index 53e4e834..5e6c7482 100644 --- a/src/rpc/handlers/Subscribe.cpp +++ b/src/rpc/handlers/Subscribe.cpp @@ -49,7 +49,6 @@ #include #include #include -#include #include namespace rpc { diff --git a/src/rpc/handlers/TransactionEntry.cpp b/src/rpc/handlers/TransactionEntry.cpp index 7c26f68b..2890f03e 100644 --- a/src/rpc/handlers/TransactionEntry.cpp +++ b/src/rpc/handlers/TransactionEntry.cpp @@ -36,7 +36,6 @@ #include #include -#include namespace rpc { diff --git a/src/rpc/handlers/Unsubscribe.cpp b/src/rpc/handlers/Unsubscribe.cpp index ff6e245e..4dc68766 100644 --- a/src/rpc/handlers/Unsubscribe.cpp +++ b/src/rpc/handlers/Unsubscribe.cpp @@ -40,7 +40,6 @@ #include #include #include -#include #include namespace rpc { diff --git a/tests/unit/rpc/ForwardingProxyTests.cpp b/tests/unit/rpc/ForwardingProxyTests.cpp index fe152d30..3e79bbfc 100644 --- a/tests/unit/rpc/ForwardingProxyTests.cpp +++ b/tests/unit/rpc/ForwardingProxyTests.cpp @@ -39,7 +39,6 @@ #include #include #include -#include #include using namespace rpc; diff --git a/tests/unit/rpc/RPCEngineTests.cpp b/tests/unit/rpc/RPCEngineTests.cpp index bdd5734a..d924fedc 100644 --- a/tests/unit/rpc/RPCEngineTests.cpp +++ b/tests/unit/rpc/RPCEngineTests.cpp @@ -53,7 +53,6 @@ #include #include #include -#include #include using namespace data; diff --git a/tests/unit/rpc/RPCHelpersTests.cpp b/tests/unit/rpc/RPCHelpersTests.cpp index cf45cbc5..b1837eaf 100644 --- a/tests/unit/rpc/RPCHelpersTests.cpp +++ b/tests/unit/rpc/RPCHelpersTests.cpp @@ -62,7 +62,6 @@ #include #include #include -#include #include using namespace data; diff --git a/tests/unit/rpc/handlers/BookOffersTests.cpp b/tests/unit/rpc/handlers/BookOffersTests.cpp index 1a5e1b2b..148812a2 100644 --- a/tests/unit/rpc/handlers/BookOffersTests.cpp +++ b/tests/unit/rpc/handlers/BookOffersTests.cpp @@ -37,7 +37,6 @@ #include #include #include -#include #include #include #include diff --git a/tests/unit/rpc/handlers/SubscribeTests.cpp b/tests/unit/rpc/handlers/SubscribeTests.cpp index 0bd95464..4fe27e3e 100644 --- a/tests/unit/rpc/handlers/SubscribeTests.cpp +++ b/tests/unit/rpc/handlers/SubscribeTests.cpp @@ -39,7 +39,6 @@ #include #include #include -#include #include #include