From fbeb806ffd932feef478ed84a3ba2c3119d3fc2a Mon Sep 17 00:00:00 2001 From: John Freeman Date: Tue, 15 Oct 2024 18:27:56 -0500 Subject: [PATCH] Reformat code with clang-format-18 --- include/xrpl/basics/Expected.h | 53 ++-- include/xrpl/basics/FeeUnits.h | 24 +- include/xrpl/basics/IOUAmount.h | 6 +- include/xrpl/basics/Number.h | 6 +- include/xrpl/basics/XRPAmount.h | 6 +- include/xrpl/basics/base_uint.h | 3 +- include/xrpl/basics/safe_cast.h | 4 +- include/xrpl/basics/tagged_integer.h | 3 +- .../container/detail/aged_ordered_container.h | 8 +- .../detail/aged_unordered_container.h | 10 +- include/xrpl/beast/hash/xxhasher.h | 3 +- include/xrpl/beast/unit_test.h | 2 +- include/xrpl/beast/utility/Journal.h | 3 +- include/xrpl/json/json_value.h | 6 +- include/xrpl/protocol/AccountID.h | 2 +- include/xrpl/protocol/ApiVersion.h | 41 ++- include/xrpl/protocol/MultiApiJson.h | 84 +++-- include/xrpl/protocol/STAmount.h | 6 +- include/xrpl/protocol/STBase.h | 6 +- include/xrpl/protocol/STObject.h | 3 +- include/xrpl/protocol/STVector256.h | 3 +- include/xrpl/protocol/TER.h | 57 ++-- include/xrpl/protocol/digest.h | 21 +- include/xrpl/protocol/jss.h | 70 ++--- include/xrpl/server/detail/BaseHTTPPeer.h | 4 +- src/libxrpl/basics/ResolverAsio.cpp | 6 +- src/libxrpl/beast/insight/NullCollector.cpp | 12 +- .../beast/utility/src/beast_Journal.cpp | 6 +- src/libxrpl/json/Writer.cpp | 3 +- src/libxrpl/protocol/STAmount.cpp | 3 +- src/libxrpl/protocol/STBase.cpp | 3 +- src/libxrpl/protocol/STCurrency.cpp | 3 +- src/libxrpl/protocol/STInteger.cpp | 12 +- src/libxrpl/protocol/STIssue.cpp | 3 +- src/libxrpl/protocol/STParsedJSON.cpp | 3 +- src/libxrpl/protocol/STPathSet.cpp | 3 +- src/libxrpl/protocol/STVector256.cpp | 3 +- src/magic/magic_enum.h | 151 ++++----- src/test/app/Import_test.cpp | 16 +- src/test/app/NFTokenBurn_test.cpp | 3 +- src/test/app/Remit_test.cpp | 1 - src/test/app/SetRemarks_test.cpp | 5 +- src/test/app/ValidatorSite_test.cpp | 25 +- src/test/basics/IOUAmount_test.cpp | 95 +++--- src/test/basics/XRPAmount_test.cpp | 112 +++---- src/test/basics/base_uint_test.cpp | 3 +- src/test/beast/beast_Zero_test.cpp | 6 +- .../consensus/ByzantineFailureSim_test.cpp | 4 +- src/test/csf/Peer.h | 3 +- src/test/csf/collectors.h | 221 ++++++-------- src/test/jtx/TestHelpers.h | 10 +- src/test/jtx/TrustedPublisherServer.h | 12 +- src/test/jtx/amount.h | 14 +- src/test/jtx/impl/AMM.cpp | 4 +- src/test/jtx/impl/amount.cpp | 3 +- src/test/jtx/multisign.h | 5 +- src/test/overlay/reduce_relay_test.cpp | 5 +- src/test/protocol/MultiApiJson_test.cpp | 280 +++++------------ src/test/protocol/STObject_test.cpp | 288 +++++++++--------- src/xrpld/app/hook/detail/applyHook.cpp | 46 ++- src/xrpld/app/ledger/LedgerHistory.cpp | 58 ++-- .../app/ledger/detail/TimeoutCounter.cpp | 4 +- src/xrpld/app/main/GRPCServer.cpp | 4 +- src/xrpld/app/misc/AMMHelpers.h | 6 +- src/xrpld/app/misc/NetworkOPs.cpp | 4 +- src/xrpld/app/misc/detail/TxQ.cpp | 10 +- src/xrpld/app/misc/detail/ValidatorList.cpp | 3 +- src/xrpld/app/paths/Pathfinder.cpp | 3 +- src/xrpld/app/paths/detail/BookStep.cpp | 3 +- src/xrpld/app/paths/detail/DirectStep.cpp | 6 +- .../app/paths/detail/XRPEndpointStep.cpp | 3 +- src/xrpld/app/rdb/RelationalDatabase.h | 4 +- src/xrpld/app/tx/detail/AMMCreate.cpp | 4 +- src/xrpld/app/tx/detail/CancelOffer.cpp | 4 +- src/xrpld/app/tx/detail/Import.cpp | 4 +- src/xrpld/app/tx/detail/Payment.cpp | 22 +- src/xrpld/app/tx/detail/Remit.cpp | 3 +- src/xrpld/app/tx/detail/Transactor.cpp | 6 +- src/xrpld/app/tx/detail/URIToken.cpp | 7 +- src/xrpld/conditions/detail/PreimageSha256.h | 3 +- src/xrpld/consensus/Consensus.h | 10 +- src/xrpld/consensus/Validations.h | 3 +- src/xrpld/core/DatabaseCon.h | 3 +- src/xrpld/ledger/View.h | 3 +- src/xrpld/ledger/detail/View.cpp | 6 +- src/xrpld/nodestore/detail/DatabaseNodeImp.h | 3 +- .../nodestore/detail/DatabaseRotatingImp.h | 3 +- src/xrpld/overlay/detail/PeerImp.cpp | 6 +- src/xrpld/overlay/detail/ProtocolVersion.cpp | 2 +- src/xrpld/peerfinder/detail/Logic.h | 6 +- src/xrpld/rpc/detail/ServerHandler.cpp | 6 +- src/xrpld/rpc/handlers/ServerDefinitions.cpp | 2 +- src/xrpld/shamap/detail/TaggedPointer.ipp | 20 +- src/xrpld/unity/rocksdb.h | 2 +- 94 files changed, 979 insertions(+), 1063 deletions(-) diff --git a/include/xrpl/basics/Expected.h b/include/xrpl/basics/Expected.h index 745fa50a6..10f188af1 100644 --- a/include/xrpl/basics/Expected.h +++ b/include/xrpl/basics/Expected.h @@ -136,44 +136,49 @@ class [[nodiscard]] Expected public: template - requires std::convertible_to constexpr Expected(U && r) - : Base(T(std::forward(r))) + requires std::convertible_to + constexpr Expected(U&& r) : Base(T(std::forward(r))) { } template - requires std::convertible_to && - (!std::is_reference_v)constexpr Expected(Unexpected e) - : Base(E(std::move(e.value()))) + requires std::convertible_to && (!std::is_reference_v) + constexpr Expected(Unexpected e) : Base(E(std::move(e.value()))) { } - constexpr bool has_value() const + constexpr bool + has_value() const { return Base::has_value(); } - constexpr T const& value() const + constexpr T const& + value() const { return Base::value(); } - constexpr T& value() + constexpr T& + value() { return Base::value(); } - constexpr E const& error() const + constexpr E const& + error() const { return Base::error(); } - constexpr E& error() + constexpr E& + error() { return Base::error(); } - constexpr explicit operator bool() const + constexpr explicit + operator bool() const { return has_value(); } @@ -181,22 +186,26 @@ public: // Add operator* and operator-> so the Expected API looks a bit more like // what std::expected is likely to look like. See: // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0323r10.html - [[nodiscard]] constexpr T& operator*() + [[nodiscard]] constexpr T& + operator*() { return this->value(); } - [[nodiscard]] constexpr T const& operator*() const + [[nodiscard]] constexpr T const& + operator*() const { return this->value(); } - [[nodiscard]] constexpr T* operator->() + [[nodiscard]] constexpr T* + operator->() { return &this->value(); } - [[nodiscard]] constexpr T const* operator->() const + [[nodiscard]] constexpr T const* + operator->() const { return &this->value(); } @@ -218,23 +227,25 @@ public: } template - requires std::convertible_to && - (!std::is_reference_v)constexpr Expected(Unexpected e) - : Base(E(std::move(e.value()))) + requires std::convertible_to && (!std::is_reference_v) + constexpr Expected(Unexpected e) : Base(E(std::move(e.value()))) { } - constexpr E const& error() const + constexpr E const& + error() const { return Base::error(); } - constexpr E& error() + constexpr E& + error() { return Base::error(); } - constexpr explicit operator bool() const + constexpr explicit + operator bool() const { return Base::has_value(); } diff --git a/include/xrpl/basics/FeeUnits.h b/include/xrpl/basics/FeeUnits.h index 9d5e6e216..c63a169f0 100644 --- a/include/xrpl/basics/FeeUnits.h +++ b/include/xrpl/basics/FeeUnits.h @@ -84,13 +84,13 @@ private: protected: template static constexpr bool is_compatible_v = - std::is_arithmetic_v&& std::is_arithmetic_v&& - std::is_convertible_v; + std::is_arithmetic_v && std::is_arithmetic_v && + std::is_convertible_v; template > static constexpr bool is_compatiblefee_v = - is_compatible_v&& - std::is_same_v; + is_compatible_v && + std::is_same_v; template using enable_if_compatible_t = @@ -110,7 +110,8 @@ public: { } - constexpr TaggedFee& operator=(beast::Zero) + constexpr TaggedFee& + operator=(beast::Zero) { fee_ = 0; return *this; @@ -250,7 +251,8 @@ public: } /** Returns true if the amount is not zero */ - explicit constexpr operator bool() const noexcept + explicit constexpr + operator bool() const noexcept { return fee_ != 0; } @@ -344,8 +346,8 @@ constexpr bool can_muldiv_source_v = template > constexpr bool can_muldiv_dest_v = - can_muldiv_source_v&& // Dest is also a source - std::is_convertible_v && + can_muldiv_source_v && // Dest is also a source + std::is_convertible_v && sizeof(typename Dest::value_type) >= sizeof(std::uint64_t); template < @@ -354,8 +356,8 @@ template < class = enable_if_unit_t, class = enable_if_unit_t> constexpr bool can_muldiv_sources_v = - can_muldiv_source_v&& can_muldiv_source_v&& std:: - is_same_v; + can_muldiv_source_v && can_muldiv_source_v && + std::is_same_v; template < class Source1, @@ -365,7 +367,7 @@ template < class = enable_if_unit_t, class = enable_if_unit_t> constexpr bool can_muldiv_v = - can_muldiv_sources_v&& can_muldiv_dest_v; + can_muldiv_sources_v && can_muldiv_dest_v; // Source and Dest can be the same by default template < diff --git a/include/xrpl/basics/IOUAmount.h b/include/xrpl/basics/IOUAmount.h index 221434aa8..e89feb123 100644 --- a/include/xrpl/basics/IOUAmount.h +++ b/include/xrpl/basics/IOUAmount.h @@ -82,7 +82,8 @@ public: operator<(IOUAmount const& other) const; /** Returns true if the amount is not zero */ - explicit operator bool() const noexcept; + explicit + operator bool() const noexcept; /** Return the sign of the amount */ int @@ -109,7 +110,8 @@ inline IOUAmount::IOUAmount(std::int64_t mantissa, int exponent) normalize(); } -inline IOUAmount& IOUAmount::operator=(beast::Zero) +inline IOUAmount& +IOUAmount::operator=(beast::Zero) { // The -100 is used to allow 0 to sort less than small positive values // which will have a large negative exponent. diff --git a/include/xrpl/basics/Number.h b/include/xrpl/basics/Number.h index 30ce3f731..5856ef325 100644 --- a/include/xrpl/basics/Number.h +++ b/include/xrpl/basics/Number.h @@ -88,8 +88,10 @@ public: static constexpr Number lowest() noexcept; - explicit operator XRPAmount() const; // round to nearest, even on tie - explicit operator rep() const; // round to nearest, even on tie + explicit + operator XRPAmount() const; // round to nearest, even on tie + explicit + operator rep() const; // round to nearest, even on tie friend constexpr bool operator==(Number const& x, Number const& y) noexcept diff --git a/include/xrpl/basics/XRPAmount.h b/include/xrpl/basics/XRPAmount.h index 1d3b32f16..9a3226951 100644 --- a/include/xrpl/basics/XRPAmount.h +++ b/include/xrpl/basics/XRPAmount.h @@ -65,7 +65,8 @@ public: { } - constexpr XRPAmount& operator=(beast::Zero) + constexpr XRPAmount& + operator=(beast::Zero) { drops_ = 0; return *this; @@ -155,7 +156,8 @@ public: } /** Returns true if the amount is not zero */ - explicit constexpr operator bool() const noexcept + explicit constexpr + operator bool() const noexcept { return drops_ != 0; } diff --git a/include/xrpl/basics/base_uint.h b/include/xrpl/basics/base_uint.h index a2576b148..03ff339f0 100644 --- a/include/xrpl/basics/base_uint.h +++ b/include/xrpl/basics/base_uint.h @@ -533,7 +533,8 @@ public: return bytes; } - base_uint& operator=(beast::Zero) + base_uint& + operator=(beast::Zero) { data_.fill(0); return *this; diff --git a/include/xrpl/basics/safe_cast.h b/include/xrpl/basics/safe_cast.h index e52bceca7..f193f1793 100644 --- a/include/xrpl/basics/safe_cast.h +++ b/include/xrpl/basics/safe_cast.h @@ -30,8 +30,8 @@ namespace ripple { template static constexpr bool is_safetocasttovalue_v = - (std::is_integral_v && std::is_integral_v)&&( - std::is_signed::value || std::is_unsigned::value) && + (std::is_integral_v && std::is_integral_v) && + (std::is_signed::value || std::is_unsigned::value) && (std::is_signed::value != std::is_signed::value ? sizeof(Dest) > sizeof(Src) : sizeof(Dest) >= sizeof(Src)); diff --git a/include/xrpl/basics/tagged_integer.h b/include/xrpl/basics/tagged_integer.h index 3ab8c5340..4629e8309 100644 --- a/include/xrpl/basics/tagged_integer.h +++ b/include/xrpl/basics/tagged_integer.h @@ -187,7 +187,8 @@ public: return *this; } - explicit operator Int() const noexcept + explicit + operator Int() const noexcept { return m_value; } diff --git a/include/xrpl/beast/container/detail/aged_ordered_container.h b/include/xrpl/beast/container/detail/aged_ordered_container.h index 90a8ea147..ad807e92c 100644 --- a/include/xrpl/beast/container/detail/aged_ordered_container.h +++ b/include/xrpl/beast/container/detail/aged_ordered_container.h @@ -846,8 +846,9 @@ public: // set template auto - insert(value_type&& value) -> typename std:: - enable_if>::type; + insert(value_type&& value) -> typename std::enable_if< + !maybe_multi && !maybe_map, + std::pair>::type; // multiset template @@ -1795,7 +1796,8 @@ template < template auto aged_ordered_container:: - insert(value_type&& value) -> typename std:: + insert(value_type&& value) -> + typename std:: enable_if>::type { typename cont_type::insert_commit_data d; diff --git a/include/xrpl/beast/container/detail/aged_unordered_container.h b/include/xrpl/beast/container/detail/aged_unordered_container.h index 45efb3f55..72e333480 100644 --- a/include/xrpl/beast/container/detail/aged_unordered_container.h +++ b/include/xrpl/beast/container/detail/aged_unordered_container.h @@ -1057,8 +1057,9 @@ public: // map, set template auto - insert(value_type&& value) -> typename std:: - enable_if>::type; + insert(value_type&& value) -> typename std::enable_if< + !maybe_multi && !maybe_map, + std::pair>::type; // multimap, multiset template @@ -2799,8 +2800,9 @@ aged_unordered_container< Clock, Hash, KeyEqual, - Allocator>::insert(value_type&& value) -> typename std:: - enable_if>::type + Allocator>::insert(value_type&& value) -> + typename std:: + enable_if>::type { maybe_rehash(1); typename cont_type::insert_commit_data d; diff --git a/include/xrpl/beast/hash/xxhasher.h b/include/xrpl/beast/hash/xxhasher.h index 1a6fc5023..30af05ef0 100644 --- a/include/xrpl/beast/hash/xxhasher.h +++ b/include/xrpl/beast/hash/xxhasher.h @@ -90,7 +90,8 @@ public: XXH3_64bits_update(state_, key, len); } - explicit operator std::size_t() noexcept + explicit + operator std::size_t() noexcept { return XXH3_64bits_digest(state_); } diff --git a/include/xrpl/beast/unit_test.h b/include/xrpl/beast/unit_test.h index eff82583e..bf33b205e 100644 --- a/include/xrpl/beast/unit_test.h +++ b/include/xrpl/beast/unit_test.h @@ -34,7 +34,7 @@ #ifndef BEAST_EXPECT #define BEAST_EXPECT_S1(x) #x #define BEAST_EXPECT_S2(x) BEAST_EXPECT_S1(x) -//#define BEAST_EXPECT(cond) {expect(cond, __FILE__ ":" ## +// #define BEAST_EXPECT(cond) {expect(cond, __FILE__ ":" ## //__LINE__);}while(false){} #define BEAST_EXPECT(cond) expect(cond, __FILE__ ":" BEAST_EXPECT_S2(__LINE__)) #endif diff --git a/include/xrpl/beast/utility/Journal.h b/include/xrpl/beast/utility/Journal.h index 0738748b6..059355cca 100644 --- a/include/xrpl/beast/utility/Journal.h +++ b/include/xrpl/beast/utility/Journal.h @@ -238,7 +238,8 @@ public: return m_sink.active(m_level); } - explicit operator bool() const + explicit + operator bool() const { return active(); } diff --git a/include/xrpl/json/json_value.h b/include/xrpl/json/json_value.h index c2f9184d7..e41994017 100644 --- a/include/xrpl/json/json_value.h +++ b/include/xrpl/json/json_value.h @@ -64,7 +64,8 @@ public: { } - constexpr operator const char*() const + constexpr + operator const char*() const { return str_; } @@ -296,7 +297,8 @@ public: /** Returns false if this is an empty array, empty object, empty string, or null. */ - explicit operator bool() const; + explicit + operator bool() const; /// Remove all object members and array elements. /// \pre type() is arrayValue, objectValue, or nullValue diff --git a/include/xrpl/protocol/AccountID.h b/include/xrpl/protocol/AccountID.h index ebe7f014d..7edf8d388 100644 --- a/include/xrpl/protocol/AccountID.h +++ b/include/xrpl/protocol/AccountID.h @@ -22,7 +22,7 @@ #include // VFALCO Uncomment when the header issues are resolved -//#include +// #include #include #include #include diff --git a/include/xrpl/protocol/ApiVersion.h b/include/xrpl/protocol/ApiVersion.h index 1cd03b065..dd09cf6bd 100644 --- a/include/xrpl/protocol/ApiVersion.h +++ b/include/xrpl/protocol/ApiVersion.h @@ -76,38 +76,35 @@ static_assert(apiMaximumValidVersion >= apiMaximumSupportedVersion); } // namespace RPC template - void - forApiVersions(Fn const& fn, Args&&... args) requires // - (maxVer >= minVer) && // - (minVer >= RPC::apiMinimumSupportedVersion) && // - (RPC::apiMaximumValidVersion >= maxVer) && - requires -{ - fn(std::integral_constant{}, - std::forward(args)...); - fn(std::integral_constant{}, - std::forward(args)...); -} +void +forApiVersions(Fn const& fn, Args&&... args) + requires // + (maxVer >= minVer) && // + (minVer >= RPC::apiMinimumSupportedVersion) && // + (RPC::apiMaximumValidVersion >= maxVer) && requires { + fn(std::integral_constant{}, + std::forward(args)...); + fn(std::integral_constant{}, + std::forward(args)...); + } { constexpr auto size = maxVer + 1 - minVer; - [&](std::index_sequence) - { + [&](std::index_sequence) { (((void)fn( std::integral_constant{}, std::forward(args)...)), ...); - } - (std::make_index_sequence{}); + }(std::make_index_sequence{}); } template void -forAllApiVersions(Fn const& fn, Args&&... args) requires requires -{ - forApiVersions< - RPC::apiMinimumSupportedVersion, - RPC::apiMaximumValidVersion>(fn, std::forward(args)...); -} +forAllApiVersions(Fn const& fn, Args&&... args) + requires requires { + forApiVersions< + RPC::apiMinimumSupportedVersion, + RPC::apiMaximumValidVersion>(fn, std::forward(args)...); + } { forApiVersions< RPC::apiMinimumSupportedVersion, diff --git a/include/xrpl/protocol/MultiApiJson.h b/include/xrpl/protocol/MultiApiJson.h index 4514c54ea..73c274ff7 100644 --- a/include/xrpl/protocol/MultiApiJson.h +++ b/include/xrpl/protocol/MultiApiJson.h @@ -80,9 +80,8 @@ struct MultiApiJson } void - set(const char* key, - auto const& - v) requires std::constructible_from + set(const char* key, auto const& v) + requires std::constructible_from { for (auto& a : this->val) a[key] = v; @@ -110,7 +109,8 @@ struct MultiApiJson unsigned int Version, typename... Args, typename Fn> - requires std::same_as, MultiApiJson> auto + requires std::same_as, MultiApiJson> + auto operator()( Json& json, std::integral_constant const version, @@ -133,7 +133,8 @@ struct MultiApiJson // integral_constant version, Json only template - requires std::same_as, MultiApiJson> auto + requires std::same_as, MultiApiJson> + auto operator()( Json& json, std::integral_constant const, @@ -151,10 +152,10 @@ struct MultiApiJson typename... Args, typename Fn> requires(!some_integral_constant) && - std::convertible_to&& std::same_as< - std::remove_cvref_t, - MultiApiJson> auto - operator()(Json& json, Version version, Fn fn, Args&&... args) const + std::convertible_to && + std::same_as, MultiApiJson> + auto + operator()(Json& json, Version version, Fn fn, Args&&... args) const -> std:: invoke_result_t { @@ -170,9 +171,10 @@ struct MultiApiJson // unsigned int version, Json only template requires(!some_integral_constant) && - std::convertible_to&& std:: - same_as, MultiApiJson> auto - operator()(Json& json, Version version, Fn fn) const + std::convertible_to && + std::same_as, MultiApiJson> + auto + operator()(Json& json, Version version, Fn fn) const -> std::invoke_result_t { assert( @@ -184,53 +186,43 @@ struct MultiApiJson auto visit() { - return [self = this](auto... args) requires requires - { - visitor( - std::declval(), - std::declval()...); - } - { - return visitor(*self, std::forward(args)...); - }; + return [self = this](auto... args) + requires requires { + visitor( + std::declval(), + std::declval()...); + } + { return visitor(*self, std::forward(args)...); }; } auto visit() const { - return [self = this](auto... args) requires requires - { - visitor( - std::declval(), - std::declval()...); - } - { - return visitor(*self, std::forward(args)...); - }; + return [self = this](auto... args) + requires requires { + visitor( + std::declval(), + std::declval()...); + } + { return visitor(*self, std::forward(args)...); }; } template - auto - visit(Args... args) - -> std::invoke_result_t requires( - sizeof...(args) > 0) && - requires - { - visitor(*this, std::forward(args)...); - } + auto + visit(Args... args) + -> std::invoke_result_t + requires(sizeof...(args) > 0) && + requires { visitor(*this, std::forward(args)...); } { return visitor(*this, std::forward(args)...); } template - auto - visit(Args... args) const -> std:: - invoke_result_t requires( - sizeof...(args) > 0) && - requires - { - visitor(*this, std::forward(args)...); - } + auto + visit(Args... args) const + -> std::invoke_result_t + requires(sizeof...(args) > 0) && + requires { visitor(*this, std::forward(args)...); } { return visitor(*this, std::forward(args)...); } diff --git a/include/xrpl/protocol/STAmount.h b/include/xrpl/protocol/STAmount.h index b5a134a15..f5a8a4f11 100644 --- a/include/xrpl/protocol/STAmount.h +++ b/include/xrpl/protocol/STAmount.h @@ -197,7 +197,8 @@ public: // //-------------------------------------------------------------------------- - explicit operator bool() const noexcept; + explicit + operator bool() const noexcept; STAmount& operator+=(STAmount const&); @@ -388,7 +389,8 @@ inline STAmount::operator Number() const return iou(); } -inline STAmount& STAmount::operator=(beast::Zero) +inline STAmount& +STAmount::operator=(beast::Zero) { clear(); return *this; diff --git a/include/xrpl/protocol/STBase.h b/include/xrpl/protocol/STBase.h index e13ef6c5b..097341384 100644 --- a/include/xrpl/protocol/STBase.h +++ b/include/xrpl/protocol/STBase.h @@ -52,11 +52,13 @@ struct JsonOptions { } - [[nodiscard]] constexpr explicit operator underlying_t() const noexcept + [[nodiscard]] constexpr explicit + operator underlying_t() const noexcept { return value; } - [[nodiscard]] constexpr explicit operator bool() const noexcept + [[nodiscard]] constexpr explicit + operator bool() const noexcept { return value != 0u; } diff --git a/include/xrpl/protocol/STObject.h b/include/xrpl/protocol/STObject.h index b3cef83de..a226733e9 100644 --- a/include/xrpl/protocol/STObject.h +++ b/include/xrpl/protocol/STObject.h @@ -539,7 +539,8 @@ public: Fields with soeDEFAULT and set to the default value will return `true` */ - explicit operator bool() const noexcept; + explicit + operator bool() const noexcept; /** Return the contained value diff --git a/include/xrpl/protocol/STVector256.h b/include/xrpl/protocol/STVector256.h index e70297a40..d81ddf977 100644 --- a/include/xrpl/protocol/STVector256.h +++ b/include/xrpl/protocol/STVector256.h @@ -65,7 +65,8 @@ public: setValue(const STVector256& v); /** Retrieve a copy of the vector we contain */ - explicit operator std::vector() const; + explicit + operator std::vector() const; std::size_t size() const; diff --git a/include/xrpl/protocol/TER.h b/include/xrpl/protocol/TER.h index c74f84ce7..50d544de5 100644 --- a/include/xrpl/protocol/TER.h +++ b/include/xrpl/protocol/TER.h @@ -452,7 +452,8 @@ public: } // Conversion to bool. - explicit operator bool() const + explicit + operator bool() const { return code_ < tesSUCCESS || code_ >= tecCLAIM; } @@ -498,60 +499,66 @@ public: // Only enabled if both arguments return int if TERtiInt is called with them. template constexpr auto -operator==(L const& lhs, R const& rhs) -> std::enable_if_t< - std::is_same::value && - std::is_same::value, - bool> +operator==(L const& lhs, R const& rhs) + -> std::enable_if_t< + std::is_same::value && + std::is_same::value, + bool> { return TERtoInt(lhs) == TERtoInt(rhs); } template constexpr auto -operator!=(L const& lhs, R const& rhs) -> std::enable_if_t< - std::is_same::value && - std::is_same::value, - bool> +operator!=(L const& lhs, R const& rhs) + -> std::enable_if_t< + std::is_same::value && + std::is_same::value, + bool> { return TERtoInt(lhs) != TERtoInt(rhs); } template constexpr auto -operator<(L const& lhs, R const& rhs) -> std::enable_if_t< - std::is_same::value && - std::is_same::value, - bool> +operator<(L const& lhs, R const& rhs) + -> std::enable_if_t< + std::is_same::value && + std::is_same::value, + bool> { return TERtoInt(lhs) < TERtoInt(rhs); } template constexpr auto -operator<=(L const& lhs, R const& rhs) -> std::enable_if_t< - std::is_same::value && - std::is_same::value, - bool> +operator<=(L const& lhs, R const& rhs) + -> std::enable_if_t< + std::is_same::value && + std::is_same::value, + bool> { return TERtoInt(lhs) <= TERtoInt(rhs); } template constexpr auto -operator>(L const& lhs, R const& rhs) -> std::enable_if_t< - std::is_same::value && - std::is_same::value, - bool> +operator>(L const& lhs, R const& rhs) + -> std::enable_if_t< + std::is_same::value && + std::is_same::value, + bool> { return TERtoInt(lhs) > TERtoInt(rhs); } template constexpr auto -operator>=(L const& lhs, R const& rhs) -> std::enable_if_t< - std::is_same::value && - std::is_same::value, - bool> +operator>=(L const& lhs, R const& rhs) + -> std::enable_if_t< + std::is_same::value && + std::is_same::value, + bool> { return TERtoInt(lhs) >= TERtoInt(rhs); } diff --git a/include/xrpl/protocol/digest.h b/include/xrpl/protocol/digest.h index f3fc2ea5c..b3c7a0141 100644 --- a/include/xrpl/protocol/digest.h +++ b/include/xrpl/protocol/digest.h @@ -55,7 +55,8 @@ public: void operator()(void const* data, std::size_t size) noexcept; - explicit operator result_type() noexcept; + explicit + operator result_type() noexcept; private: char ctx_[96]; @@ -77,7 +78,8 @@ public: void operator()(void const* data, std::size_t size) noexcept; - explicit operator result_type() noexcept; + explicit + operator result_type() noexcept; private: char ctx_[216]; @@ -99,7 +101,8 @@ public: void operator()(void const* data, std::size_t size) noexcept; - explicit operator result_type() noexcept; + explicit + operator result_type() noexcept; private: char ctx_[112]; @@ -144,7 +147,8 @@ public: h_(data, size); } - explicit operator result_type() noexcept + explicit + operator result_type() noexcept { auto const d0 = sha256_hasher::result_type(h_); ripemd160_hasher rh; @@ -184,18 +188,21 @@ public: h_(data, size); } - explicit operator result_type() noexcept + explicit + operator result_type() noexcept { auto const digest = sha512_hasher::result_type(h_); return result_type::fromVoid(digest.data()); } private: - inline void erase(std::false_type) + inline void + erase(std::false_type) { } - inline void erase(std::true_type) + inline void + erase(std::true_type) { secure_erase(&h_, sizeof(h_)); } diff --git a/include/xrpl/protocol/jss.h b/include/xrpl/protocol/jss.h index 5fff30a3d..1475cd77a 100644 --- a/include/xrpl/protocol/jss.h +++ b/include/xrpl/protocol/jss.h @@ -67,35 +67,35 @@ JSS(AuthAccount); // in: AMM Auction Slot JSS(AuthAccounts); // in: AMM Auction Slot JSS(BaseAsset); // in: Oracle JSS(Blob); -JSS(Bridge); // ledger type. -JSS(Check); // ledger type. -JSS(CheckCancel); // transaction type. -JSS(CheckCash); // transaction type. -JSS(CheckCreate); // transaction type. -JSS(Clawback); // transaction type. -JSS(ClaimReward); // transaction type. -JSS(ClearFlag); // field. -JSS(CreateCode); // field. -JSS(DID); // ledger type. -JSS(DIDDelete); // transaction type. -JSS(DIDSet); // transaction type. -JSS(DeliverMax); // out: alias to Amount -JSS(DeliverMin); // in: TransactionSign -JSS(DepositPreauth); // transaction and ledger type. -JSS(Destination); // in: TransactionSign; field. -JSS(DirectoryNode); // ledger type. -JSS(EnableAmendment); // transaction type. -JSS(EPrice); // in: AMM Deposit option -JSS(EmitFailure); // transaction type. (cleanup emit) -JSS(Escrow); // ledger type. -JSS(EscrowCancel); // transaction type. -JSS(EscrowCreate); // transaction type. -JSS(EscrowFinish); // transaction type. -JSS(Fee); // in/out: TransactionSign; field. -JSS(FeeSettings); // ledger type. -JSS(FIELDS); // out: RPC server_definitions -JSS(Flags); // in/out: TransactionSign; field. -JSS(GenesisMint); // tt +JSS(Bridge); // ledger type. +JSS(Check); // ledger type. +JSS(CheckCancel); // transaction type. +JSS(CheckCash); // transaction type. +JSS(CheckCreate); // transaction type. +JSS(Clawback); // transaction type. +JSS(ClaimReward); // transaction type. +JSS(ClearFlag); // field. +JSS(CreateCode); // field. +JSS(DID); // ledger type. +JSS(DIDDelete); // transaction type. +JSS(DIDSet); // transaction type. +JSS(DeliverMax); // out: alias to Amount +JSS(DeliverMin); // in: TransactionSign +JSS(DepositPreauth); // transaction and ledger type. +JSS(Destination); // in: TransactionSign; field. +JSS(DirectoryNode); // ledger type. +JSS(EnableAmendment); // transaction type. +JSS(EPrice); // in: AMM Deposit option +JSS(EmitFailure); // transaction type. (cleanup emit) +JSS(Escrow); // ledger type. +JSS(EscrowCancel); // transaction type. +JSS(EscrowCreate); // transaction type. +JSS(EscrowFinish); // transaction type. +JSS(Fee); // in/out: TransactionSign; field. +JSS(FeeSettings); // ledger type. +JSS(FIELDS); // out: RPC server_definitions +JSS(Flags); // in/out: TransactionSign; field. +JSS(GenesisMint); // tt JSS(GenesisMints); JSS(GovernanceMarks); JSS(GovernanceFlags); @@ -325,12 +325,12 @@ JSS(coins); JSS(children); JSS(ctid); // in/out: Tx RPC JSS(cres); -JSS(currency_a); // out: BookChanges -JSS(currency_b); // out: BookChanges -JSS(currency); // in: paths/PathRequest, STAmount - // out: STPathSet, STAmount, - // AccountLines -JSS(current); // out: OwnerInfo +JSS(currency_a); // out: BookChanges +JSS(currency_b); // out: BookChanges +JSS(currency); // in: paths/PathRequest, STAmount + // out: STPathSet, STAmount, + // AccountLines +JSS(current); // out: OwnerInfo JSS(current_activities); JSS(current_ledger_size); // out: TxQ JSS(current_ledger); diff --git a/include/xrpl/server/detail/BaseHTTPPeer.h b/include/xrpl/server/detail/BaseHTTPPeer.h index 171eb7134..32ec4d300 100644 --- a/include/xrpl/server/detail/BaseHTTPPeer.h +++ b/include/xrpl/server/detail/BaseHTTPPeer.h @@ -244,7 +244,7 @@ BaseHTTPPeer::close() return post( strand_, std::bind( - (void (BaseHTTPPeer::*)(void)) & BaseHTTPPeer::close, + (void(BaseHTTPPeer::*)(void)) & BaseHTTPPeer::close, impl().shared_from_this())); boost::beast::get_lowest_layer(impl().stream_).close(); } @@ -507,7 +507,7 @@ BaseHTTPPeer::close(bool graceful) return post( strand_, std::bind( - (void (BaseHTTPPeer::*)(bool)) & + (void(BaseHTTPPeer::*)(bool)) & BaseHTTPPeer::close, impl().shared_from_this(), graceful)); diff --git a/src/libxrpl/basics/ResolverAsio.cpp b/src/libxrpl/basics/ResolverAsio.cpp index 53530da9d..7105eb12a 100644 --- a/src/libxrpl/basics/ResolverAsio.cpp +++ b/src/libxrpl/basics/ResolverAsio.cpp @@ -232,7 +232,8 @@ public: //------------------------------------------------------------------------- // Resolver - void do_stop(CompletionCounter) + void + do_stop(CompletionCounter) { assert(m_stop_called == true); @@ -330,7 +331,8 @@ public: std::string(port_first, port_last)); } - void do_work(CompletionCounter) + void + do_work(CompletionCounter) { if (m_stop_called == true) return; diff --git a/src/libxrpl/beast/insight/NullCollector.cpp b/src/libxrpl/beast/insight/NullCollector.cpp index 637cd06ec..12ea81701 100644 --- a/src/libxrpl/beast/insight/NullCollector.cpp +++ b/src/libxrpl/beast/insight/NullCollector.cpp @@ -41,7 +41,8 @@ class NullCounterImpl : public CounterImpl public: explicit NullCounterImpl() = default; - void increment(value_type) override + void + increment(value_type) override { } @@ -74,11 +75,13 @@ class NullGaugeImpl : public GaugeImpl public: explicit NullGaugeImpl() = default; - void set(value_type) override + void + set(value_type) override { } - void increment(difference_type) override + void + increment(difference_type) override { } @@ -94,7 +97,8 @@ class NullMeterImpl : public MeterImpl public: explicit NullMeterImpl() = default; - void increment(value_type) override + void + increment(value_type) override { } diff --git a/src/libxrpl/beast/utility/src/beast_Journal.cpp b/src/libxrpl/beast/utility/src/beast_Journal.cpp index 261e1f6cc..8ce7ea8d4 100644 --- a/src/libxrpl/beast/utility/src/beast_Journal.cpp +++ b/src/libxrpl/beast/utility/src/beast_Journal.cpp @@ -34,7 +34,8 @@ public: ~NullJournalSink() override = default; - bool active(severities::Severity) const override + bool + active(severities::Severity) const override { return false; } @@ -56,7 +57,8 @@ public: return severities::kDisabled; } - void threshold(severities::Severity) override + void + threshold(severities::Severity) override { } diff --git a/src/libxrpl/json/Writer.cpp b/src/libxrpl/json/Writer.cpp index ba7336209..2f7c0b523 100644 --- a/src/libxrpl/json/Writer.cpp +++ b/src/libxrpl/json/Writer.cpp @@ -285,7 +285,8 @@ Writer::output(double f) impl_->output({s.data(), lengthWithoutTrailingZeros(s)}); } -void Writer::output(std::nullptr_t) +void +Writer::output(std::nullptr_t) { impl_->output("null"); } diff --git a/src/libxrpl/protocol/STAmount.cpp b/src/libxrpl/protocol/STAmount.cpp index 236603d6c..bb9a24c12 100644 --- a/src/libxrpl/protocol/STAmount.cpp +++ b/src/libxrpl/protocol/STAmount.cpp @@ -650,7 +650,8 @@ STAmount::getText() const return ret; } -Json::Value STAmount::getJson(JsonOptions) const +Json::Value +STAmount::getJson(JsonOptions) const { Json::Value elem; setJson(elem); diff --git a/src/libxrpl/protocol/STBase.cpp b/src/libxrpl/protocol/STBase.cpp index b7e9c94ca..73565cbf7 100644 --- a/src/libxrpl/protocol/STBase.cpp +++ b/src/libxrpl/protocol/STBase.cpp @@ -96,7 +96,8 @@ STBase::getText() const return std::string(); } -Json::Value STBase::getJson(JsonOptions /*options*/) const +Json::Value +STBase::getJson(JsonOptions /*options*/) const { return getText(); } diff --git a/src/libxrpl/protocol/STCurrency.cpp b/src/libxrpl/protocol/STCurrency.cpp index c8fc65013..56ac19da1 100644 --- a/src/libxrpl/protocol/STCurrency.cpp +++ b/src/libxrpl/protocol/STCurrency.cpp @@ -50,7 +50,8 @@ STCurrency::getText() const return to_string(currency_); } -Json::Value STCurrency::getJson(JsonOptions) const +Json::Value +STCurrency::getJson(JsonOptions) const { return to_string(currency_); } diff --git a/src/libxrpl/protocol/STInteger.cpp b/src/libxrpl/protocol/STInteger.cpp index 7b7420006..af0c18a51 100644 --- a/src/libxrpl/protocol/STInteger.cpp +++ b/src/libxrpl/protocol/STInteger.cpp @@ -61,7 +61,8 @@ STUInt8::getText() const } template <> -Json::Value STUInt8::getJson(JsonOptions) const +Json::Value +STUInt8::getJson(JsonOptions) const { if (getFName() == sfTransactionResult) { @@ -118,7 +119,8 @@ STUInt16::getText() const } template <> -Json::Value STUInt16::getJson(JsonOptions) const +Json::Value +STUInt16::getJson(JsonOptions) const { if (getFName() == sfLedgerEntryType) { @@ -164,7 +166,8 @@ STUInt32::getText() const } template <> -Json::Value STUInt32::getJson(JsonOptions) const +Json::Value +STUInt32::getJson(JsonOptions) const { return value_; } @@ -192,7 +195,8 @@ STUInt64::getText() const } template <> -Json::Value STUInt64::getJson(JsonOptions) const +Json::Value +STUInt64::getJson(JsonOptions) const { std::string str(16, 0); auto ret = std::to_chars(str.data(), str.data() + str.size(), value_, 16); diff --git a/src/libxrpl/protocol/STIssue.cpp b/src/libxrpl/protocol/STIssue.cpp index 9dcee6498..00fe86b32 100644 --- a/src/libxrpl/protocol/STIssue.cpp +++ b/src/libxrpl/protocol/STIssue.cpp @@ -65,7 +65,8 @@ STIssue::getSType() const return STI_ISSUE; } -Json::Value STIssue::getJson(JsonOptions) const +Json::Value +STIssue::getJson(JsonOptions) const { return to_json(issue_); } diff --git a/src/libxrpl/protocol/STParsedJSON.cpp b/src/libxrpl/protocol/STParsedJSON.cpp index dec5e87ea..327b9ee31 100644 --- a/src/libxrpl/protocol/STParsedJSON.cpp +++ b/src/libxrpl/protocol/STParsedJSON.cpp @@ -967,8 +967,7 @@ parseArray( Json::Value const objectFields(json[i][objectName]); std::stringstream ss; - ss << json_name << "." - << "[" << i << "]." << objectName; + ss << json_name << "." << "[" << i << "]." << objectName; auto ret = parseObject( ss.str(), objectFields, nameField, depth + 1, error); diff --git a/src/libxrpl/protocol/STPathSet.cpp b/src/libxrpl/protocol/STPathSet.cpp index b65846527..78c47cadc 100644 --- a/src/libxrpl/protocol/STPathSet.cpp +++ b/src/libxrpl/protocol/STPathSet.cpp @@ -163,7 +163,8 @@ STPath::hasSeen( return false; } -Json::Value STPath::getJson(JsonOptions) const +Json::Value +STPath::getJson(JsonOptions) const { Json::Value ret(Json::arrayValue); diff --git a/src/libxrpl/protocol/STVector256.cpp b/src/libxrpl/protocol/STVector256.cpp index 2d8bc4ee2..385c0ef76 100644 --- a/src/libxrpl/protocol/STVector256.cpp +++ b/src/libxrpl/protocol/STVector256.cpp @@ -80,7 +80,8 @@ STVector256::isEquivalent(const STBase& t) const return v && (mValue == v->mValue); } -Json::Value STVector256::getJson(JsonOptions) const +Json::Value +STVector256::getJson(JsonOptions) const { Json::Value ret(Json::arrayValue); diff --git a/src/magic/magic_enum.h b/src/magic/magic_enum.h index 125424e44..299dc2df7 100644 --- a/src/magic/magic_enum.h +++ b/src/magic/magic_enum.h @@ -247,7 +247,8 @@ inline constexpr auto invalid_tag = // If need custom names for enum, add specialization enum_name for necessary // enum type. template -constexpr customize_t enum_name(E) noexcept +constexpr customize_t +enum_name(E) noexcept { return default_tag; } @@ -362,7 +363,8 @@ public: return N; } - constexpr operator string_view() const noexcept + constexpr + operator string_view() const noexcept { return {data(), size()}; } @@ -415,7 +417,8 @@ public: return 0; } - constexpr operator string_view() const noexcept + constexpr + operator string_view() const noexcept { return {}; } @@ -438,10 +441,11 @@ class case_insensitive public: template constexpr auto - operator()(L lhs, R rhs) const noexcept -> std::enable_if_t< - std::is_same_v, char_type> && - std::is_same_v, char_type>, - bool> + operator()(L lhs, R rhs) const noexcept + -> std::enable_if_t< + std::is_same_v, char_type> && + std::is_same_v, char_type>, + bool> { return Op{}(to_lower(lhs), to_lower(rhs)); } @@ -601,9 +605,8 @@ log2(I value) noexcept #define MAGIC_ENUM_ARRAY_CONSTEXPR 1 #else template -constexpr std::array, N> to_array( - T (&a)[N], - std::index_sequence) noexcept +constexpr std::array, N> +to_array(T (&a)[N], std::index_sequence) noexcept { return {{a[I]...}}; } @@ -611,7 +614,7 @@ constexpr std::array, N> to_array( template inline constexpr bool is_enum_v = - std::is_enum_v&& std::is_same_v>; + std::is_enum_v && std::is_same_v>; template constexpr auto @@ -1033,55 +1036,61 @@ reflected_max() noexcept } } -#define MAGIC_ENUM_FOR_EACH_256(T) \ - T(0) \ - T(1) T(2) T(3) T(4) T(5) T(6) T(7) T(8) T(9) T(10) T(11) T(12) T(13) T(14) \ - T(15) T(16) T(17) T(18) T(19) T(20) T(21) T(22) T(23) T(24) T(25) T( \ - 26) T(27) T(28) T(29) T(30) T(31) T(32) T(33) T(34) T(35) T(36) \ - T(37) T(38) T(39) T(40) T(41) T(42) T(43) T(44) T(45) T(46) T(47) \ - T(48) T(49) T(50) T(51) T(52) T(53) T(54) T(55) T(56) T(57) \ - T(58) T(59) T(60) T(61) T(62) T(63) T(64) T(65) T(66) \ - T(67) T(68) T(69) T(70) T(71) T(72) T(73) T(74) T(75) \ - T(76) T(77) T(78) T(79) T(80) T(81) T(82) T(83) \ - T(84) T(85) T(86) T(87) T(88) T(89) T(90) T( \ - 91) T(92) T(93) \ - T(94) T( \ - 95) T(96) T(97) \ - T(98) T( \ - 99) T(100) T(101) T(102) \ - T(103) T(104) T(105) T( \ - 106) T(107) T(108) T(109) T(110) \ - T(111) T(112) T(113) T( \ - 114) T(115) T(116) T(117) \ - T(118) T(119) T(120) T(121) T(122) T(123) T( \ - 124) T(125) T(126) T(127) T(128) \ - T(129) T(130) T(131) T( \ - 132) T(133) T(134) T(135) T(136) \ - T(137) T(138) T(139) T( \ - 140) T(141) T(142) T(143) T(144) \ - T(145) T(146) T(147) T( \ - 148) T(149) T(150) T(151) T(152) \ - T(153) T(154) T(155) T( \ - 156) T(157) T(158) T(159) \ - T(160) T(161) T(162) T( \ - 163) T(164) T(165) \ - T(166) T(167) T(168) T( \ - 169) T(170) T(171) \ - T(172) T(173) T( \ - 174) T(175) \ - T(176) T( \ - 177) T(178) \ - T(179) T( \ - 180) \ - T(181) T(182) T(183) T(184) T(185) T(186) T(187) T(188) T(189) T(190) T(191) T(192) T(193) T(194) T(195) T(196) T(197) T(198) T(199) T(200) T(201) T(202) T(203) T(204) T(205) T(206) T(207) T(208) T(209) T(210) T(211) T(212) T(213) T(214) T(215) T(216) T(217) T(218) T(219) T(220) T(221) T(222) T(223) T(224) T(225) T(226) T( \ - 227) T(228) \ - T(229) T( \ - 230) \ - T( \ - 231) T(232) T(233) T(234) T(235) T(236) T(237) T(238) T(239) T(240) T(241) T(242) T(243) T(244) T(245) T(246) T(247) T(248) T(249) T(250) T(251) T(252) \ - T(253) T( \ - 254) \ - T(255) +#define MAGIC_ENUM_FOR_EACH_256(T) \ + T(0) \ + T(1) \ + T(2) T(3) T(4) T(5) T(6) T(7) T(8) T(9) T(10) T(11) T(12) T(13) T(14) T( \ + 15) T(16) T(17) T(18) T(19) T(20) T(21) T(22) T(23) T(24) T(25) T(26) \ + T(27) T(28) T(29) T(30) T(31) T(32) T(33) T(34) T(35) T(36) T(37) \ + T(38) T(39) T(40) T(41) T(42) T(43) T(44) T(45) T(46) T(47) T(48) \ + T(49) T(50) T(51) T(52) T(53) T(54) T(55) T(56) T(57) T(58) \ + T(59) T(60) T(61) T(62) T(63) T(64) T(65) T(66) T(67) \ + T(68) T(69) T(70) T(71) T(72) T(73) T(74) T(75) T(76) \ + T(77) T(78) T(79) T(80) T(81) T(82) T(83) T(84) \ + T(85) T(86) T(87) T(88) T(89) T(90) T(91) T( \ + 92) T(93) T(94) \ + T(95) T( \ + 96) T(97) T(98) \ + T(99) T(100) T( \ + 101) T(102) T(103) T(104) T(105) \ + T(106) T(107) T(108) T( \ + 109) T(110) T(111) T(112) T(113) \ + T(114) T(115) T(116) T( \ + 117) T(118) T(119) T(120) \ + T(121) T(122) T(123) T(124) T(125) T( \ + 126) T(127) T(128) T(129) T(130) \ + T(131) T(132) T(133) T( \ + 134) T(135) T(136) T(137) T(138) \ + T(139) T(140) T(141) T( \ + 142) T(143) T(144) T(145) \ + T(146) T(147) T(148) T( \ + 149) T(150) T(151) \ + T(152) T(153) T(154) T( \ + 155) T(156) T(157) \ + T(158) T(159) T( \ + 160) T(161) \ + T(162) T( \ + 163) T(164) \ + T(165) T( \ + 166) \ + T(167) \ + T(168) \ + T(169) \ + T(170) \ + T( \ + 171) T(172) T(173) T(174) T(175) T(176) T(177) T(178) T(179) T(180) T(181) T(182) T(183) T(184) T(185) T(186) T(187) T(188) T(189) T(190) T(191) T(192) T(193) T(194) T(195) T(196) T(197) T(198) T(199) T(200) T(201) T(202) T(203) T(204) T(205) T(206) T(207) T(208) T(209) \ + T(210) T( \ + 211) T(212) \ + T(213) T( \ + 214) T(215) T(216) T(217) T(218) T(219) T(220) T(221) T(222) T(223) T(224) T(225) T(226) T(227) \ + T(228) T( \ + 229) T(230) T(231) T(232) T(233) T(234) T(235) T(236) T(237) T(238) T(239) T(240) T(241) T(242) T(243) T(244) T(245) T(246) T(247) \ + T(248) T(249) T( \ + 250) T(251) \ + T(252) T( \ + 253) \ + T(254) \ + T(255) template constexpr void @@ -1168,7 +1177,8 @@ values() noexcept } template > -constexpr enum_subtype subtype(std::true_type) noexcept +constexpr enum_subtype +subtype(std::true_type) noexcept { if constexpr (std::is_same_v) { // bool special case @@ -1205,7 +1215,8 @@ constexpr enum_subtype subtype(std::true_type) noexcept } template -constexpr enum_subtype subtype(std::false_type) noexcept +constexpr enum_subtype +subtype(std::false_type) noexcept { // For non-enum type return default common subtype. return enum_subtype::common; @@ -1224,17 +1235,16 @@ template inline constexpr auto count_v = values_v.size(); template > -inline constexpr auto min_v = (count_v > 0) - ? static_cast(values_v.front()) - : U{0}; +inline constexpr auto min_v = + (count_v > 0) ? static_cast(values_v.front()) : U{0}; template > -inline constexpr auto max_v = (count_v > 0) - ? static_cast(values_v.back()) - : U{0}; +inline constexpr auto max_v = + (count_v > 0) ? static_cast(values_v.back()) : U{0}; template -constexpr auto names(std::index_sequence) noexcept +constexpr auto +names(std::index_sequence) noexcept { constexpr auto names = std::array{ {enum_name_v[I]>...}}; @@ -1249,7 +1259,8 @@ template > using names_t = decltype((names_v)); template -constexpr auto entries(std::index_sequence) noexcept +constexpr auto +entries(std::index_sequence) noexcept { constexpr auto entries = std::array, sizeof...(I)>{ diff --git a/src/test/app/Import_test.cpp b/src/test/app/Import_test.cpp index fa42c1050..a77c3d6d3 100644 --- a/src/test/app/Import_test.cpp +++ b/src/test/app/Import_test.cpp @@ -5041,8 +5041,7 @@ class Import_test : public beast::unit_test::suite { for (std::uint32_t const withFeature : {0, 1, 2}) { - auto const amend = withFeature == 0 - ? features + auto const amend = withFeature == 0 ? features : withFeature == 1 ? features - featureXahauGenesis : features - featureDeletableAccounts; test::jtx::Env env{ @@ -5081,8 +5080,9 @@ class Import_test : public beast::unit_test::suite { BEAST_EXPECT((*acctSle)[sfAccountIndex] == 0); } - std::uint64_t const seq = - withFeature == 0 ? 12 : withFeature == 1 ? 6 : 12; + std::uint64_t const seq = withFeature == 0 ? 12 + : withFeature == 1 ? 6 + : 12; BEAST_EXPECT((*acctSle)[sfSequence] == seq); // confirm account count was set @@ -5098,8 +5098,7 @@ class Import_test : public beast::unit_test::suite { for (std::uint32_t const withFeature : {0, 1, 2}) { - auto const amend = withFeature == 0 - ? features + auto const amend = withFeature == 0 ? features : withFeature == 1 ? features - featureXahauGenesis : features - featureDeletableAccounts; test::jtx::Env env{ @@ -5119,8 +5118,9 @@ class Import_test : public beast::unit_test::suite std::uint64_t sequence; }; - std::uint64_t const seq = - withFeature == 0 ? 11 : withFeature == 1 ? 5 : 11; + std::uint64_t const seq = withFeature == 0 ? 11 + : withFeature == 1 ? 5 + : 11; std::array acctTests = {{ {alice, 0, seq}, {bob, 1, seq}, diff --git a/src/test/app/NFTokenBurn_test.cpp b/src/test/app/NFTokenBurn_test.cpp index ccdbb9633..e9e43b962 100644 --- a/src/test/app/NFTokenBurn_test.cpp +++ b/src/test/app/NFTokenBurn_test.cpp @@ -323,7 +323,8 @@ class NFTokenBurnBaseUtil_test : public beast::unit_test::suite // Otherwise either alice or minter can burn. AcctStat& burner = owner.acct == becky.acct ? *(stats[acctDist(engine)]) - : mintDist(engine) ? alice : minter; + : mintDist(engine) ? alice + : minter; if (owner.acct == burner.acct) env(token::burn(burner, nft)); diff --git a/src/test/app/Remit_test.cpp b/src/test/app/Remit_test.cpp index 1c5198026..1d6dfcb4e 100644 --- a/src/test/app/Remit_test.cpp +++ b/src/test/app/Remit_test.cpp @@ -465,7 +465,6 @@ struct Remit_test : public beast::unit_test::suite // tefBAD_LEDGER - invalid owner directory { - } // tecDIR_FULL - destination directory full diff --git a/src/test/app/SetRemarks_test.cpp b/src/test/app/SetRemarks_test.cpp index f9fa37191..cf2dda6c7 100644 --- a/src/test/app/SetRemarks_test.cpp +++ b/src/test/app/SetRemarks_test.cpp @@ -345,8 +345,9 @@ struct SetRemarks_test : public beast::unit_test::suite env.close(); } // tecCLAIM: SetRemarks: insane remarks accounting. - {} // tecTOO_MANY_REMARKS: SetRemarks: an object may have at most 32 - // remarks. + { + } // tecTOO_MANY_REMARKS: SetRemarks: an object may have at most 32 + // remarks. { std::vector _marks; unsigned int hexValue = 0xEFAC; diff --git a/src/test/app/ValidatorSite_test.cpp b/src/test/app/ValidatorSite_test.cpp index c2c663665..c29df9d8b 100644 --- a/src/test/app/ValidatorSite_test.cpp +++ b/src/test/app/ValidatorSite_test.cpp @@ -78,20 +78,21 @@ private: BEAST_EXPECT(trustedSites->load(emptyCfgSites)); // load should accept valid validator site uris - std::vector cfgSites({ - "http://ripple.com/", "http://ripple.com/validators", - "http://ripple.com:8080/validators", - "http://207.261.33.37/validators", - "http://207.261.33.37:8080/validators", - "https://ripple.com/validators", - "https://ripple.com:443/validators", - "file:///etc/opt/ripple/validators-xahau.txt", - "file:///C:/Lib/validators-xahau.txt" + std::vector cfgSites( + {"http://ripple.com/", + "http://ripple.com/validators", + "http://ripple.com:8080/validators", + "http://207.261.33.37/validators", + "http://207.261.33.37:8080/validators", + "https://ripple.com/validators", + "https://ripple.com:443/validators", + "file:///etc/opt/ripple/validators-xahau.txt", + "file:///C:/Lib/validators-xahau.txt" #if !_MSC_VER - , - "file:///" + , + "file:///" #endif - }); + }); BEAST_EXPECT(trustedSites->load(cfgSites)); // load should reject validator site uris with invalid schemes diff --git a/src/test/basics/IOUAmount_test.cpp b/src/test/basics/IOUAmount_test.cpp index 6e7c66263..e588a08dc 100644 --- a/src/test/basics/IOUAmount_test.cpp +++ b/src/test/basics/IOUAmount_test.cpp @@ -219,55 +219,56 @@ public: tinyNeg == mulRatio(tinyNeg, maxUInt - 1, maxUInt, false)); } - {// rounding - {IOUAmount one(1, 0); - auto const rup = mulRatio(one, maxUInt - 1, maxUInt, true); - auto const rdown = mulRatio(one, maxUInt - 1, maxUInt, false); - BEAST_EXPECT(rup.mantissa() - rdown.mantissa() == 1); - } + { // rounding + { + IOUAmount one(1, 0); + auto const rup = mulRatio(one, maxUInt - 1, maxUInt, true); + auto const rdown = mulRatio(one, maxUInt - 1, maxUInt, false); + BEAST_EXPECT(rup.mantissa() - rdown.mantissa() == 1); + } + { + IOUAmount big(maxMantissa, maxExponent); + auto const rup = mulRatio(big, maxUInt - 1, maxUInt, true); + auto const rdown = mulRatio(big, maxUInt - 1, maxUInt, false); + BEAST_EXPECT(rup.mantissa() - rdown.mantissa() == 1); + } + + { + IOUAmount negOne(-1, 0); + auto const rup = mulRatio(negOne, maxUInt - 1, maxUInt, true); + auto const rdown = + mulRatio(negOne, maxUInt - 1, maxUInt, false); + BEAST_EXPECT(rup.mantissa() - rdown.mantissa() == 1); + } + } + + { + // division by zero + IOUAmount one(1, 0); + except([&] { mulRatio(one, 1, 0, true); }); + } + + { + // overflow + IOUAmount big(maxMantissa, maxExponent); + except([&] { mulRatio(big, 2, 0, true); }); + } + } // namespace ripple + + //-------------------------------------------------------------------------- + + void + run() override { - IOUAmount big(maxMantissa, maxExponent); - auto const rup = mulRatio(big, maxUInt - 1, maxUInt, true); - auto const rdown = mulRatio(big, maxUInt - 1, maxUInt, false); - BEAST_EXPECT(rup.mantissa() - rdown.mantissa() == 1); + testZero(); + testSigNum(); + testBeastZero(); + testComparisons(); + testToString(); + testMulRatio(); } - - { - IOUAmount negOne(-1, 0); - auto const rup = mulRatio(negOne, maxUInt - 1, maxUInt, true); - auto const rdown = mulRatio(negOne, maxUInt - 1, maxUInt, false); - BEAST_EXPECT(rup.mantissa() - rdown.mantissa() == 1); - } -} - -{ - // division by zero - IOUAmount one(1, 0); - except([&] { mulRatio(one, 1, 0, true); }); -} - -{ - // overflow - IOUAmount big(maxMantissa, maxExponent); - except([&] { mulRatio(big, 2, 0, true); }); -} -} // namespace ripple - -//-------------------------------------------------------------------------- - -void -run() override -{ - testZero(); - testSigNum(); - testBeastZero(); - testComparisons(); - testToString(); - testMulRatio(); -} -} -; +}; BEAST_DEFINE_TESTSUITE(IOUAmount, protocol, ripple); -} // ripple +} // namespace ripple diff --git a/src/test/basics/XRPAmount_test.cpp b/src/test/basics/XRPAmount_test.cpp index c4c96dbfb..c57890fcf 100644 --- a/src/test/basics/XRPAmount_test.cpp +++ b/src/test/basics/XRPAmount_test.cpp @@ -283,63 +283,67 @@ public: tinyNeg == mulRatio(tinyNeg, maxUInt32 - 1, maxUInt32, false)); } - {// rounding - {XRPAmount one(1); - auto const rup = mulRatio(one, maxUInt32 - 1, maxUInt32, true); - auto const rdown = mulRatio(one, maxUInt32 - 1, maxUInt32, false); - BEAST_EXPECT(rup.drops() - rdown.drops() == 1); - } + { // rounding + { + XRPAmount one(1); + auto const rup = mulRatio(one, maxUInt32 - 1, maxUInt32, true); + auto const rdown = + mulRatio(one, maxUInt32 - 1, maxUInt32, false); + BEAST_EXPECT(rup.drops() - rdown.drops() == 1); + } + { + XRPAmount big(maxXRP); + auto const rup = mulRatio(big, maxUInt32 - 1, maxUInt32, true); + auto const rdown = + mulRatio(big, maxUInt32 - 1, maxUInt32, false); + BEAST_EXPECT(rup.drops() - rdown.drops() == 1); + } + + { + XRPAmount negOne(-1); + auto const rup = + mulRatio(negOne, maxUInt32 - 1, maxUInt32, true); + auto const rdown = + mulRatio(negOne, maxUInt32 - 1, maxUInt32, false); + BEAST_EXPECT(rup.drops() - rdown.drops() == 1); + } + } + + { + // division by zero + XRPAmount one(1); + except([&] { mulRatio(one, 1, 0, true); }); + } + + { + // overflow + XRPAmount big(maxXRP); + except([&] { mulRatio(big, 2, 1, true); }); + } + + { + // underflow + XRPAmount bigNegative(minXRP + 10); + BEAST_EXPECT(mulRatio(bigNegative, 2, 1, true) == minXRP); + } + } // namespace ripple + + //-------------------------------------------------------------------------- + + void + run() override { - XRPAmount big(maxXRP); - auto const rup = mulRatio(big, maxUInt32 - 1, maxUInt32, true); - auto const rdown = mulRatio(big, maxUInt32 - 1, maxUInt32, false); - BEAST_EXPECT(rup.drops() - rdown.drops() == 1); + testSigNum(); + testBeastZero(); + testComparisons(); + testAddSub(); + testDecimal(); + testFunctions(); + testMulRatio(); } - - { - XRPAmount negOne(-1); - auto const rup = mulRatio(negOne, maxUInt32 - 1, maxUInt32, true); - auto const rdown = mulRatio(negOne, maxUInt32 - 1, maxUInt32, false); - BEAST_EXPECT(rup.drops() - rdown.drops() == 1); - } -} - -{ - // division by zero - XRPAmount one(1); - except([&] { mulRatio(one, 1, 0, true); }); -} - -{ - // overflow - XRPAmount big(maxXRP); - except([&] { mulRatio(big, 2, 1, true); }); -} - -{ - // underflow - XRPAmount bigNegative(minXRP + 10); - BEAST_EXPECT(mulRatio(bigNegative, 2, 1, true) == minXRP); -} -} // namespace ripple - -//-------------------------------------------------------------------------- - -void -run() override -{ - testSigNum(); - testBeastZero(); - testComparisons(); - testAddSub(); - testDecimal(); - testFunctions(); - testMulRatio(); -} -} -; +}; BEAST_DEFINE_TESTSUITE(XRPAmount, protocol, ripple); -} // ripple +} // namespace ripple diff --git a/src/test/basics/base_uint_test.cpp b/src/test/basics/base_uint_test.cpp index 43000a112..9f3194f4f 100644 --- a/src/test/basics/base_uint_test.cpp +++ b/src/test/basics/base_uint_test.cpp @@ -48,7 +48,8 @@ struct nonhash memcpy(data_.data(), key, len); } - explicit operator std::size_t() noexcept + explicit + operator std::size_t() noexcept { return WIDTH; } diff --git a/src/test/beast/beast_Zero_test.cpp b/src/test/beast/beast_Zero_test.cpp index b60716362..8fd16a4d5 100644 --- a/src/test/beast/beast_Zero_test.cpp +++ b/src/test/beast/beast_Zero_test.cpp @@ -27,7 +27,8 @@ struct adl_tester { }; -int signum(adl_tester) +int +signum(adl_tester) { return 0; } @@ -38,7 +39,8 @@ struct adl_tester2 { }; -int signum(adl_tester2) +int +signum(adl_tester2) { return 0; } diff --git a/src/test/consensus/ByzantineFailureSim_test.cpp b/src/test/consensus/ByzantineFailureSim_test.cpp index ce59adbe9..92dbfc017 100644 --- a/src/test/consensus/ByzantineFailureSim_test.cpp +++ b/src/test/consensus/ByzantineFailureSim_test.cpp @@ -66,8 +66,8 @@ class ByzantineFailureSim_test : public beast::unit_test::suite for (TrustGraph::ForkInfo const& fi : sim.trustGraph.forkablePairs(0.8)) { - std::cout << "Can fork " << PeerGroup{fi.unlA} << " " - << " " << PeerGroup{fi.unlB} << " overlap " << fi.overlap + std::cout << "Can fork " << PeerGroup{fi.unlA} << " " << " " + << PeerGroup{fi.unlB} << " overlap " << fi.overlap << " required " << fi.required << "\n"; }; diff --git a/src/test/csf/Peer.h b/src/test/csf/Peer.h index 5eed78569..2f3b460e0 100644 --- a/src/test/csf/Peer.h +++ b/src/test/csf/Peer.h @@ -644,7 +644,8 @@ struct Peer } // Not interested in tracking consensus mode changes for now - void onModeChange(ConsensusMode, ConsensusMode) + void + onModeChange(ConsensusMode, ConsensusMode) { } diff --git a/src/test/csf/collectors.h b/src/test/csf/collectors.h index 511fb2c4b..8dcaa0353 100644 --- a/src/test/csf/collectors.h +++ b/src/test/csf/collectors.h @@ -281,66 +281,62 @@ struct TxCollector if (printBreakline) { - log << std::setw(11) << std::setfill('-') << "-" - << "-" << std::setw(7) << std::setfill('-') << "-" - << "-" << std::setw(7) << std::setfill('-') << "-" - << "-" << std::setw(36) << std::setfill('-') << "-" - << std::endl; + log << std::setw(11) << std::setfill('-') << "-" << "-" + << std::setw(7) << std::setfill('-') << "-" << "-" + << std::setw(7) << std::setfill('-') << "-" << "-" + << std::setw(36) << std::setfill('-') << "-" << std::endl; log << std::setfill(' '); } - log << std::left << std::setw(11) << "TxStats" - << "|" << std::setw(7) << "Count" - << "|" << std::setw(7) << "Per Sec" - << "|" << std::setw(15) << "Latency (sec)" << std::right - << std::setw(7) << "10-ile" << std::setw(7) << "50-ile" - << std::setw(7) << "90-ile" << std::left << std::endl; + log << std::left << std::setw(11) << "TxStats" << "|" << std::setw(7) + << "Count" << "|" << std::setw(7) << "Per Sec" << "|" + << std::setw(15) << "Latency (sec)" << std::right << std::setw(7) + << "10-ile" << std::setw(7) << "50-ile" << std::setw(7) << "90-ile" + << std::left << std::endl; - log << std::setw(11) << std::setfill('-') << "-" - << "|" << std::setw(7) << std::setfill('-') << "-" - << "|" << std::setw(7) << std::setfill('-') << "-" - << "|" << std::setw(36) << std::setfill('-') << "-" << std::endl; + log << std::setw(11) << std::setfill('-') << "-" << "|" << std::setw(7) + << std::setfill('-') << "-" << "|" << std::setw(7) + << std::setfill('-') << "-" << "|" << std::setw(36) + << std::setfill('-') << "-" << std::endl; log << std::setfill(' '); - log << std::left << std::setw(11) << "Submit " - << "|" << std::right << std::setw(7) << submitted << "|" - << std::setw(7) << std::setprecision(2) << perSec(submitted) << "|" - << std::setw(36) << "" << std::endl; + log << std::left << std::setw(11) << "Submit " << "|" << std::right + << std::setw(7) << submitted << "|" << std::setw(7) + << std::setprecision(2) << perSec(submitted) << "|" << std::setw(36) + << "" << std::endl; - log << std::left << std::setw(11) << "Accept " - << "|" << std::right << std::setw(7) << accepted << "|" - << std::setw(7) << std::setprecision(2) << perSec(accepted) << "|" - << std::setw(15) << std::left << "From Submit" << std::right + log << std::left << std::setw(11) << "Accept " << "|" << std::right + << std::setw(7) << accepted << "|" << std::setw(7) + << std::setprecision(2) << perSec(accepted) << "|" << std::setw(15) + << std::left << "From Submit" << std::right << std::setw(7) + << std::setprecision(2) << fmtS(submitToAccept.percentile(0.1f)) << std::setw(7) << std::setprecision(2) - << fmtS(submitToAccept.percentile(0.1f)) << std::setw(7) - << std::setprecision(2) << fmtS(submitToAccept.percentile(0.5f)) + << fmtS(submitToAccept.percentile(0.5f)) << std::setw(7) + << std::setprecision(2) << fmtS(submitToAccept.percentile(0.9f)) + << std::endl; + + log << std::left << std::setw(11) << "Validate " << "|" << std::right + << std::setw(7) << validated << "|" << std::setw(7) + << std::setprecision(2) << perSec(validated) << "|" << std::setw(15) + << std::left << "From Submit" << std::right << std::setw(7) + << std::setprecision(2) << fmtS(submitToValidate.percentile(0.1f)) << std::setw(7) << std::setprecision(2) - << fmtS(submitToAccept.percentile(0.9f)) << std::endl; + << fmtS(submitToValidate.percentile(0.5f)) << std::setw(7) + << std::setprecision(2) << fmtS(submitToValidate.percentile(0.9f)) + << std::endl; - log << std::left << std::setw(11) << "Validate " - << "|" << std::right << std::setw(7) << validated << "|" - << std::setw(7) << std::setprecision(2) << perSec(validated) << "|" - << std::setw(15) << std::left << "From Submit" << std::right - << std::setw(7) << std::setprecision(2) - << fmtS(submitToValidate.percentile(0.1f)) << std::setw(7) - << std::setprecision(2) << fmtS(submitToValidate.percentile(0.5f)) - << std::setw(7) << std::setprecision(2) - << fmtS(submitToValidate.percentile(0.9f)) << std::endl; + log << std::left << std::setw(11) << "Orphan" << "|" << std::right + << std::setw(7) << orphaned() << "|" << std::setw(7) << "" << "|" + << std::setw(36) << std::endl; - log << std::left << std::setw(11) << "Orphan" - << "|" << std::right << std::setw(7) << orphaned() << "|" - << std::setw(7) << "" - << "|" << std::setw(36) << std::endl; + log << std::left << std::setw(11) << "Unvalidated" << "|" << std::right + << std::setw(7) << unvalidated() << "|" << std::setw(7) << "" << "|" + << std::setw(43) << std::endl; - log << std::left << std::setw(11) << "Unvalidated" - << "|" << std::right << std::setw(7) << unvalidated() << "|" - << std::setw(7) << "" - << "|" << std::setw(43) << std::endl; - - log << std::setw(11) << std::setfill('-') << "-" - << "-" << std::setw(7) << std::setfill('-') << "-" - << "-" << std::setw(7) << std::setfill('-') << "-" - << "-" << std::setw(36) << std::setfill('-') << "-" << std::endl; + log << std::setw(11) << std::setfill('-') << "-" << "-" << std::setw(7) + << std::setfill('-') << "-" << "-" << std::setw(7) + << std::setfill('-') << "-" << "-" << std::setw(36) + << std::setfill('-') << "-" << std::endl; log << std::setfill(' '); } @@ -362,34 +358,15 @@ struct TxCollector if (printHeaders) { - log << "tag" - << "," - << "txNumSubmitted" - << "," - << "txNumAccepted" - << "," - << "txNumValidated" - << "," - << "txNumOrphaned" - << "," - << "txUnvalidated" - << "," - << "txRateSumbitted" - << "," - << "txRateAccepted" - << "," - << "txRateValidated" - << "," - << "txLatencySubmitToAccept10Pctl" - << "," - << "txLatencySubmitToAccept50Pctl" - << "," - << "txLatencySubmitToAccept90Pctl" - << "," - << "txLatencySubmitToValidatet10Pctl" - << "," - << "txLatencySubmitToValidatet50Pctl" - << "," + log << "tag" << "," << "txNumSubmitted" << "," << "txNumAccepted" + << "," << "txNumValidated" << "," << "txNumOrphaned" << "," + << "txUnvalidated" << "," << "txRateSumbitted" << "," + << "txRateAccepted" << "," << "txRateValidated" << "," + << "txLatencySubmitToAccept10Pctl" << "," + << "txLatencySubmitToAccept50Pctl" << "," + << "txLatencySubmitToAccept90Pctl" << "," + << "txLatencySubmitToValidatet10Pctl" << "," + << "txLatencySubmitToValidatet50Pctl" << "," << "txLatencySubmitToValidatet90Pctl" << std::endl; } @@ -548,52 +525,50 @@ struct LedgerCollector if (printBreakline) { - log << std::setw(11) << std::setfill('-') << "-" - << "-" << std::setw(7) << std::setfill('-') << "-" - << "-" << std::setw(7) << std::setfill('-') << "-" - << "-" << std::setw(36) << std::setfill('-') << "-" - << std::endl; + log << std::setw(11) << std::setfill('-') << "-" << "-" + << std::setw(7) << std::setfill('-') << "-" << "-" + << std::setw(7) << std::setfill('-') << "-" << "-" + << std::setw(36) << std::setfill('-') << "-" << std::endl; log << std::setfill(' '); } - log << std::left << std::setw(11) << "LedgerStats" - << "|" << std::setw(7) << "Count" - << "|" << std::setw(7) << "Per Sec" + log << std::left << std::setw(11) << "LedgerStats" << "|" + << std::setw(7) << "Count" << "|" << std::setw(7) << "Per Sec" << "|" << std::setw(15) << "Latency (sec)" << std::right << std::setw(7) << "10-ile" << std::setw(7) << "50-ile" << std::setw(7) << "90-ile" << std::left << std::endl; - log << std::setw(11) << std::setfill('-') << "-" - << "|" << std::setw(7) << std::setfill('-') << "-" - << "|" << std::setw(7) << std::setfill('-') << "-" - << "|" << std::setw(36) << std::setfill('-') << "-" << std::endl; + log << std::setw(11) << std::setfill('-') << "-" << "|" << std::setw(7) + << std::setfill('-') << "-" << "|" << std::setw(7) + << std::setfill('-') << "-" << "|" << std::setw(36) + << std::setfill('-') << "-" << std::endl; log << std::setfill(' '); - log << std::left << std::setw(11) << "Accept " - << "|" << std::right << std::setw(7) << accepted << "|" - << std::setw(7) << std::setprecision(2) << perSec(accepted) << "|" - << std::setw(15) << std::left << "From Accept" << std::right + log << std::left << std::setw(11) << "Accept " << "|" << std::right + << std::setw(7) << accepted << "|" << std::setw(7) + << std::setprecision(2) << perSec(accepted) << "|" << std::setw(15) + << std::left << "From Accept" << std::right << std::setw(7) + << std::setprecision(2) << fmtS(acceptToAccept.percentile(0.1f)) << std::setw(7) << std::setprecision(2) - << fmtS(acceptToAccept.percentile(0.1f)) << std::setw(7) - << std::setprecision(2) << fmtS(acceptToAccept.percentile(0.5f)) - << std::setw(7) << std::setprecision(2) - << fmtS(acceptToAccept.percentile(0.9f)) << std::endl; + << fmtS(acceptToAccept.percentile(0.5f)) << std::setw(7) + << std::setprecision(2) << fmtS(acceptToAccept.percentile(0.9f)) + << std::endl; - log << std::left << std::setw(11) << "Validate " - << "|" << std::right << std::setw(7) << fullyValidated << "|" - << std::setw(7) << std::setprecision(2) << perSec(fullyValidated) - << "|" << std::setw(15) << std::left << "From Validate " - << std::right << std::setw(7) << std::setprecision(2) + log << std::left << std::setw(11) << "Validate " << "|" << std::right + << std::setw(7) << fullyValidated << "|" << std::setw(7) + << std::setprecision(2) << perSec(fullyValidated) << "|" + << std::setw(15) << std::left << "From Validate " << std::right + << std::setw(7) << std::setprecision(2) << fmtS(fullyValidToFullyValid.percentile(0.1f)) << std::setw(7) << std::setprecision(2) << fmtS(fullyValidToFullyValid.percentile(0.5f)) << std::setw(7) << std::setprecision(2) << fmtS(fullyValidToFullyValid.percentile(0.9f)) << std::endl; - log << std::setw(11) << std::setfill('-') << "-" - << "-" << std::setw(7) << std::setfill('-') << "-" - << "-" << std::setw(7) << std::setfill('-') << "-" - << "-" << std::setw(36) << std::setfill('-') << "-" << std::endl; + log << std::setw(11) << std::setfill('-') << "-" << "-" << std::setw(7) + << std::setfill('-') << "-" << "-" << std::setw(7) + << std::setfill('-') << "-" << "-" << std::setw(36) + << std::setfill('-') << "-" << std::endl; log << std::setfill(' '); } @@ -615,26 +590,14 @@ struct LedgerCollector if (printHeaders) { - log << "tag" - << "," - << "ledgerNumAccepted" - << "," - << "ledgerNumFullyValidated" - << "," - << "ledgerRateAccepted" - << "," - << "ledgerRateFullyValidated" - << "," - << "ledgerLatencyAcceptToAccept10Pctl" - << "," - << "ledgerLatencyAcceptToAccept50Pctl" - << "," - << "ledgerLatencyAcceptToAccept90Pctl" - << "," - << "ledgerLatencyFullyValidToFullyValid10Pctl" - << "," - << "ledgerLatencyFullyValidToFullyValid50Pctl" - << "," + log << "tag" << "," << "ledgerNumAccepted" << "," + << "ledgerNumFullyValidated" << "," << "ledgerRateAccepted" + << "," << "ledgerRateFullyValidated" << "," + << "ledgerLatencyAcceptToAccept10Pctl" << "," + << "ledgerLatencyAcceptToAccept50Pctl" << "," + << "ledgerLatencyAcceptToAccept90Pctl" << "," + << "ledgerLatencyFullyValidToFullyValid10Pctl" << "," + << "ledgerLatencyFullyValidToFullyValid50Pctl" << "," << "ledgerLatencyFullyValidToFullyValid90Pctl" << std::endl; } @@ -695,16 +658,16 @@ struct StreamCollector on(PeerID who, SimTime when, AcceptLedger const& e) { out << when.time_since_epoch().count() << ": Node " << who - << " accepted " - << "L" << e.ledger.id() << " " << e.ledger.txs() << "\n"; + << " accepted " << "L" << e.ledger.id() << " " << e.ledger.txs() + << "\n"; } void on(PeerID who, SimTime when, FullyValidateLedger const& e) { out << when.time_since_epoch().count() << ": Node " << who - << " fully-validated " - << "L" << e.ledger.id() << " " << e.ledger.txs() << "\n"; + << " fully-validated " << "L" << e.ledger.id() << " " + << e.ledger.txs() << "\n"; } }; diff --git a/src/test/jtx/TestHelpers.h b/src/test/jtx/TestHelpers.h index 4dc58570d..708ad06b3 100644 --- a/src/test/jtx/TestHelpers.h +++ b/src/test/jtx/TestHelpers.h @@ -39,11 +39,11 @@ namespace jtx { // when we have moved to better compilers. template auto -make_vector(Input const& input) requires requires(Input& v) -{ - std::begin(v); - std::end(v); -} +make_vector(Input const& input) + requires requires(Input& v) { + std::begin(v); + std::end(v); + } { return std::vector(std::begin(input), std::end(input)); } diff --git a/src/test/jtx/TrustedPublisherServer.h b/src/test/jtx/TrustedPublisherServer.h index 2daa57f4f..d14526e9a 100644 --- a/src/test/jtx/TrustedPublisherServer.h +++ b/src/test/jtx/TrustedPublisherServer.h @@ -218,9 +218,8 @@ public: getList_ = [blob = blob, sig, manifest, version](int interval) { // Build the contents of a version 1 format UNL file std::stringstream l; - l << "{\"blob\":\"" << blob << "\"" - << ",\"signature\":\"" << sig << "\"" - << ",\"manifest\":\"" << manifest << "\"" + l << "{\"blob\":\"" << blob << "\"" << ",\"signature\":\"" << sig + << "\"" << ",\"manifest\":\"" << manifest << "\"" << ",\"refresh_interval\": " << interval << ",\"version\":" << version << '}'; return l.str(); @@ -255,15 +254,14 @@ public: std::stringstream l; for (auto const& info : blobInfo) { - l << "{\"blob\":\"" << info.blob << "\"" - << ",\"signature\":\"" << info.signature << "\"},"; + l << "{\"blob\":\"" << info.blob << "\"" << ",\"signature\":\"" + << info.signature << "\"},"; } std::string blobs = l.str(); blobs.pop_back(); l.str(std::string()); l << "{\"blobs_v2\": [ " << blobs << "],\"manifest\":\"" << manifest - << "\"" - << ",\"refresh_interval\": " << interval + << "\"" << ",\"refresh_interval\": " << interval << ",\"version\":" << (version + 1) << '}'; return l.str(); }; diff --git a/src/test/jtx/amount.h b/src/test/jtx/amount.h index c8e0d0c37..459ec5b5c 100644 --- a/src/test/jtx/amount.h +++ b/src/test/jtx/amount.h @@ -126,7 +126,7 @@ public: return amount_; } - operator STAmount const &() const + operator STAmount const&() const { return amount_; } @@ -211,7 +211,8 @@ struct XRP_t /** @} */ /** Returns None-of-XRP */ - None operator()(none_t) const + None + operator()(none_t) const { return {xrpIssue()}; } @@ -327,14 +328,17 @@ public: return {amountFromString(issue(), std::to_string(v)), account.name()}; } - PrettyAmount operator()(epsilon_t) const; - PrettyAmount operator()(detail::epsilon_multiple) const; + PrettyAmount + operator()(epsilon_t) const; + PrettyAmount + operator()(detail::epsilon_multiple) const; // VFALCO TODO // STAmount operator()(char const* s) const; /** Returns None-of-Issue */ - None operator()(none_t) const + None + operator()(none_t) const { return {issue()}; } diff --git a/src/test/jtx/impl/AMM.cpp b/src/test/jtx/impl/AMM.cpp index c083b6df3..8c369e685 100644 --- a/src/test/jtx/impl/AMM.cpp +++ b/src/test/jtx/impl/AMM.cpp @@ -42,8 +42,8 @@ static IOUAmount initialTokens(STAmount const& asset1, STAmount const& asset2) { auto const product = number(asset1) * number(asset2); - return (IOUAmount)( - product.mantissa() >= 0 ? root2(product) : root2(-product)); + return (IOUAmount)(product.mantissa() >= 0 ? root2(product) + : root2(-product)); } AMM::AMM( diff --git a/src/test/jtx/impl/amount.cpp b/src/test/jtx/impl/amount.cpp index 01fa53695..9f374c2cb 100644 --- a/src/test/jtx/impl/amount.cpp +++ b/src/test/jtx/impl/amount.cpp @@ -104,7 +104,8 @@ operator<<(std::ostream& os, PrettyAmount const& amount) XRP_t const XRP{}; -PrettyAmount IOU::operator()(epsilon_t) const +PrettyAmount +IOU::operator()(epsilon_t) const { return {STAmount(issue(), 1, -81), account.name()}; } diff --git a/src/test/jtx/multisign.h b/src/test/jtx/multisign.h index e1e93eac2..a96accd3a 100644 --- a/src/test/jtx/multisign.h +++ b/src/test/jtx/multisign.h @@ -102,9 +102,8 @@ public: msig(std::vector signers_); template - requires std::convertible_to explicit msig( - AccountType&& a0, - Accounts&&... aN) + requires std::convertible_to + explicit msig(AccountType&& a0, Accounts&&... aN) : msig{std::vector{ std::forward(a0), std::forward(aN)...}} diff --git a/src/test/overlay/reduce_relay_test.cpp b/src/test/overlay/reduce_relay_test.cpp index 4d9086dab..e0b0d006a 100644 --- a/src/test/overlay/reduce_relay_test.cpp +++ b/src/test/overlay/reduce_relay_test.cpp @@ -888,9 +888,8 @@ protected: printPeers(const std::string& msg, std::uint16_t validator = 0) { auto peers = network_.overlay().getPeers(network_.validator(validator)); - std::cout << msg << " " - << "num peers " << (int)network_.overlay().getNumPeers() - << std::endl; + std::cout << msg << " " << "num peers " + << (int)network_.overlay().getNumPeers() << std::endl; for (auto& [k, v] : peers) std::cout << k << ":" << (int)std::get(v) << " "; diff --git a/src/test/protocol/MultiApiJson_test.cpp b/src/test/protocol/MultiApiJson_test.cpp index 2c0b410f8..a5c37d257 100644 --- a/src/test/protocol/MultiApiJson_test.cpp +++ b/src/test/protocol/MultiApiJson_test.cpp @@ -105,8 +105,8 @@ struct MultiApiJson_test : beast::unit_test::suite BEAST_EXPECT(!s1.valid(0)); BEAST_EXPECT(!s1.valid(RPC::apiMaximumValidVersion + 1)); BEAST_EXPECT( - !s1.valid(std::numeric_limits::max())); + !s1.valid(std::numeric_limits< + decltype(RPC::apiMaximumValidVersion.value)>::max())); int result = 1; static_assert( @@ -165,32 +165,28 @@ struct MultiApiJson_test : beast::unit_test::suite // Several overloads we want to fail static_assert([](auto&& v) { - return !requires - { + return !requires { forAllApiVersions( std::forward(v).visit(), // [](Json::Value&, auto) {}); // missing const }; }(std::as_const(s1))); static_assert([](auto&& v) { - return !requires - { + return !requires { forAllApiVersions( std::forward(v).visit(), // [](Json::Value&) {}); // missing const }; }(std::as_const(s1))); static_assert([](auto&& v) { - return !requires - { + return !requires { forAllApiVersions( std::forward(v).visit(), // []() {}); // missing parameters }; }(std::as_const(s1))); static_assert([](auto&& v) { - return !requires - { + return !requires { forAllApiVersions( std::forward(v).visit(), // [](auto) {}, @@ -198,8 +194,7 @@ struct MultiApiJson_test : beast::unit_test::suite }; }(std::as_const(s1))); static_assert([](auto&& v) { - return !requires - { + return !requires { forAllApiVersions( std::forward(v).visit(), // [](auto, auto) {}, @@ -207,8 +202,7 @@ struct MultiApiJson_test : beast::unit_test::suite }; }(std::as_const(s1))); static_assert([](auto&& v) { - return !requires - { + return !requires { forAllApiVersions( std::forward(v).visit(), // [](auto, auto, const char*) {}, @@ -218,40 +212,35 @@ struct MultiApiJson_test : beast::unit_test::suite // Sanity checks static_assert([](auto&& v) { - return requires - { + return requires { forAllApiVersions( std::forward(v).visit(), // [](auto) {}); }; }(s1)); static_assert([](auto&& v) { - return requires - { + return requires { forAllApiVersions( std::forward(v).visit(), // [](Json::Value const&) {}); }; }(std::as_const(s1))); static_assert([](auto&& v) { - return requires - { + return requires { forAllApiVersions( std::forward(v).visit(), // [](auto...) {}); }; }(s1)); static_assert([](auto&& v) { - return requires - { + return requires { forAllApiVersions( std::forward(v).visit(), // [](Json::Value const&, auto...) {}); }; }(std::as_const(s1))); static_assert([](auto&& v) { - return requires - { + return requires { forAllApiVersions( std::forward(v).visit(), // [](Json::Value&, auto, auto, auto...) {}, @@ -260,8 +249,7 @@ struct MultiApiJson_test : beast::unit_test::suite }; }(s1)); static_assert([](auto&& v) { - return requires - { + return requires { forAllApiVersions( std::forward(v).visit(), // []( @@ -274,16 +262,14 @@ struct MultiApiJson_test : beast::unit_test::suite }; }(std::as_const(s1))); static_assert([](auto&& v) { - return requires - { + return requires { forAllApiVersions( std::forward(v).visit(), // [](auto...) {}); }; }(std::move(s1))); static_assert([](auto&& v) { - return requires - { + return requires { forAllApiVersions( std::forward(v).visit(), // [](auto...) {}); @@ -342,45 +328,25 @@ struct MultiApiJson_test : beast::unit_test::suite // Tests of requires clause - these are expected to match static_assert([](auto&& v) { - return requires - { - v.set("name", Json::nullValue); - }; + return requires { v.set("name", Json::nullValue); }; }(x)); static_assert([](auto&& v) { - return requires - { - v.set("name", "value"); - }; - }(x)); - static_assert([](auto&& v) { - return requires - { - v.set("name", true); - }; - }(x)); - static_assert([](auto&& v) { - return requires - { - v.set("name", 42); - }; + return requires { v.set("name", "value"); }; }(x)); + static_assert( + [](auto&& v) { return requires { v.set("name", true); }; }(x)); + static_assert( + [](auto&& v) { return requires { v.set("name", 42); }; }(x)); // Tests of requires clause - these are expected NOT to match struct foo_t final { }; static_assert([](auto&& v) { - return !requires - { - v.set("name", foo_t{}); - }; + return !requires { v.set("name", foo_t{}); }; }(x)); static_assert([](auto&& v) { - return !requires - { - v.set("name", std::nullopt); - }; + return !requires { v.set("name", std::nullopt); }; }(x)); } @@ -436,8 +402,7 @@ struct MultiApiJson_test : beast::unit_test::suite // Test different overloads static_assert([](auto&& v) { - return requires - { + return requires { v.visitor( v, std::integral_constant{}, @@ -458,8 +423,7 @@ struct MultiApiJson_test : beast::unit_test::suite [](auto, auto) { return 0; }}) == 2); static_assert([](auto&& v) { - return requires - { + return requires { v.visitor( v, std::integral_constant{}, @@ -476,8 +440,7 @@ struct MultiApiJson_test : beast::unit_test::suite [](auto...) { return 0; }}) == 2); static_assert([](auto&& v) { - return requires - { + return requires { v.visitor( v, std::integral_constant{}, @@ -498,8 +461,7 @@ struct MultiApiJson_test : beast::unit_test::suite [](auto, auto) { return 0; }}) == 3); static_assert([](auto&& v) { - return requires - { + return requires { v.visitor( v, std::integral_constant{}, @@ -516,8 +478,7 @@ struct MultiApiJson_test : beast::unit_test::suite [](auto...) { return 0; }}) == 3); static_assert([](auto&& v) { - return requires - { + return requires { v.visitor(v, 1, [](Json::Value&, unsigned) {}); }; }(s1)); @@ -533,10 +494,7 @@ struct MultiApiJson_test : beast::unit_test::suite [](auto, auto) { return 0; }}) == 5); static_assert([](auto&& v) { - return requires - { - v.visitor(v, 1, [](Json::Value&) {}); - }; + return requires { v.visitor(v, 1, [](Json::Value&) {}); }; }(s1)); BEAST_EXPECT( s1.visitor( @@ -548,8 +506,7 @@ struct MultiApiJson_test : beast::unit_test::suite [](auto...) { return 0; }}) == 5); static_assert([](auto&& v) { - return requires - { + return requires { v.visitor(v, 1, [](Json::Value const&, unsigned) {}); }; }(std::as_const(s1))); @@ -565,10 +522,7 @@ struct MultiApiJson_test : beast::unit_test::suite [](auto, auto) { return 0; }}) == 3); static_assert([](auto&& v) { - return requires - { - v.visitor(v, 1, [](Json::Value const&) {}); - }; + return requires { v.visitor(v, 1, [](Json::Value const&) {}); }; }(std::as_const(s1))); BEAST_EXPECT( s1.visitor( @@ -671,8 +625,7 @@ struct MultiApiJson_test : beast::unit_test::suite // Several overloads we want to fail static_assert([](auto&& v) { - return !requires - { + return !requires { v.visitor( v, 1, // @@ -681,8 +634,7 @@ struct MultiApiJson_test : beast::unit_test::suite }(std::as_const(s1))); static_assert([](auto&& v) { - return !requires - { + return !requires { v.visitor( std::move(v), // cannot bind rvalue 1, @@ -691,8 +643,7 @@ struct MultiApiJson_test : beast::unit_test::suite }(s1)); static_assert([](auto&& v) { - return !requires - { + return !requires { v.visitor( v, 1, // @@ -701,8 +652,7 @@ struct MultiApiJson_test : beast::unit_test::suite }(s1)); static_assert([](auto&& v) { - return !requires - { + return !requires { v.visitor( v, 1, // @@ -712,74 +662,52 @@ struct MultiApiJson_test : beast::unit_test::suite // Want these to be unambiguous static_assert([](auto&& v) { - return requires - { - v.visitor(v, 1, [](auto) {}); - }; + return requires { v.visitor(v, 1, [](auto) {}); }; }(s1)); static_assert([](auto&& v) { - return requires - { - v.visitor(v, 1, [](Json::Value&) {}); - }; + return requires { v.visitor(v, 1, [](Json::Value&) {}); }; }(s1)); static_assert([](auto&& v) { - return requires - { + return requires { v.visitor(v, 1, [](Json::Value&, auto...) {}); }; }(s1)); static_assert([](auto&& v) { - return requires - { - v.visitor(v, 1, [](Json::Value const&) {}); - }; + return requires { v.visitor(v, 1, [](Json::Value const&) {}); }; }(s1)); static_assert([](auto&& v) { - return requires - { + return requires { v.visitor(v, 1, [](Json::Value const&, auto...) {}); }; }(s1)); static_assert([](auto&& v) { - return requires - { - v.visitor(v, 1, [](auto...) {}); - }; + return requires { v.visitor(v, 1, [](auto...) {}); }; }(s1)); static_assert([](auto&& v) { - return requires - { - v.visitor(v, 1, [](auto, auto...) {}); - }; + return requires { v.visitor(v, 1, [](auto, auto...) {}); }; }(s1)); static_assert([](auto&& v) { - return requires - { + return requires { v.visitor(v, 1, [](auto, auto, auto...) {}); }; }(s1)); static_assert([](auto&& v) { - return requires - { - v.visitor( - v, 1, [](auto, auto, auto...) {}, ""); + return requires { + v.visitor(v, 1, [](auto, auto, auto...) {}, ""); }; }(s1)); static_assert([](auto&& v) { - return requires - { - v.visitor( - v, 1, [](auto, auto, auto, auto...) {}, ""); + return requires { + v.visitor(v, 1, [](auto, auto, auto, auto...) {}, ""); }; }(s1)); } @@ -794,8 +722,7 @@ struct MultiApiJson_test : beast::unit_test::suite // Test different overloads static_assert([](auto&& v) { - return requires - { + return requires { v.visit( std::integral_constant{}, [](Json::Value&, std::integral_constant) { @@ -813,8 +740,7 @@ struct MultiApiJson_test : beast::unit_test::suite [](Json::Value const&, auto) { return 0; }, [](auto, auto) { return 0; }}) == 2); static_assert([](auto&& v) { - return requires - { + return requires { v.visit()( std::integral_constant{}, [](Json::Value&, std::integral_constant) { @@ -833,8 +759,7 @@ struct MultiApiJson_test : beast::unit_test::suite [](auto, auto) { return 0; }}) == 2); static_assert([](auto&& v) { - return requires - { + return requires { v.visit( std::integral_constant{}, [](Json::Value&) {}); @@ -848,8 +773,7 @@ struct MultiApiJson_test : beast::unit_test::suite [](Json::Value const&) { return 0; }, [](auto...) { return 0; }}) == 2); static_assert([](auto&& v) { - return requires - { + return requires { v.visit()( std::integral_constant{}, [](Json::Value&) {}); @@ -864,8 +788,7 @@ struct MultiApiJson_test : beast::unit_test::suite [](auto...) { return 0; }}) == 2); static_assert([](auto&& v) { - return requires - { + return requires { v.visit( std::integral_constant{}, [](Json::Value const&, @@ -883,8 +806,7 @@ struct MultiApiJson_test : beast::unit_test::suite [](Json::Value&, auto) { return 0; }, [](auto, auto) { return 0; }}) == 3); static_assert([](auto&& v) { - return requires - { + return requires { v.visit()( std::integral_constant{}, [](Json::Value const&, @@ -903,8 +825,7 @@ struct MultiApiJson_test : beast::unit_test::suite [](auto, auto) { return 0; }}) == 3); static_assert([](auto&& v) { - return requires - { + return requires { v.visit( std::integral_constant{}, [](Json::Value const&) {}); @@ -918,8 +839,7 @@ struct MultiApiJson_test : beast::unit_test::suite [](Json::Value&) { return 0; }, [](auto...) { return 0; }}) == 3); static_assert([](auto&& v) { - return requires - { + return requires { v.visit()( std::integral_constant{}, [](Json::Value const&) {}); @@ -934,10 +854,7 @@ struct MultiApiJson_test : beast::unit_test::suite [](auto...) { return 0; }}) == 3); static_assert([](auto&& v) { - return requires - { - v.visit(1, [](Json::Value&, unsigned) {}); - }; + return requires { v.visit(1, [](Json::Value&, unsigned) {}); }; }(s1)); BEAST_EXPECT( s1.visit( @@ -950,8 +867,7 @@ struct MultiApiJson_test : beast::unit_test::suite [](Json::Value&, auto) { return 0; }, [](auto, auto) { return 0; }}) == 5); static_assert([](auto&& v) { - return requires - { + return requires { v.visit()(1, [](Json::Value&, unsigned) {}); }; }(s1)); @@ -967,10 +883,7 @@ struct MultiApiJson_test : beast::unit_test::suite [](auto, auto) { return 0; }}) == 5); static_assert([](auto&& v) { - return requires - { - v.visit(1, [](Json::Value&) {}); - }; + return requires { v.visit(1, [](Json::Value&) {}); }; }(s1)); BEAST_EXPECT( s1.visit( @@ -980,10 +893,7 @@ struct MultiApiJson_test : beast::unit_test::suite [](Json::Value const&) { return 0; }, [](auto...) { return 0; }}) == 5); static_assert([](auto&& v) { - return requires - { - v.visit()(1, [](Json::Value&) {}); - }; + return requires { v.visit()(1, [](Json::Value&) {}); }; }(s1)); BEAST_EXPECT( s1.visit()( @@ -994,8 +904,7 @@ struct MultiApiJson_test : beast::unit_test::suite [](auto...) { return 0; }}) == 5); static_assert([](auto&& v) { - return requires - { + return requires { v.visit(1, [](Json::Value const&, unsigned) {}); }; }(std::as_const(s1))); @@ -1010,8 +919,7 @@ struct MultiApiJson_test : beast::unit_test::suite [](Json::Value&, unsigned) { return 0; }, [](auto, auto) { return 0; }}) == 3); static_assert([](auto&& v) { - return requires - { + return requires { v.visit()(1, [](Json::Value const&, unsigned) {}); }; }(std::as_const(s1))); @@ -1027,10 +935,7 @@ struct MultiApiJson_test : beast::unit_test::suite [](auto, auto) { return 0; }}) == 3); static_assert([](auto&& v) { - return requires - { - v.visit(1, [](Json::Value const&) {}); - }; + return requires { v.visit(1, [](Json::Value const&) {}); }; }(std::as_const(s1))); BEAST_EXPECT( std::as_const(s1).visit( @@ -1040,10 +945,7 @@ struct MultiApiJson_test : beast::unit_test::suite [](Json::Value&) { return 0; }, [](auto...) { return 0; }}) == 3); static_assert([](auto&& v) { - return requires - { - v.visit()(1, [](Json::Value const&) {}); - }; + return requires { v.visit()(1, [](Json::Value const&) {}); }; }(std::as_const(s1))); BEAST_EXPECT( std::as_const(s1).visit()( @@ -1055,83 +957,71 @@ struct MultiApiJson_test : beast::unit_test::suite // Rvalue MultivarJson visitor only binds to regular reference static_assert([](auto&& v) { - return !requires - { + return !requires { std::forward(v).visit(1, [](Json::Value&&) {}); }; }(std::move(s1))); static_assert([](auto&& v) { - return !requires - { + return !requires { std::forward(v).visit( 1, [](Json::Value const&&) {}); }; }(std::move(s1))); static_assert([](auto&& v) { - return requires - { + return requires { std::forward(v).visit(1, [](Json::Value&) {}); }; }(std::move(s1))); static_assert([](auto&& v) { - return requires - { + return requires { std::forward(v).visit( 1, [](Json::Value const&) {}); }; }(std::move(s1))); static_assert([](auto&& v) { - return !requires - { + return !requires { std::forward(v).visit()( 1, [](Json::Value&&) {}); }; }(std::move(s1))); static_assert([](auto&& v) { - return !requires - { + return !requires { std::forward(v).visit()( 1, [](Json::Value const&&) {}); }; }(std::move(s1))); static_assert([](auto&& v) { - return requires - { + return requires { std::forward(v).visit()( 1, [](Json::Value&) {}); }; }(std::move(s1))); static_assert([](auto&& v) { - return requires - { + return requires { std::forward(v).visit()( 1, [](Json::Value const&) {}); }; }(std::move(s1))); static_assert([](auto&& v) { - return !requires - { + return !requires { std::forward(v).visit( 1, [](Json::Value const&&) {}); }; }(std::move(std::as_const(s1)))); static_assert([](auto&& v) { - return requires - { + return requires { std::forward(v).visit( 1, [](Json::Value const&) {}); }; }(std::move(std::as_const(s1)))); static_assert([](auto&& v) { - return !requires - { + return !requires { std::forward(v).visit()( 1, [](Json::Value const&&) {}); }; }(std::move(std::as_const(s1)))); static_assert([](auto&& v) { - return requires - { + return requires { std::forward(v).visit()( 1, [](Json::Value const&) {}); }; @@ -1139,15 +1029,13 @@ struct MultiApiJson_test : beast::unit_test::suite // Missing const static_assert([](auto&& v) { - return !requires - { + return !requires { std::forward(v).visit( 1, [](Json::Value&, auto) {}); }; }(std::as_const(s1))); static_assert([](auto&& v) { - return !requires - { + return !requires { std::forward(v).visit()( 1, [](Json::Value&, auto) {}); }; @@ -1155,28 +1043,24 @@ struct MultiApiJson_test : beast::unit_test::suite // Missing parameter static_assert([](auto&& v) { - return !requires - { + return !requires { std::forward(v).visit(1, []() {}); }; }(s1)); static_assert([](auto&& v) { - return !requires - { + return !requires { std::forward(v).visit()(1, []() {}); }; }(s1)); // Sanity checks static_assert([](auto&& v) { - return requires - { + return requires { std::forward(v).visit(1, [](auto...) {}); }; }(std::as_const(s1))); static_assert([](auto&& v) { - return requires - { + return requires { std::forward(v).visit()(1, [](auto...) {}); }; }(std::as_const(s1))); diff --git a/src/test/protocol/STObject_test.cpp b/src/test/protocol/STObject_test.cpp index 39a5b9c2f..41c3800bc 100644 --- a/src/test/protocol/STObject_test.cpp +++ b/src/test/protocol/STObject_test.cpp @@ -243,9 +243,8 @@ public: unexpected(sfGeneric.isUseful(), "sfGeneric must not be useful"); { // Try to put sfGeneric in an SOTemplate. - except([&]() { - SOTemplate elements{{sfGeneric, soeREQUIRED}}; - }); + except( + [&]() { SOTemplate elements{{sfGeneric, soeREQUIRED}}; }); } unexpected(sfInvalid.isUseful(), "sfInvalid must not be useful"); @@ -263,9 +262,8 @@ public: } { // Try to put sfInvalid in an SOTemplate. - except([&]() { - SOTemplate elements{{sfInvalid, soeREQUIRED}}; - }); + except( + [&]() { SOTemplate elements{{sfInvalid, soeREQUIRED}}; }); } { // Try to put the same SField into an SOTemplate twice. @@ -570,150 +568,152 @@ public: // STBlob and slice - {{STObject st(sfGeneric); - Buffer b(1); - BEAST_EXPECT(!b.empty()); - st[sf4] = std::move(b); - BEAST_EXPECT(b.empty()); - BEAST_EXPECT(Slice(st[sf4]).size() == 1); - st[~sf4] = std::nullopt; - BEAST_EXPECT(!~st[~sf4]); - b = Buffer{2}; - st[sf4] = Slice(b); - BEAST_EXPECT(b.size() == 2); - BEAST_EXPECT(Slice(st[sf4]).size() == 2); - st[sf5] = st[sf4]; - BEAST_EXPECT(Slice(st[sf4]).size() == 2); - BEAST_EXPECT(Slice(st[sf5]).size() == 2); - } + { + { + STObject st(sfGeneric); + Buffer b(1); + BEAST_EXPECT(!b.empty()); + st[sf4] = std::move(b); + BEAST_EXPECT(b.empty()); + BEAST_EXPECT(Slice(st[sf4]).size() == 1); + st[~sf4] = std::nullopt; + BEAST_EXPECT(!~st[~sf4]); + b = Buffer{2}; + st[sf4] = Slice(b); + BEAST_EXPECT(b.size() == 2); + BEAST_EXPECT(Slice(st[sf4]).size() == 2); + st[sf5] = st[sf4]; + BEAST_EXPECT(Slice(st[sf4]).size() == 2); + BEAST_EXPECT(Slice(st[sf5]).size() == 2); + } + { + STObject st(sotOuter, sfGeneric); + BEAST_EXPECT(st[sf5] == Slice{}); + BEAST_EXPECT(!!st[~sf5]); + BEAST_EXPECT(!!~st[~sf5]); + Buffer b(1); + st[sf5] = std::move(b); + BEAST_EXPECT(b.empty()); + BEAST_EXPECT(Slice(st[sf5]).size() == 1); + st[~sf4] = std::nullopt; + BEAST_EXPECT(!~st[~sf4]); + } + } + + // UDT blobs + + { + STObject st(sfGeneric); + BEAST_EXPECT(!st[~sf5]); + auto const kp = generateKeyPair( + KeyType::secp256k1, generateSeed("masterpassphrase")); + st[sf5] = kp.first; + st[~sf5] = std::nullopt; + } + + // By reference fields + + { + auto const& sf = sfIndexes; + STObject st(sfGeneric); + std::vector v; + v.emplace_back(1); + v.emplace_back(2); + st[sf] = v; + st[sf] = std::move(v); + auto const& cst = st; + BEAST_EXPECT(cst[sf].size() == 2); + BEAST_EXPECT(cst[~sf]->size() == 2); + BEAST_EXPECT(cst[sf][0] == 1); + BEAST_EXPECT(cst[sf][1] == 2); + static_assert( + std::is_same< + decltype(cst[sfIndexes]), + std::vector const&>::value, + ""); + } + + // Default by reference field + + { + auto const& sf1 = sfIndexes; + auto const& sf2 = sfHashes; + auto const& sf3 = sfAmendments; + SOTemplate const sot{ + {sf1, soeREQUIRED}, + {sf2, soeOPTIONAL}, + {sf3, soeDEFAULT}, + }; + + STObject st(sot, sfGeneric); + auto const& cst(st); + BEAST_EXPECT(cst[sf1].size() == 0); + BEAST_EXPECT(!cst[~sf2]); + BEAST_EXPECT(cst[sf3].size() == 0); + std::vector v; + v.emplace_back(1); + st[sf1] = v; + BEAST_EXPECT(cst[sf1].size() == 1); + BEAST_EXPECT(cst[sf1][0] == uint256{1}); + st[sf2] = v; + BEAST_EXPECT(cst[sf2].size() == 1); + BEAST_EXPECT(cst[sf2][0] == uint256{1}); + st[~sf2] = std::nullopt; + BEAST_EXPECT(!st[~sf2]); + st[sf3] = v; + BEAST_EXPECT(cst[sf3].size() == 1); + BEAST_EXPECT(cst[sf3][0] == uint256{1}); + st[sf3] = std::vector{}; + BEAST_EXPECT(cst[sf3].size() == 0); + } + } // namespace ripple + + void + testMalformed() { - STObject st(sotOuter, sfGeneric); - BEAST_EXPECT(st[sf5] == Slice{}); - BEAST_EXPECT(!!st[~sf5]); - BEAST_EXPECT(!!~st[~sf5]); - Buffer b(1); - st[sf5] = std::move(b); - BEAST_EXPECT(b.empty()); - BEAST_EXPECT(Slice(st[sf5]).size() == 1); - st[~sf4] = std::nullopt; - BEAST_EXPECT(!~st[~sf4]); + testcase("Malformed serialized forms"); + + try + { + std::array const payload{ + {0xe9, 0x12, 0xab, 0xcd, 0x12, 0xfe, 0xdc}}; + SerialIter sit{makeSlice(payload)}; + auto obj = std::make_shared(sit, sfMetadata); + BEAST_EXPECT(!obj); + } + catch (std::exception const& e) + { + BEAST_EXPECT(strcmp(e.what(), "Duplicate field detected") == 0); + } + + try + { + std::array const payload{{0xe2, 0xe1, 0xe2}}; + SerialIter sit{makeSlice(payload)}; + auto obj = std::make_shared(sit, sfMetadata); + BEAST_EXPECT(!obj); + } + catch (std::exception const& e) + { + BEAST_EXPECT(strcmp(e.what(), "Duplicate field detected") == 0); + } } -} -// UDT blobs - -{ - STObject st(sfGeneric); - BEAST_EXPECT(!st[~sf5]); - auto const kp = - generateKeyPair(KeyType::secp256k1, generateSeed("masterpassphrase")); - st[sf5] = kp.first; - st[~sf5] = std::nullopt; -} - -// By reference fields - -{ - auto const& sf = sfIndexes; - STObject st(sfGeneric); - std::vector v; - v.emplace_back(1); - v.emplace_back(2); - st[sf] = v; - st[sf] = std::move(v); - auto const& cst = st; - BEAST_EXPECT(cst[sf].size() == 2); - BEAST_EXPECT(cst[~sf]->size() == 2); - BEAST_EXPECT(cst[sf][0] == 1); - BEAST_EXPECT(cst[sf][1] == 2); - static_assert( - std::is_same const&>:: - value, - ""); -} - -// Default by reference field - -{ - auto const& sf1 = sfIndexes; - auto const& sf2 = sfHashes; - auto const& sf3 = sfAmendments; - SOTemplate const sot{ - {sf1, soeREQUIRED}, - {sf2, soeOPTIONAL}, - {sf3, soeDEFAULT}, - }; - - STObject st(sot, sfGeneric); - auto const& cst(st); - BEAST_EXPECT(cst[sf1].size() == 0); - BEAST_EXPECT(!cst[~sf2]); - BEAST_EXPECT(cst[sf3].size() == 0); - std::vector v; - v.emplace_back(1); - st[sf1] = v; - BEAST_EXPECT(cst[sf1].size() == 1); - BEAST_EXPECT(cst[sf1][0] == uint256{1}); - st[sf2] = v; - BEAST_EXPECT(cst[sf2].size() == 1); - BEAST_EXPECT(cst[sf2][0] == uint256{1}); - st[~sf2] = std::nullopt; - BEAST_EXPECT(!st[~sf2]); - st[sf3] = v; - BEAST_EXPECT(cst[sf3].size() == 1); - BEAST_EXPECT(cst[sf3][0] == uint256{1}); - st[sf3] = std::vector{}; - BEAST_EXPECT(cst[sf3].size() == 0); -} -} // namespace ripple - -void -testMalformed() -{ - testcase("Malformed serialized forms"); - - try + void + run() override { - std::array const payload{ - {0xe9, 0x12, 0xab, 0xcd, 0x12, 0xfe, 0xdc}}; - SerialIter sit{makeSlice(payload)}; - auto obj = std::make_shared(sit, sfMetadata); - BEAST_EXPECT(!obj); - } - catch (std::exception const& e) - { - BEAST_EXPECT(strcmp(e.what(), "Duplicate field detected") == 0); - } + // Instantiate a jtx::Env so debugLog writes are exercised. + test::jtx::Env env(*this); - try - { - std::array const payload{{0xe2, 0xe1, 0xe2}}; - SerialIter sit{makeSlice(payload)}; - auto obj = std::make_shared(sit, sfMetadata); - BEAST_EXPECT(!obj); + testFields(); + testSerialization(); + testParseJSONArray(); + testParseJSONArrayWithInvalidChildrenObjects(); + testParseJSONEdgeCases(); + testMalformed(); } - catch (std::exception const& e) - { - BEAST_EXPECT(strcmp(e.what(), "Duplicate field detected") == 0); - } -} - -void -run() override -{ - // Instantiate a jtx::Env so debugLog writes are exercised. - test::jtx::Env env(*this); - - testFields(); - testSerialization(); - testParseJSONArray(); - testParseJSONArrayWithInvalidChildrenObjects(); - testParseJSONEdgeCases(); - testMalformed(); -} -} -; +}; BEAST_DEFINE_TESTSUITE(STObject, protocol, ripple); -} // ripple +} // namespace ripple diff --git a/src/xrpld/app/hook/detail/applyHook.cpp b/src/xrpld/app/hook/detail/applyHook.cpp index 04c1e4823..e82de2fb8 100644 --- a/src/xrpld/app/hook/detail/applyHook.cpp +++ b/src/xrpld/app/hook/detail/applyHook.cpp @@ -1046,8 +1046,8 @@ hook::getHookCanEmit( (hookObj.isFieldPresent(sfHookCanEmit) ? hookObj.getFieldH256(sfHookCanEmit) : hookDef->isFieldPresent(sfHookCanEmit) - ? hookDef->getFieldH256(sfHookCanEmit) - : defaultHookCanEmit); + ? hookDef->getFieldH256(sfHookCanEmit) + : defaultHookCanEmit); return hookCanEmit; } @@ -2933,10 +2933,10 @@ DEFINE_HOOK_FUNCTION( ripple::Keylet kl = keylet_type == keylet_code::CHILD ? ripple::keylet::child(id) : keylet_type == keylet_code::EMITTED_TXN - ? ripple::keylet::emittedTxn(id) - : keylet_type == keylet_code::HOOK_DEFINITION - ? ripple::keylet::hookDefinition(id) - : ripple::keylet::unchecked(id); + ? ripple::keylet::emittedTxn(id) + : keylet_type == keylet_code::HOOK_DEFINITION + ? ripple::keylet::hookDefinition(id) + : ripple::keylet::unchecked(id); return serialize_keylet(kl, memory, write_ptr, write_len); } @@ -2965,10 +2965,10 @@ DEFINE_HOOK_FUNCTION( ripple::Keylet kl = keylet_type == keylet_code::HOOK ? ripple::keylet::hook(id) : keylet_type == keylet_code::SIGNERS - ? ripple::keylet::signers(id) - : keylet_type == keylet_code::OWNER_DIR - ? ripple::keylet::ownerDir(id) - : ripple::keylet::account(id); + ? ripple::keylet::signers(id) + : keylet_type == keylet_code::OWNER_DIR + ? ripple::keylet::ownerDir(id) + : ripple::keylet::account(id); return serialize_keylet(kl, memory, write_ptr, write_len); } @@ -3008,10 +3008,10 @@ DEFINE_HOOK_FUNCTION( ripple::Keylet kl = keylet_type == keylet_code::CHECK ? ripple::keylet::check(id, seq) : keylet_type == keylet_code::ESCROW - ? ripple::keylet::escrow(id, seq) - : keylet_type == keylet_code::NFT_OFFER - ? ripple::keylet::nftoffer(id, seq) - : ripple::keylet::offer(id, seq); + ? ripple::keylet::escrow(id, seq) + : keylet_type == keylet_code::NFT_OFFER + ? ripple::keylet::nftoffer(id, seq) + : ripple::keylet::offer(id, seq); return serialize_keylet(kl, memory, write_ptr, write_len); } @@ -3129,13 +3129,11 @@ DEFINE_HOOK_FUNCTION( WRITE_WASM_MEMORY_AND_RETURN( write_ptr, write_len, - keylet_type == keylet_code::AMENDMENTS - ? cAmendments.data() - : keylet_type == keylet_code::FEES - ? cFees.data() - : keylet_type == keylet_code::NEGATIVE_UNL - ? cNegativeUNL.data() - : cEmittedDir.data(), + keylet_type == keylet_code::AMENDMENTS ? cAmendments.data() + : keylet_type == keylet_code::FEES ? cFees.data() + : keylet_type == keylet_code::NEGATIVE_UNL + ? cNegativeUNL.data() + : cEmittedDir.data(), 34, memory, memory_length); @@ -5996,9 +5994,9 @@ DEFINE_HOOK_FUNCTION( size_t free_count = hook_api::max_slots - hookCtx.slot.size(); - size_t needed_count = slot_into_tx == 0 && slot_into_meta == 0 - ? 2 - : slot_into_tx != 0 && slot_into_meta != 0 ? 0 : 1; + size_t needed_count = slot_into_tx == 0 && slot_into_meta == 0 ? 2 + : slot_into_tx != 0 && slot_into_meta != 0 ? 0 + : 1; if (free_count < needed_count) return NO_FREE_SLOTS; diff --git a/src/xrpld/app/ledger/LedgerHistory.cpp b/src/xrpld/app/ledger/LedgerHistory.cpp index dd7575d19..c2cb300cc 100644 --- a/src/xrpld/app/ledger/LedgerHistory.cpp +++ b/src/xrpld/app/ledger/LedgerHistory.cpp @@ -204,30 +204,30 @@ log_metadata_difference( { JLOG(j.debug()) << "MISMATCH on TX " << tx << ": Different result and index!"; - JLOG(j.debug()) << " Built:" - << " Result: " << builtMetaData->getResult() - << " Index: " << builtMetaData->getIndex(); - JLOG(j.debug()) << " Valid:" - << " Result: " << validMetaData->getResult() - << " Index: " << validMetaData->getIndex(); + JLOG(j.debug()) + << " Built:" << " Result: " << builtMetaData->getResult() + << " Index: " << builtMetaData->getIndex(); + JLOG(j.debug()) + << " Valid:" << " Result: " << validMetaData->getResult() + << " Index: " << validMetaData->getIndex(); } else if (result_diff) { JLOG(j.debug()) << "MISMATCH on TX " << tx << ": Different result!"; - JLOG(j.debug()) << " Built:" - << " Result: " << builtMetaData->getResult(); - JLOG(j.debug()) << " Valid:" - << " Result: " << validMetaData->getResult(); + JLOG(j.debug()) + << " Built:" << " Result: " << builtMetaData->getResult(); + JLOG(j.debug()) + << " Valid:" << " Result: " << validMetaData->getResult(); } else if (index_diff) { JLOG(j.debug()) << "MISMATCH on TX " << tx << ": Different index!"; - JLOG(j.debug()) << " Built:" - << " Index: " << builtMetaData->getIndex(); - JLOG(j.debug()) << " Valid:" - << " Index: " << validMetaData->getIndex(); + JLOG(j.debug()) + << " Built:" << " Index: " << builtMetaData->getIndex(); + JLOG(j.debug()) + << " Valid:" << " Index: " << validMetaData->getIndex(); } } else @@ -246,12 +246,12 @@ log_metadata_difference( JLOG(j.debug()) << "MISMATCH on TX " << tx << ": Different result and nodes!"; JLOG(j.debug()) - << " Built:" - << " Result: " << builtMetaData->getResult() << " Nodes:\n" + << " Built:" << " Result: " << builtMetaData->getResult() + << " Nodes:\n" << builtNodes.getJson(JsonOptions::none); JLOG(j.debug()) - << " Valid:" - << " Result: " << validMetaData->getResult() << " Nodes:\n" + << " Valid:" << " Result: " << validMetaData->getResult() + << " Nodes:\n" << validNodes.getJson(JsonOptions::none); } else if (index_diff) @@ -259,23 +259,21 @@ log_metadata_difference( JLOG(j.debug()) << "MISMATCH on TX " << tx << ": Different index and nodes!"; JLOG(j.debug()) - << " Built:" - << " Index: " << builtMetaData->getIndex() << " Nodes:\n" + << " Built:" << " Index: " << builtMetaData->getIndex() + << " Nodes:\n" << builtNodes.getJson(JsonOptions::none); JLOG(j.debug()) - << " Valid:" - << " Index: " << validMetaData->getIndex() << " Nodes:\n" + << " Valid:" << " Index: " << validMetaData->getIndex() + << " Nodes:\n" << validNodes.getJson(JsonOptions::none); } else // nodes_diff { JLOG(j.debug()) << "MISMATCH on TX " << tx << ": Different nodes!"; - JLOG(j.debug()) << " Built:" - << " Nodes:\n" + JLOG(j.debug()) << " Built:" << " Nodes:\n" << builtNodes.getJson(JsonOptions::none); - JLOG(j.debug()) << " Valid:" - << " Nodes:\n" + JLOG(j.debug()) << " Valid:" << " Nodes:\n" << validNodes.getJson(JsonOptions::none); } } @@ -330,10 +328,10 @@ LedgerHistory::handleMismatch( if (!builtLedger || !validLedger) { - JLOG(j_.error()) << "MISMATCH cannot be analyzed:" - << " builtLedger: " << to_string(built) << " -> " - << builtLedger << " validLedger: " << to_string(valid) - << " -> " << validLedger; + JLOG(j_.error()) << "MISMATCH cannot be analyzed:" << " builtLedger: " + << to_string(built) << " -> " << builtLedger + << " validLedger: " << to_string(valid) << " -> " + << validLedger; return; } diff --git a/src/xrpld/app/ledger/detail/TimeoutCounter.cpp b/src/xrpld/app/ledger/detail/TimeoutCounter.cpp index 9d677dbe5..f70e54f8c 100644 --- a/src/xrpld/app/ledger/detail/TimeoutCounter.cpp +++ b/src/xrpld/app/ledger/detail/TimeoutCounter.cpp @@ -100,8 +100,8 @@ TimeoutCounter::invokeOnTimer() if (!progress_) { ++timeouts_; - JLOG(journal_.debug()) << "Timeout(" << timeouts_ << ") " - << " acquiring " << hash_; + JLOG(journal_.debug()) + << "Timeout(" << timeouts_ << ") " << " acquiring " << hash_; onTimer(false, sl); } else diff --git a/src/xrpld/app/main/GRPCServer.cpp b/src/xrpld/app/main/GRPCServer.cpp index 89c3d813c..5a231dfc9 100644 --- a/src/xrpld/app/main/GRPCServer.cpp +++ b/src/xrpld/app/main/GRPCServer.cpp @@ -447,8 +447,8 @@ GRPCServerImpl::handleRpcs() if (!ok) { - JLOG(journal_.debug()) << "Request listener cancelled. " - << "Destroying object"; + JLOG(journal_.debug()) + << "Request listener cancelled. " << "Destroying object"; erase(ptr); } else diff --git a/src/xrpld/app/misc/AMMHelpers.h b/src/xrpld/app/misc/AMMHelpers.h index 8bf5a5c5f..7ad0093a2 100644 --- a/src/xrpld/app/misc/AMMHelpers.h +++ b/src/xrpld/app/misc/AMMHelpers.h @@ -385,9 +385,9 @@ changeSpotPriceQuality( { JLOG(j.error()) << "changeSpotPriceQuality failed: " << to_string(pool.in) - << " " << to_string(pool.out) << " " - << " " << quality << " " << tfee << " " - << to_string(amounts.in) << " " << to_string(amounts.out); + << " " << to_string(pool.out) << " " << " " << quality + << " " << tfee << " " << to_string(amounts.in) << " " + << to_string(amounts.out); Throw("changeSpotPriceQuality failed"); } else diff --git a/src/xrpld/app/misc/NetworkOPs.cpp b/src/xrpld/app/misc/NetworkOPs.cpp index 7d6b973bc..a07f46d0e 100644 --- a/src/xrpld/app/misc/NetworkOPs.cpp +++ b/src/xrpld/app/misc/NetworkOPs.cpp @@ -3215,8 +3215,8 @@ NetworkOPsImp::pubAccountTransaction( } JLOG(m_journal.trace()) - << "pubAccountTransaction: " - << "proposed=" << iProposed << ", accepted=" << iAccepted; + << "pubAccountTransaction: " << "proposed=" << iProposed + << ", accepted=" << iAccepted; if (!notify.empty() || !accountHistoryNotify.empty()) { diff --git a/src/xrpld/app/misc/detail/TxQ.cpp b/src/xrpld/app/misc/detail/TxQ.cpp index 5441144d2..26715a901 100644 --- a/src/xrpld/app/misc/detail/TxQ.cpp +++ b/src/xrpld/app/misc/detail/TxQ.cpp @@ -1687,11 +1687,11 @@ TxQ::accept(Application& app, OpenView& view) } else { - JLOG(j_.debug()) << "Queued transaction " << candidateIter->txID - << " failed with " << transToken(txnResult) - << ". Leave in queue." - << " Applied: " << didApply - << ". Flags: " << candidateIter->flags; + JLOG(j_.debug()) + << "Queued transaction " << candidateIter->txID + << " failed with " << transToken(txnResult) + << ". Leave in queue." << " Applied: " << didApply + << ". Flags: " << candidateIter->flags; if (account.retryPenalty && candidateIter->retriesRemaining > 2) candidateIter->retriesRemaining = 1; else diff --git a/src/xrpld/app/misc/detail/ValidatorList.cpp b/src/xrpld/app/misc/detail/ValidatorList.cpp index a3854106a..9a323e011 100644 --- a/src/xrpld/app/misc/detail/ValidatorList.cpp +++ b/src/xrpld/app/misc/detail/ValidatorList.cpp @@ -689,8 +689,7 @@ ValidatorList::sendValidatorList( beast::Journal j) { std::size_t const messageVersion = - peer.supportsFeature(ProtocolFeature::ValidatorList2Propagation) - ? 2 + peer.supportsFeature(ProtocolFeature::ValidatorList2Propagation) ? 2 : peer.supportsFeature(ProtocolFeature::ValidatorListPropagation) ? 1 : 0; if (!messageVersion) diff --git a/src/xrpld/app/paths/Pathfinder.cpp b/src/xrpld/app/paths/Pathfinder.cpp index b123d5daf..2b5c5d10e 100644 --- a/src/xrpld/app/paths/Pathfinder.cpp +++ b/src/xrpld/app/paths/Pathfinder.cpp @@ -233,8 +233,7 @@ Pathfinder::findPaths( mSource = STPathElement(account, mSrcCurrency, issuer); auto issuerString = mSrcIssuer ? to_string(*mSrcIssuer) : std::string("none"); - JLOG(j_.trace()) << "findPaths>" - << " mSrcAccount=" << mSrcAccount + JLOG(j_.trace()) << "findPaths>" << " mSrcAccount=" << mSrcAccount << " mDstAccount=" << mDstAccount << " mDstAmount=" << mDstAmount.getFullText() << " mSrcCurrency=" << mSrcCurrency diff --git a/src/xrpld/app/paths/detail/BookStep.cpp b/src/xrpld/app/paths/detail/BookStep.cpp index 26cb67bb2..8a9826f32 100644 --- a/src/xrpld/app/paths/detail/BookStep.cpp +++ b/src/xrpld/app/paths/detail/BookStep.cpp @@ -188,8 +188,7 @@ protected: logStringImpl(char const* name) const { std::ostringstream ostr; - ostr << name << ": " - << "\ninIss: " << book_.in.account + ostr << name << ": " << "\ninIss: " << book_.in.account << "\noutIss: " << book_.out.account << "\ninCur: " << book_.in.currency << "\noutCur: " << book_.out.currency; diff --git a/src/xrpld/app/paths/detail/DirectStep.cpp b/src/xrpld/app/paths/detail/DirectStep.cpp index af53ffca6..d60e995ad 100644 --- a/src/xrpld/app/paths/detail/DirectStep.cpp +++ b/src/xrpld/app/paths/detail/DirectStep.cpp @@ -204,8 +204,7 @@ protected: logStringImpl(char const* name) const { std::ostringstream ostr; - ostr << name << ": " - << "\nSrc: " << src_ << "\nDst: " << dst_; + ostr << name << ": " << "\nSrc: " << src_ << "\nDst: " << dst_; return ostr.str(); } @@ -236,7 +235,8 @@ public: using DirectStepI::DirectStepI; using DirectStepI::check; - bool verifyPrevStepDebtDirection(DebtDirection) const + bool + verifyPrevStepDebtDirection(DebtDirection) const { // A payment doesn't care whether or not prevStepRedeems. return true; diff --git a/src/xrpld/app/paths/detail/XRPEndpointStep.cpp b/src/xrpld/app/paths/detail/XRPEndpointStep.cpp index 770a5bd5e..54b17336a 100644 --- a/src/xrpld/app/paths/detail/XRPEndpointStep.cpp +++ b/src/xrpld/app/paths/detail/XRPEndpointStep.cpp @@ -132,8 +132,7 @@ protected: logStringImpl(char const* name) const { std::ostringstream ostr; - ostr << name << ": " - << "\nAcc: " << acc_; + ostr << name << ": " << "\nAcc: " << acc_; return ostr.str(); } diff --git a/src/xrpld/app/rdb/RelationalDatabase.h b/src/xrpld/app/rdb/RelationalDatabase.h index 00e236f20..5b06aa24d 100644 --- a/src/xrpld/app/rdb/RelationalDatabase.h +++ b/src/xrpld/app/rdb/RelationalDatabase.h @@ -237,8 +237,8 @@ rangeCheckedCast(C c) /* This should never happen */ assert(0); JLOG(debugLog().error()) - << "rangeCheckedCast domain error:" - << " value = " << c << " min = " << std::numeric_limits::lowest() + << "rangeCheckedCast domain error:" << " value = " << c + << " min = " << std::numeric_limits::lowest() << " max: " << std::numeric_limits::max(); } diff --git a/src/xrpld/app/tx/detail/AMMCreate.cpp b/src/xrpld/app/tx/detail/AMMCreate.cpp index 2ab20fe5e..2a75a5969 100644 --- a/src/xrpld/app/tx/detail/AMMCreate.cpp +++ b/src/xrpld/app/tx/detail/AMMCreate.cpp @@ -250,8 +250,8 @@ applyCreate( ctx_.view().rules().enabled(featureXahauGenesis) ? ctx_.view().info().parentCloseTime.time_since_epoch().count() : ctx_.view().rules().enabled(featureDeletableAccounts) - ? ctx_.view().seq() - : 1}; + ? ctx_.view().seq() + : 1}; sleAMMRoot->setFieldU32(sfSequence, seqno); // Ignore reserves requirement, disable the master key, allow default // rippling (AMM LPToken can be used in payments and offer crossing but diff --git a/src/xrpld/app/tx/detail/CancelOffer.cpp b/src/xrpld/app/tx/detail/CancelOffer.cpp index d3912b6d7..c91ca9bd4 100644 --- a/src/xrpld/app/tx/detail/CancelOffer.cpp +++ b/src/xrpld/app/tx/detail/CancelOffer.cpp @@ -34,8 +34,8 @@ CancelOffer::preflight(PreflightContext const& ctx) if (uTxFlags & tfUniversalMask) { - JLOG(ctx.j.trace()) << "Malformed transaction: " - << "Invalid flags set."; + JLOG(ctx.j.trace()) + << "Malformed transaction: " << "Invalid flags set."; return temINVALID_FLAG; } diff --git a/src/xrpld/app/tx/detail/Import.cpp b/src/xrpld/app/tx/detail/Import.cpp index 91a548cbc..24791edee 100644 --- a/src/xrpld/app/tx/detail/Import.cpp +++ b/src/xrpld/app/tx/detail/Import.cpp @@ -1308,8 +1308,8 @@ Import::doApply() view().rules().enabled(featureXahauGenesis) ? view().info().parentCloseTime.time_since_epoch().count() : view().rules().enabled(featureDeletableAccounts) - ? view().seq() - : 1}; + ? view().seq() + : 1}; sle = std::make_shared(keylet::account(id)); sle->setAccountID(sfAccount, id); diff --git a/src/xrpld/app/tx/detail/Payment.cpp b/src/xrpld/app/tx/detail/Payment.cpp index 4f186db83..b9f54f04f 100644 --- a/src/xrpld/app/tx/detail/Payment.cpp +++ b/src/xrpld/app/tx/detail/Payment.cpp @@ -56,8 +56,7 @@ Payment::preflight(PreflightContext const& ctx) if (uTxFlags & tfPaymentMask) { - JLOG(j.trace()) << "Malformed transaction: " - << "Invalid flags set."; + JLOG(j.trace()) << "Malformed transaction: " << "Invalid flags set."; return temINVALID_FLAG; } @@ -102,20 +101,19 @@ Payment::preflight(PreflightContext const& ctx) } if (bMax && maxSourceAmount <= beast::zero) { - JLOG(j.trace()) << "Malformed transaction: " - << "bad max amount: " << maxSourceAmount.getFullText(); + JLOG(j.trace()) << "Malformed transaction: " << "bad max amount: " + << maxSourceAmount.getFullText(); return temBAD_AMOUNT; } if (saDstAmount <= beast::zero) { - JLOG(j.trace()) << "Malformed transaction: " - << "bad dst amount: " << saDstAmount.getFullText(); + JLOG(j.trace()) << "Malformed transaction: " << "bad dst amount: " + << saDstAmount.getFullText(); return temBAD_AMOUNT; } if (isBadCurrency(uSrcCurrency) || isBadCurrency(uDstCurrency)) { - JLOG(j.trace()) << "Malformed transaction: " - << "Bad currency."; + JLOG(j.trace()) << "Malformed transaction: " << "Bad currency."; return temBAD_CURRENCY; } if (account == uDstAccountID && uSrcCurrency == uDstCurrency && !bPaths) @@ -327,8 +325,8 @@ Payment::doApply() view().rules().enabled(featureXahauGenesis) ? view().info().parentCloseTime.time_since_epoch().count() : view().rules().enabled(featureDeletableAccounts) - ? view().seq() - : 1}; + ? view().seq() + : 1}; // Create the account. sleDst = std::make_shared(k); @@ -460,8 +458,8 @@ Payment::doApply() { // Vote no. However the transaction might succeed, if applied in // a different order. - JLOG(j_.trace()) << "Delay transaction: Insufficient funds: " - << " " << to_string(mPriorBalance) << " / " + JLOG(j_.trace()) << "Delay transaction: Insufficient funds: " << " " + << to_string(mPriorBalance) << " / " << to_string(saDstAmount.xrp() + mmm) << " (" << to_string(reserve) << ")"; diff --git a/src/xrpld/app/tx/detail/Remit.cpp b/src/xrpld/app/tx/detail/Remit.cpp index 73ca8abe5..5528d10d9 100644 --- a/src/xrpld/app/tx/detail/Remit.cpp +++ b/src/xrpld/app/tx/detail/Remit.cpp @@ -319,7 +319,8 @@ Remit::doApply() std::uint32_t const seqno{ sb.rules().enabled(featureXahauGenesis) ? sb.info().parentCloseTime.time_since_epoch().count() - : sb.rules().enabled(featureDeletableAccounts) ? sb.seq() : 1}; + : sb.rules().enabled(featureDeletableAccounts) ? sb.seq() + : 1}; sleDstAcc = std::make_shared(keylet::account(dstAccID)); sleDstAcc->setAccountID(sfAccount, dstAccID); diff --git a/src/xrpld/app/tx/detail/Transactor.cpp b/src/xrpld/app/tx/detail/Transactor.cpp index 6040e80a6..8a75a676f 100644 --- a/src/xrpld/app/tx/detail/Transactor.cpp +++ b/src/xrpld/app/tx/detail/Transactor.cpp @@ -480,9 +480,9 @@ Transactor::checkFee(PreclaimContext const& ctx, XRPAmount baseFee) if (balance < feePaid) { - JLOG(ctx.j.trace()) << "Insufficient balance:" - << " balance=" << to_string(balance) - << " paid=" << to_string(feePaid); + JLOG(ctx.j.trace()) + << "Insufficient balance:" << " balance=" << to_string(balance) + << " paid=" << to_string(feePaid); if ((balance > beast::zero) && !ctx.view.open()) { diff --git a/src/xrpld/app/tx/detail/URIToken.cpp b/src/xrpld/app/tx/detail/URIToken.cpp index d86ddbf7d..7f93b0716 100644 --- a/src/xrpld/app/tx/detail/URIToken.cpp +++ b/src/xrpld/app/tx/detail/URIToken.cpp @@ -756,10 +756,9 @@ URIToken::doApply() true); } - initSellerBal = !sleDstLine - ? purchaseAmount.zeroed() - : sellerLow ? ((*sleDstLine)[sfBalance]) - : -((*sleDstLine)[sfBalance]); + initSellerBal = !sleDstLine ? purchaseAmount.zeroed() + : sellerLow ? ((*sleDstLine)[sfBalance]) + : -((*sleDstLine)[sfBalance]); finSellerBal = *initSellerBal + *dstAmt; } diff --git a/src/xrpld/conditions/detail/PreimageSha256.h b/src/xrpld/conditions/detail/PreimageSha256.h index c0eca96b0..5185ded7a 100644 --- a/src/xrpld/conditions/detail/PreimageSha256.h +++ b/src/xrpld/conditions/detail/PreimageSha256.h @@ -137,7 +137,8 @@ public: return {type(), cost(), fingerprint()}; } - bool validate(Slice) const override + bool + validate(Slice) const override { // Perhaps counterintuitively, the message isn't // relevant. diff --git a/src/xrpld/consensus/Consensus.h b/src/xrpld/consensus/Consensus.h index cd17b00d9..4a5951ed0 100644 --- a/src/xrpld/consensus/Consensus.h +++ b/src/xrpld/consensus/Consensus.h @@ -1060,8 +1060,7 @@ Consensus::checkLedger() { JLOG(j_.warn()) << "View of consensus changed during " << to_string(phase_) << " status=" << to_string(phase_) - << ", " - << " mode=" << to_string(mode_.get()); + << ", " << " mode=" << to_string(mode_.get()); JLOG(j_.warn()) << prevLedgerID_ << " to " << netLgr; JLOG(j_.warn()) << Json::Compact{previousLedger_.getJson()}; JLOG(j_.debug()) << "State on consensus change " @@ -1164,8 +1163,7 @@ Consensus::shouldPause() const << "roundTime: " << result_->roundTime.read().count() << ", " << "max consensus time: " << parms.ledgerMAX_CONSENSUS.count() << ", " << "validators: " << totalValidators << ", " - << "laggards: " << laggards << ", " - << "offline: " << offline << ", " + << "laggards: " << laggards << ", " << "offline: " << offline << ", " << "quorum: " << quorum << ")"; if (!ahead || !laggards || !totalValidators || !adaptor_.validator() || @@ -1491,8 +1489,8 @@ Consensus::updateOurPositions() if (!haveCloseTimeConsensus_) { JLOG(j_.debug()) - << "No CT consensus:" - << " Proposers:" << currPeerPositions_.size() + << "No CT consensus:" << " Proposers:" + << currPeerPositions_.size() << " Mode:" << to_string(mode_.get()) << " Thresh:" << threshConsensus << " Pos:" << consensusCloseTime.time_since_epoch().count(); diff --git a/src/xrpld/consensus/Validations.h b/src/xrpld/consensus/Validations.h index ed07858d3..a1171effb 100644 --- a/src/xrpld/consensus/Validations.h +++ b/src/xrpld/consensus/Validations.h @@ -482,8 +482,7 @@ private: withTrie(std::lock_guard const& lock, F&& f) { // Call current to flush any stale validations - current( - lock, [](auto) {}, [](auto, auto) {}); + current(lock, [](auto) {}, [](auto, auto) {}); checkAcquired(lock); return f(trie_); } diff --git a/src/xrpld/core/DatabaseCon.h b/src/xrpld/core/DatabaseCon.h index 935147815..c8c40dec6 100644 --- a/src/xrpld/core/DatabaseCon.h +++ b/src/xrpld/core/DatabaseCon.h @@ -73,7 +73,8 @@ public: { return session_.get(); } - explicit operator bool() const + explicit + operator bool() const { return bool(session_); } diff --git a/src/xrpld/ledger/View.h b/src/xrpld/ledger/View.h index e44d00476..926892fb1 100644 --- a/src/xrpld/ledger/View.h +++ b/src/xrpld/ledger/View.h @@ -477,7 +477,8 @@ struct RunType { // see: // http://alumni.media.mit.edu/~rahimi/compile-time-flags/ - constexpr operator T() const + constexpr + operator T() const { static_assert(std::is_same::value); return V; diff --git a/src/xrpld/ledger/detail/View.cpp b/src/xrpld/ledger/detail/View.cpp index 027cf3c74..492c3bf3f 100644 --- a/src/xrpld/ledger/detail/View.cpp +++ b/src/xrpld/ledger/detail/View.cpp @@ -282,8 +282,7 @@ accountHolds( amount.setIssuer(issuer); } - JLOG(j.trace()) << "accountHolds:" - << " account=" << to_string(account) + JLOG(j.trace()) << "accountHolds:" << " account=" << to_string(account) << " amount=" << amount.getFullText(); return view.balanceHook(account, issuer, amount); @@ -392,8 +391,7 @@ xrpLiquid( STAmount const amount = (balance < reserve) ? STAmount{0} : balance - reserve; - JLOG(j.trace()) << "accountHolds:" - << " account=" << to_string(id) + JLOG(j.trace()) << "accountHolds:" << " account=" << to_string(id) << " amount=" << amount.getFullText() << " fullBalance=" << fullBalance.getFullText() << " balance=" << balance.getFullText() diff --git a/src/xrpld/nodestore/detail/DatabaseNodeImp.h b/src/xrpld/nodestore/detail/DatabaseNodeImp.h index fbb6b304e..91b14875a 100644 --- a/src/xrpld/nodestore/detail/DatabaseNodeImp.h +++ b/src/xrpld/nodestore/detail/DatabaseNodeImp.h @@ -106,7 +106,8 @@ public: store(NodeObjectType type, Blob&& data, uint256 const& hash, std::uint32_t) override; - bool isSameDB(std::uint32_t, std::uint32_t) override + bool + isSameDB(std::uint32_t, std::uint32_t) override { // only one database return true; diff --git a/src/xrpld/nodestore/detail/DatabaseRotatingImp.h b/src/xrpld/nodestore/detail/DatabaseRotatingImp.h index a2914cb41..69cda798e 100644 --- a/src/xrpld/nodestore/detail/DatabaseRotatingImp.h +++ b/src/xrpld/nodestore/detail/DatabaseRotatingImp.h @@ -65,7 +65,8 @@ public: void importDatabase(Database& source) override; - bool isSameDB(std::uint32_t, std::uint32_t) override + bool + isSameDB(std::uint32_t, std::uint32_t) override { // rotating store acts as one logical database return true; diff --git a/src/xrpld/overlay/detail/PeerImp.cpp b/src/xrpld/overlay/detail/PeerImp.cpp index 9df85d668..510c2924c 100644 --- a/src/xrpld/overlay/detail/PeerImp.cpp +++ b/src/xrpld/overlay/detail/PeerImp.cpp @@ -590,7 +590,7 @@ PeerImp::fail(std::string const& reason) return post( strand_, std::bind( - (void (Peer::*)(std::string const&)) & PeerImp::fail, + (void(Peer::*)(std::string const&)) & PeerImp::fail, shared_from_this(), reason)); if (journal_.active(beast::severities::kWarning) && socket_.is_open()) @@ -1225,8 +1225,8 @@ PeerImp::handleTransaction( { // If we've never been in synch, there's nothing we can do // with a transaction - JLOG(p_journal_.debug()) << "Ignoring incoming transaction: " - << "Need network ledger"; + JLOG(p_journal_.debug()) + << "Ignoring incoming transaction: " << "Need network ledger"; return; } diff --git a/src/xrpld/overlay/detail/ProtocolVersion.cpp b/src/xrpld/overlay/detail/ProtocolVersion.cpp index bd2effa63..0fecb301f 100644 --- a/src/xrpld/overlay/detail/ProtocolVersion.cpp +++ b/src/xrpld/overlay/detail/ProtocolVersion.cpp @@ -45,7 +45,7 @@ constexpr ProtocolVersion const supportedProtocolList[] // ascending order and doesn't contain any duplicates. // FIXME: With C++20 we can use std::is_sorted with an appropriate comparator static_assert( - []() constexpr->bool { + []() constexpr -> bool { auto const len = std::distance( std::begin(supportedProtocolList), std::end(supportedProtocolList)); diff --git a/src/xrpld/peerfinder/detail/Logic.h b/src/xrpld/peerfinder/detail/Logic.h index 0403530ec..3bfb9942c 100644 --- a/src/xrpld/peerfinder/detail/Logic.h +++ b/src/xrpld/peerfinder/detail/Logic.h @@ -1109,9 +1109,9 @@ public: } else { - JLOG(m_journal.error()) << beast::leftw(18) << "Logic failed " - << "'" << source->name() << "' fetch, " - << results.error.message(); + JLOG(m_journal.error()) + << beast::leftw(18) << "Logic failed " << "'" << source->name() + << "' fetch, " << results.error.message(); } } diff --git a/src/xrpld/rpc/detail/ServerHandler.cpp b/src/xrpld/rpc/detail/ServerHandler.cpp index ad476b1dc..f771be274 100644 --- a/src/xrpld/rpc/detail/ServerHandler.cpp +++ b/src/xrpld/rpc/detail/ServerHandler.cpp @@ -449,9 +449,9 @@ logDuration( beast::Journal& journal) { using namespace std::chrono_literals; - auto const level = (duration >= 10s) - ? journal.error() - : (duration >= 1s) ? journal.warn() : journal.debug(); + auto const level = (duration >= 10s) ? journal.error() + : (duration >= 1s) ? journal.warn() + : journal.debug(); JLOG(level) << "RPC request processing duration = " << std::chrono::duration_cast( diff --git a/src/xrpld/rpc/handlers/ServerDefinitions.cpp b/src/xrpld/rpc/handlers/ServerDefinitions.cpp index 2a85ab031..43efc1deb 100644 --- a/src/xrpld/rpc/handlers/ServerDefinitions.cpp +++ b/src/xrpld/rpc/handlers/ServerDefinitions.cpp @@ -458,7 +458,7 @@ private: Json::Value defs; public: - Definitions() : defs(generate()){}; + Definitions() : defs(generate()) {}; uint256 const& getHash() const diff --git a/src/xrpld/shamap/detail/TaggedPointer.ipp b/src/xrpld/shamap/detail/TaggedPointer.ipp index 309913c79..487b88e34 100644 --- a/src/xrpld/shamap/detail/TaggedPointer.ipp +++ b/src/xrpld/shamap/detail/TaggedPointer.ipp @@ -55,8 +55,8 @@ constexpr size_t elementSizeBytes = constexpr size_t blockSizeBytes = kilobytes(512); template -constexpr std::array initArrayChunkSizeBytes( - std::index_sequence) +constexpr std::array +initArrayChunkSizeBytes(std::index_sequence) { return std::array{ boundaries[I] * elementSizeBytes..., @@ -66,8 +66,8 @@ constexpr auto arrayChunkSizeBytes = initArrayChunkSizeBytes(std::make_index_sequence{}); template -constexpr std::array initArrayChunksPerBlock( - std::index_sequence) +constexpr std::array +initArrayChunksPerBlock(std::index_sequence) { return std::array{ blockSizeBytes / arrayChunkSizeBytes[I]..., @@ -93,8 +93,8 @@ boundariesIndex(std::uint8_t numChildren) } template -std::array, boundaries.size()> initAllocateArrayFuns( - std::index_sequence) +std::array, boundaries.size()> +initAllocateArrayFuns(std::index_sequence) { return std::array, boundaries.size()>{ boost::singleton_pool< @@ -110,8 +110,8 @@ std::array, boundaries.size()> const allocateArrayFuns = initAllocateArrayFuns(std::make_index_sequence{}); template -std::array, boundaries.size()> initFreeArrayFuns( - std::index_sequence) +std::array, boundaries.size()> +initFreeArrayFuns(std::index_sequence) { return std::array, boundaries.size()>{ static_cast(boost::singleton_pool< @@ -127,8 +127,8 @@ std::array, boundaries.size()> const freeArrayFuns = initFreeArrayFuns(std::make_index_sequence{}); template -std::array, boundaries.size()> initIsFromArrayFuns( - std::index_sequence) +std::array, boundaries.size()> +initIsFromArrayFuns(std::index_sequence) { return std::array, boundaries.size()>{ boost::singleton_pool< diff --git a/src/xrpld/unity/rocksdb.h b/src/xrpld/unity/rocksdb.h index 06ccb116d..4a71dc4b5 100644 --- a/src/xrpld/unity/rocksdb.h +++ b/src/xrpld/unity/rocksdb.h @@ -21,7 +21,7 @@ #define RIPPLE_UNITY_ROCKSDB_H_INCLUDED #if RIPPLE_ROCKSDB_AVAILABLE -//#include +// #include #include #include #include