diff --git a/include/xrpl/basics/base_uint.h b/include/xrpl/basics/base_uint.h index 15fc4f6966..3f38d4049b 100644 --- a/include/xrpl/basics/base_uint.h +++ b/include/xrpl/basics/base_uint.h @@ -62,7 +62,7 @@ struct IsContiguousContainer : std::true_type number of bits. */ template -class BaseUint +class BaseUInt { static_assert((Bits % 32) == 0, "The length of a base_uint in bits must be a multiple of 32."); @@ -160,7 +160,7 @@ private: explicit VoidHelper() = default; }; - explicit BaseUint(void const* data, VoidHelper) + explicit BaseUInt(void const* data, VoidHelper) { memcpy(data_.data(), data, kBYTES); } @@ -244,15 +244,15 @@ private: } public: - constexpr BaseUint() : data_{} + constexpr BaseUInt() : data_{} { } - constexpr BaseUint(beast::Zero) : data_{} + constexpr BaseUInt(beast::Zero) : data_{} { } - explicit BaseUint(std::uint64_t b) + explicit BaseUInt(std::uint64_t b) { *this = b; } @@ -260,7 +260,7 @@ public: // This constructor is intended to be used at compile time since it might // throw at runtime. Consider declaring this constructor consteval once // we get to C++23. - explicit constexpr BaseUint(std::string_view sv) noexcept(false) + explicit constexpr BaseUInt(std::string_view sv) noexcept(false) : data_(parseFromStringViewThrows(sv)) { } @@ -270,11 +270,11 @@ public: class = std::enable_if_t< detail::IsContiguousContainer::value && std::is_trivially_copyable_v>> - explicit BaseUint(Container const& c) + explicit BaseUInt(Container const& c) { XRPL_ASSERT( c.size() * sizeof(typename Container::value_type) == size(), - "xrpl::base_uint::base_uint(Container auto) : input size match"); + "xrpl::BaseUInt::BaseUInt(Container auto) : input size match"); std::memcpy(data_.data(), c.data(), size()); } @@ -282,12 +282,12 @@ public: std::enable_if_t< detail::IsContiguousContainer::value && std::is_trivially_copyable_v, - BaseUint&> + BaseUInt&> operator=(Container const& c) { XRPL_ASSERT( c.size() * sizeof(typename Container::value_type) == size(), - "xrpl::base_uint::operator=(Container auto) : input size match"); + "xrpl::BaseUInt::operator=(Container auto) : input size match"); std::memcpy(data_.data(), c.data(), size()); return *this; } @@ -295,14 +295,14 @@ public: /* Construct from a raw pointer. The buffer pointed to by `data` must be at least Bits/8 bytes. */ - static BaseUint + static BaseUInt fromVoid(void const* data) { - return BaseUint(data, VoidHelper()); + return BaseUInt(data, VoidHelper()); } template - static std::optional + static std::optional fromVoidChecked(T const& from) { if (from.size() != size()) @@ -328,10 +328,10 @@ public: return *this == beast::kZERO; } - constexpr BaseUint + constexpr BaseUInt operator~() const { - BaseUint ret; + BaseUInt ret; for (int i = 0; i < kWIDTH; i++) ret.data_[i] = ~data_[i]; @@ -339,7 +339,7 @@ public: return ret; } - BaseUint& + BaseUInt& operator=(std::uint64_t uHost) { *this = beast::kZERO; @@ -357,8 +357,8 @@ public: return *this; } - BaseUint& - operator^=(BaseUint const& b) + BaseUInt& + operator^=(BaseUInt const& b) { for (int i = 0; i < kWIDTH; i++) data_[i] ^= b.data_[i]; @@ -366,8 +366,8 @@ public: return *this; } - BaseUint& - operator&=(BaseUint const& b) + BaseUInt& + operator&=(BaseUInt const& b) { for (int i = 0; i < kWIDTH; i++) data_[i] &= b.data_[i]; @@ -375,8 +375,8 @@ public: return *this; } - BaseUint& - operator|=(BaseUint const& b) + BaseUInt& + operator|=(BaseUInt const& b) { for (int i = 0; i < kWIDTH; i++) data_[i] |= b.data_[i]; @@ -384,7 +384,7 @@ public: return *this; } - BaseUint& + BaseUInt& operator++() { // prefix operator @@ -398,17 +398,17 @@ public: return *this; } - BaseUint + BaseUInt operator++(int) { // postfix operator - BaseUint const ret = *this; + BaseUInt const ret = *this; ++(*this); return ret; } - BaseUint& + BaseUInt& operator--() { for (int i = kWIDTH - 1; i >= 0; --i) @@ -423,32 +423,32 @@ public: return *this; } - BaseUint + BaseUInt operator--(int) { // postfix operator - BaseUint const ret = *this; + BaseUInt const ret = *this; --(*this); return ret; } - [[nodiscard]] BaseUint + [[nodiscard]] BaseUInt next() const { auto ret = *this; return ++ret; } - [[nodiscard]] BaseUint + [[nodiscard]] BaseUInt prev() const { auto ret = *this; return --ret; } - BaseUint& - operator+=(BaseUint const& b) + BaseUInt& + operator+=(BaseUInt const& b) { std::uint64_t carry = 0; @@ -466,7 +466,7 @@ public: template friend void - hash_append(Hasher& h, BaseUint const& a) noexcept + hash_append(Hasher& h, BaseUInt const& a) noexcept { // Do not allow any endian transformations on this memory h(a.data_.data(), sizeof(a.data_)); @@ -509,7 +509,7 @@ public: return kBYTES; } - BaseUint& + BaseUInt& operator=(beast::Zero) { data_.fill(0); @@ -534,14 +534,14 @@ public: } }; -using uint128 = BaseUint<128>; -using uint160 = BaseUint<160>; -using uint256 = BaseUint<256>; -using uint192 = BaseUint<192>; +using uint128 = BaseUInt<128>; +using uint160 = BaseUInt<160>; +using uint256 = BaseUInt<256>; +using uint192 = BaseUInt<192>; template [[nodiscard]] constexpr std::strong_ordering -operator<=>(BaseUint const& lhs, BaseUint const& rhs) +operator<=>(BaseUInt const& lhs, BaseUInt const& rhs) { // This comparison might seem wrong on a casual inspection because it // compares data internally stored as std::uint32_t byte-by-byte. But @@ -562,7 +562,7 @@ operator<=>(BaseUint const& lhs, BaseUint const& rhs) template [[nodiscard]] constexpr bool -operator==(BaseUint const& lhs, BaseUint const& rhs) +operator==(BaseUInt const& lhs, BaseUInt const& rhs) { return (lhs <=> rhs) == 0; } @@ -570,59 +570,59 @@ operator==(BaseUint const& lhs, BaseUint const& rhs) //------------------------------------------------------------------------------ template constexpr bool -operator==(BaseUint const& a, std::uint64_t b) +operator==(BaseUInt const& a, std::uint64_t b) { - return a == BaseUint(b); + return a == BaseUInt(b); } //------------------------------------------------------------------------------ template -constexpr BaseUint -operator^(BaseUint const& a, BaseUint const& b) +constexpr BaseUInt +operator^(BaseUInt const& a, BaseUInt const& b) { - return BaseUint(a) ^= b; + return BaseUInt(a) ^= b; } template -constexpr BaseUint -operator&(BaseUint const& a, BaseUint const& b) +constexpr BaseUInt +operator&(BaseUInt const& a, BaseUInt const& b) { - return BaseUint(a) &= b; + return BaseUInt(a) &= b; } template -constexpr BaseUint -operator|(BaseUint const& a, BaseUint const& b) +constexpr BaseUInt +operator|(BaseUInt const& a, BaseUInt const& b) { - return BaseUint(a) |= b; + return BaseUInt(a) |= b; } template -constexpr BaseUint -operator+(BaseUint const& a, BaseUint const& b) +constexpr BaseUInt +operator+(BaseUInt const& a, BaseUInt const& b) { - return BaseUint(a) += b; + return BaseUInt(a) += b; } //------------------------------------------------------------------------------ template inline std::string -to_string(BaseUint const& a) +to_string(BaseUInt const& a) { return strHex(a.cbegin(), a.cend()); } template inline std::string -toShortString(BaseUint const& a) +toShortString(BaseUInt const& a) { - static_assert(BaseUint::kBYTES > 4, "For 4 bytes or less, use a native type"); + static_assert(BaseUInt::kBYTES > 4, "For 4 bytes or less, use a native type"); return strHex(a.cbegin(), a.cbegin() + 4) + "..."; } template inline std::ostream& -operator<<(std::ostream& out, BaseUint const& u) +operator<<(std::ostream& out, BaseUInt const& u) { return out << to_string(u); } @@ -650,7 +650,7 @@ static_assert(sizeof(uint256) == 256 / 8, "There should be no padding bytes"); namespace beast { template -struct IsUniquelyRepresented> : public std::true_type +struct IsUniquelyRepresented> : public std::true_type { explicit IsUniquelyRepresented() = default; }; diff --git a/include/xrpl/basics/partitioned_unordered_map.h b/include/xrpl/basics/partitioned_unordered_map.h index 5f32cca8af..3bf64985e5 100644 --- a/include/xrpl/basics/partitioned_unordered_map.h +++ b/include/xrpl/basics/partitioned_unordered_map.h @@ -236,7 +236,7 @@ public: map_.resize(partitions_); XRPL_ASSERT( partitions_, - "xrpl::partitioned_unordered_map::partitioned_unordered_map : " + "xrpl::PartitionedUnorderedMap::PartitionedUnorderedMap : " "nonzero partitions"); } diff --git a/include/xrpl/basics/random.h b/include/xrpl/basics/random.h index ca51ef9364..7dfade5bda 100644 --- a/include/xrpl/basics/random.h +++ b/include/xrpl/basics/random.h @@ -94,7 +94,7 @@ template std::enable_if_t && detail::is_engine::value, Integral> randInt(Engine& engine, Integral min, Integral max) { - XRPL_ASSERT(max > min, "xrpl::rand_int : max over min inputs"); + XRPL_ASSERT(max > min, "xrpl::randInt : max over min inputs"); // This should have no state and constructing it should // be very cheap. If that turns out not to be the case diff --git a/include/xrpl/basics/safe_cast.h b/include/xrpl/basics/safe_cast.h index b9a7aa1fa0..e35495bcf7 100644 --- a/include/xrpl/basics/safe_cast.h +++ b/include/xrpl/basics/safe_cast.h @@ -81,7 +81,7 @@ safeDowncast(Src* s) noexcept return static_cast(s); // NOLINT(cppcoreguidelines-pro-type-static-cast-downcast) #else auto* result = dynamic_cast(s); - XRPL_ASSERT(result != nullptr, "xrpl::safe_downcast : pointer downcast is valid"); + XRPL_ASSERT(result != nullptr, "xrpl::safeDowncast : pointer downcast is valid"); return result; #endif } @@ -94,7 +94,7 @@ safeDowncast(Src& s) noexcept #ifndef NDEBUG XRPL_ASSERT( dynamic_cast>>(&s) != nullptr, - "xrpl::safe_downcast : reference downcast is valid"); + "xrpl::safeDowncast : reference downcast is valid"); #endif return static_cast(s); // NOLINT(cppcoreguidelines-pro-type-static-cast-downcast) } diff --git a/include/xrpl/basics/scope.h b/include/xrpl/basics/scope.h index 64f91727fa..cd2a5299b2 100644 --- a/include/xrpl/basics/scope.h +++ b/include/xrpl/basics/scope.h @@ -205,7 +205,7 @@ class ScopeUnlock public: explicit ScopeUnlock(std::unique_lock& lock) noexcept(true) : plock_(&lock) { - XRPL_ASSERT(plock_->owns_lock(), "xrpl::scope_unlock::scope_unlock : mutex must be locked"); + XRPL_ASSERT(plock_->owns_lock(), "xrpl::ScopeUnlock::ScopeUnlock : mutex must be locked"); plock_->unlock(); } diff --git a/include/xrpl/basics/spinlock.h b/include/xrpl/basics/spinlock.h index 3518b94680..2cc00efdef 100644 --- a/include/xrpl/basics/spinlock.h +++ b/include/xrpl/basics/spinlock.h @@ -103,7 +103,7 @@ public: { XRPL_ASSERT( index >= 0 && (mask_ != 0), - "xrpl::packed_spinlock::packed_spinlock : valid index and mask"); + "xrpl::PackedSpinlock::PackedSpinlock : valid index and mask"); } [[nodiscard]] bool diff --git a/include/xrpl/beast/asio/io_latency_probe.h b/include/xrpl/beast/asio/io_latency_probe.h index 4ba985e579..ce3929a394 100644 --- a/include/xrpl/beast/asio/io_latency_probe.h +++ b/include/xrpl/beast/asio/io_latency_probe.h @@ -15,7 +15,7 @@ namespace beast { /** Measures handler latency on an io_context queue. */ template -class IoLatencyProbe +class IOLatencyProbe { private: using duration = typename Clock::duration; @@ -30,12 +30,12 @@ private: bool cancel_{false}; public: - IoLatencyProbe(duration const& period, boost::asio::io_context& ios) + IOLatencyProbe(duration const& period, boost::asio::io_context& ios) : period_(period), ios_(ios), timer_(ios_) { } - ~IoLatencyProbe() + ~IOLatencyProbe() { std::unique_lock lock(mutex_); cancel(lock, true); @@ -85,7 +85,7 @@ public: { std::scoped_lock const lock(mutex_); if (cancel_) - throw std::logic_error("io_latency_probe is canceled"); + throw std::logic_error("IOLatencyProbe is canceled"); boost::asio::post( ios_, SampleOp(std::forward(handler), Clock::now(), false, this)); } @@ -100,7 +100,7 @@ public: { std::scoped_lock const lock(mutex_); if (cancel_) - throw std::logic_error("io_latency_probe is canceled"); + throw std::logic_error("IOLatencyProbe is canceled"); boost::asio::post( ios_, SampleOp(std::forward(handler), Clock::now(), true, this)); } @@ -140,18 +140,18 @@ private: Handler handler; time_point start; bool repeat; - IoLatencyProbe* probe; + IOLatencyProbe* probe; SampleOp( Handler const& handler, time_point const& start, bool repeat, - IoLatencyProbe* probe) + IOLatencyProbe* probe) : handler(handler), start(start), repeat(repeat), probe(probe) { XRPL_ASSERT( probe, - "beast::io_latency_probe::sample_op::sample_op : non-null " + "beast::IOLatencyProbe::SampleOp::SampleOp : non-null " "probe input"); probe->addref(); } @@ -164,7 +164,7 @@ private: { XRPL_ASSERT( probe, - "beast::io_latency_probe::sample_op::sample_op(sample_op&&) : " + "beast::IOLatencyProbe::SampleOp::SampleOp(SampleOp&&) : " "non-null probe input"); from.probe = nullptr; } diff --git a/include/xrpl/beast/container/detail/aged_unordered_container.h b/include/xrpl/beast/container/detail/aged_unordered_container.h index 78a2a5a32d..7162c237d6 100644 --- a/include/xrpl/beast/container/detail/aged_unordered_container.h +++ b/include/xrpl/beast/container/detail/aged_unordered_container.h @@ -1370,7 +1370,7 @@ private: buck_.resize(size() + additional, cont_); XRPL_ASSERT( loadFactor() <= maxLoadFactor(), - "beast::detail::AgedUnorderedContainer::maybe_rehash : maximum " + "beast::detail::AgedUnorderedContainer::maybeRehash : maximum " "load factor"); } diff --git a/include/xrpl/protocol/AccountID.h b/include/xrpl/protocol/AccountID.h index e22c3b8edd..0b15f651bc 100644 --- a/include/xrpl/protocol/AccountID.h +++ b/include/xrpl/protocol/AccountID.h @@ -25,7 +25,7 @@ public: } // namespace detail /** A 160-bit unsigned that uniquely identifies an account. */ -using AccountID = BaseUint<160, detail::AccountIDTag>; +using AccountID = BaseUInt<160, detail::AccountIDTag>; /** Convert AccountID to base58 checked string */ std::string diff --git a/include/xrpl/protocol/STBitString.h b/include/xrpl/protocol/STBitString.h index efb98cfe27..8a7e5a6030 100644 --- a/include/xrpl/protocol/STBitString.h +++ b/include/xrpl/protocol/STBitString.h @@ -16,7 +16,7 @@ class STBitString final : public STBase, public CountedObject> static_assert(Bits > 0, "Number of bits must be positive"); public: - using value_type = BaseUint; + using value_type = BaseUInt; private: value_type value_{}; @@ -46,7 +46,7 @@ public: template void - setValue(BaseUint const& v); + setValue(BaseUInt const& v); [[nodiscard]] value_type const& value() const; @@ -157,7 +157,7 @@ STBitString::add(Serializer& s) const template template void -STBitString::setValue(BaseUint const& v) +STBitString::setValue(BaseUInt const& v) { value_ = v; } diff --git a/include/xrpl/protocol/STObject.h b/include/xrpl/protocol/STObject.h index a9e46e8717..12a5a5dca4 100644 --- a/include/xrpl/protocol/STObject.h +++ b/include/xrpl/protocol/STObject.h @@ -381,7 +381,7 @@ public: template void - setFieldH160(SField const& field, BaseUint<160, Tag> const& v); + setFieldH160(SField const& field, BaseUInt<160, Tag> const& v); STObject& peekFieldObject(SField const& field); @@ -1143,7 +1143,7 @@ STObject::at(OptionaledField const& of) -> OptionalProxy template void -STObject::setFieldH160(SField const& field, BaseUint<160, Tag> const& v) +STObject::setFieldH160(SField const& field, BaseUInt<160, Tag> const& v) { STBase* rf = getPField(field, true); diff --git a/include/xrpl/protocol/Serializer.h b/include/xrpl/protocol/Serializer.h index 385c09009a..81706e152a 100644 --- a/include/xrpl/protocol/Serializer.h +++ b/include/xrpl/protocol/Serializer.h @@ -102,7 +102,7 @@ public: template int - addBitString(BaseUint const& v) + addBitString(BaseUInt const& v) { return addRaw(v.data(), v.size()); } @@ -151,7 +151,7 @@ public: template bool - getBitString(BaseUint& data, int offset) const + getBitString(BaseUInt& data, int offset) const { auto success = (offset + (Bits / 8)) <= data_.size(); if (success) @@ -369,7 +369,7 @@ public: geti64(); template - BaseUint + BaseUInt getBitString(); uint128 @@ -428,7 +428,7 @@ public: }; template -BaseUint +BaseUInt SerialIter::getBitString() { auto const n = Bits / 8; @@ -442,7 +442,7 @@ SerialIter::getBitString() used_ += n; remain_ -= n; - return BaseUint::fromVoid(x); + return BaseUInt::fromVoid(x); } } // namespace xrpl diff --git a/include/xrpl/protocol/UintTypes.h b/include/xrpl/protocol/UintTypes.h index 6fb0648b5f..322c58ea1f 100644 --- a/include/xrpl/protocol/UintTypes.h +++ b/include/xrpl/protocol/UintTypes.h @@ -30,21 +30,21 @@ public: /** Directory is an index into the directory of offer books. The last 64 bits of this are the quality. */ -using Directory = BaseUint<256, detail::DirectoryTag>; +using Directory = BaseUInt<256, detail::DirectoryTag>; /** Currency is a hash representing a specific currency. */ -using Currency = BaseUint<160, detail::CurrencyTag>; +using Currency = BaseUInt<160, detail::CurrencyTag>; /** NodeID is a 160-bit hash representing one node. */ -using NodeID = BaseUint<160, detail::NodeIDTag>; +using NodeID = BaseUInt<160, detail::NodeIDTag>; /** MPTID is a 192-bit value representing MPT Issuance ID, * which is a concatenation of a 32-bit sequence (big endian) * and a 160-bit account */ -using MPTID = BaseUint<192>; +using MPTID = BaseUInt<192>; /** Domain is a 256-bit hash representing a specific domain. */ -using Domain = BaseUint<256>; +using Domain = BaseUInt<256>; /** XRP currency. */ Currency const& diff --git a/include/xrpl/server/detail/BaseHTTPPeer.h b/include/xrpl/server/detail/BaseHTTPPeer.h index 0260cd6b84..0706482992 100644 --- a/include/xrpl/server/detail/BaseHTTPPeer.h +++ b/include/xrpl/server/detail/BaseHTTPPeer.h @@ -30,7 +30,7 @@ namespace xrpl { /** Represents an active connection. */ template -class BaseHTTPPeer : public IoList::Work, public Session +class BaseHTTPPeer : public IOList::Work, public Session { protected: using clock_type = std::chrono::system_clock; diff --git a/include/xrpl/server/detail/BasePeer.h b/include/xrpl/server/detail/BasePeer.h index 4aec164fe2..3705ef448e 100644 --- a/include/xrpl/server/detail/BasePeer.h +++ b/include/xrpl/server/detail/BasePeer.h @@ -17,7 +17,7 @@ namespace xrpl { // Common part of all peers template -class BasePeer : public IoList::Work +class BasePeer : public IOList::Work { protected: using clock_type = std::chrono::system_clock; diff --git a/include/xrpl/server/detail/Door.h b/include/xrpl/server/detail/Door.h index 811bf68a74..f1a622b173 100644 --- a/include/xrpl/server/detail/Door.h +++ b/include/xrpl/server/detail/Door.h @@ -39,7 +39,7 @@ namespace xrpl { /** A listening socket. */ template -class Door : public IoList::Work, public std::enable_shared_from_this> +class Door : public IOList::Work, public std::enable_shared_from_this> { private: using clock_type = std::chrono::steady_clock; @@ -53,7 +53,7 @@ private: using stream_type = boost::beast::tcp_stream; // Detects SSL on a socket - class Detector : public IoList::Work, public std::enable_shared_from_this + class Detector : public IOList::Work, public std::enable_shared_from_this { private: Port const& port_; diff --git a/include/xrpl/server/detail/ServerImpl.h b/include/xrpl/server/detail/ServerImpl.h index ce3a1c19c7..a6d53fa4d8 100644 --- a/include/xrpl/server/detail/ServerImpl.h +++ b/include/xrpl/server/detail/ServerImpl.h @@ -78,7 +78,7 @@ private: int high_ = 0; std::array hist_{}; - IoList ios_; + IOList ios_; public: ServerImpl(Handler& handler, boost::asio::io_context& ioContext, beast::Journal journal); @@ -97,7 +97,7 @@ public: void close() override; - IoList& + IOList& ios() { return ios_; diff --git a/include/xrpl/server/detail/io_list.h b/include/xrpl/server/detail/io_list.h index a7037b683c..4daa23fb7e 100644 --- a/include/xrpl/server/detail/io_list.h +++ b/include/xrpl/server/detail/io_list.h @@ -12,7 +12,7 @@ namespace xrpl { /** Manages a set of objects performing asynchronous I/O. */ -class IoList final +class IOList final { public: class Work @@ -21,8 +21,8 @@ public: void destroy(); - friend class IoList; - IoList* ios_ = nullptr; + friend class IOList; + IOList* ios_ = nullptr; public: virtual ~Work() @@ -30,13 +30,13 @@ public: destroy(); } - /** Return the IoList associated with the work. + /** Return the IOList associated with the work. Requirements: - The call to IoList::emplace to + The call to IOList::emplace to create the work has already returned. */ - IoList& + IOList& ios() { return *ios_; @@ -59,17 +59,17 @@ private: std::function f_; public: - IoList() = default; + IOList() = default; /** Destroy the list. Effects: - Closes the IoList if it was not previously + Closes the IOList if it was not previously closed. No finisher is invoked in this case. Blocks until all work is destroyed. */ - ~IoList() + ~IOList() { destroy(); } @@ -159,7 +159,7 @@ public: template void -IoList::Work::destroy() +IOList::Work::destroy() { if (!ios_) return; @@ -179,7 +179,7 @@ IoList::Work::destroy() template void -IoList::destroy() +IOList::destroy() { close(); join(); @@ -187,9 +187,9 @@ IoList::destroy() template std::shared_ptr -IoList::emplace(Args&&... args) +IOList::emplace(Args&&... args) { - static_assert(std::is_base_of_v, "T must derive from IoList::Work"); + static_assert(std::is_base_of_v, "T must derive from IOList::Work"); if (closed_) return nullptr; auto sp = std::make_shared(std::forward(args)...); @@ -211,7 +211,7 @@ IoList::emplace(Args&&... args) template void -IoList::close(Finisher&& f) +IOList::close(Finisher&& f) { std::unique_lock lock(m_); if (closed_) @@ -237,7 +237,7 @@ IoList::close(Finisher&& f) template void -IoList::join() +IOList::join() { std::unique_lock lock(m_); cv_.wait(lock, [&] { return closed_ && n_ == 0; }); diff --git a/include/xrpl/shamap/SHAMap.h b/include/xrpl/shamap/SHAMap.h index ba48e1927b..cca800fa40 100644 --- a/include/xrpl/shamap/SHAMap.h +++ b/include/xrpl/shamap/SHAMap.h @@ -624,7 +624,7 @@ private: inline SHAMap::ConstIterator::ConstIterator(SHAMap const* map) : map_(map) { - XRPL_ASSERT(map_, "xrpl::SHAMap::const_iterator::const_iterator : non-null input"); + XRPL_ASSERT(map_, "xrpl::SHAMap::ConstIterator::ConstIterator : non-null input"); if (auto temp = map_->peekFirstItem(stack_)) item_ = temp->peekItem().get(); diff --git a/include/xrpl/shamap/SHAMapItem.h b/include/xrpl/shamap/SHAMapItem.h index d781dbf894..41558197bf 100644 --- a/include/xrpl/shamap/SHAMapItem.h +++ b/include/xrpl/shamap/SHAMapItem.h @@ -139,7 +139,7 @@ inline boost::intrusive_ptr makeShamapitem(uint256 const& tag, Slice data) { XRPL_ASSERT( - data.size() <= megabytes(16), "xrpl::make_shamapitem : maximum input size"); + data.size() <= megabytes(16), "xrpl::makeShamapitem : maximum input size"); // NOLINTNEXTLINE(misc-const-correctness) std::uint8_t* raw = detail::gSlabber.allocate(data.size()); diff --git a/src/libxrpl/basics/Log.cpp b/src/libxrpl/basics/Log.cpp index a629d865b8..ac9eef582a 100644 --- a/src/libxrpl/basics/Log.cpp +++ b/src/libxrpl/basics/Log.cpp @@ -273,7 +273,7 @@ Logs::toString(LogSeverity s) return "Fatal"; // LCOV_EXCL_START default: - UNREACHABLE("xrpl::Logs::to_string : invalid severity"); + UNREACHABLE("xrpl::Logs::toString : invalid severity"); return "Unknown"; // LCOV_EXCL_STOP } diff --git a/src/libxrpl/basics/ResolverAsio.cpp b/src/libxrpl/basics/ResolverAsio.cpp index 4e64c280c7..4a5ceb3d8d 100644 --- a/src/libxrpl/basics/ResolverAsio.cpp +++ b/src/libxrpl/basics/ResolverAsio.cpp @@ -231,7 +231,7 @@ public: void doStop(CompletionCounter) { - XRPL_ASSERT(stop_called == true, "xrpl::ResolverAsioImpl::do_stop : stopping"); + XRPL_ASSERT(stop_called == true, "xrpl::ResolverAsioImpl::doStop : stopping"); if (!stopped.exchange(true)) { @@ -369,7 +369,7 @@ public: void doResolve(std::vector const& names, HandlerType const& handler, CompletionCounter) { - XRPL_ASSERT(!names.empty(), "xrpl::ResolverAsioImpl::do_resolve : names non-empty"); + XRPL_ASSERT(!names.empty(), "xrpl::ResolverAsioImpl::doResolve : names non-empty"); if (!stop_called) { diff --git a/src/libxrpl/beast/clock/basic_seconds_clock.cpp b/src/libxrpl/beast/clock/basic_seconds_clock.cpp index 2c8ac34b6a..886887dd97 100644 --- a/src/libxrpl/beast/clock/basic_seconds_clock.cpp +++ b/src/libxrpl/beast/clock/basic_seconds_clock.cpp @@ -40,7 +40,7 @@ static_assert(std::atomic::is_always_lock_free); SecondsClockThread::~SecondsClockThread() { XRPL_ASSERT( - thread_.joinable(), "beast::seconds_clock_thread::~seconds_clock_thread : thread joinable"); + thread_.joinable(), "beast::SecondsClockThread::~SecondsClockThread : thread joinable"); { std::scoped_lock const lock(mut_); stop_ = true; diff --git a/src/libxrpl/ledger/Dir.cpp b/src/libxrpl/ledger/Dir.cpp index a633257b27..8744d0bc67 100644 --- a/src/libxrpl/ledger/Dir.cpp +++ b/src/libxrpl/ledger/Dir.cpp @@ -54,14 +54,14 @@ const_iterator::operator==(ConstIterator const& other) const XRPL_ASSERT( view_ == other.view_ && root_.key == other.root_.key, - "xrpl::const_iterator::operator== : views and roots are matching"); + "xrpl::Dir::ConstIterator::operator== : views and roots are matching"); return page_.key == other.page_.key && index_ == other.index_; } const_iterator::reference const_iterator::operator*() const { - XRPL_ASSERT(index_ != beast::kZERO, "xrpl::const_iterator::operator* : nonzero index"); + XRPL_ASSERT(index_ != beast::kZERO, "xrpl::Dir::ConstIterator::operator* : nonzero index"); if (!cache_) cache_ = view_->read(keylet::child(index_)); return *cache_; @@ -70,7 +70,7 @@ const_iterator::operator*() const const_iterator& const_iterator::operator++() { - XRPL_ASSERT(index_ != beast::kZERO, "xrpl::const_iterator::operator++ : nonzero index"); + XRPL_ASSERT(index_ != beast::kZERO, "xrpl::Dir::ConstIterator::operator++ : nonzero index"); if (++it_ != std::end(*indexes_)) { index_ = *it_; @@ -84,7 +84,8 @@ const_iterator::operator++() const_iterator const_iterator::operator++(int) { - XRPL_ASSERT(index_ != beast::kZERO, "xrpl::const_iterator::operator++(int) : nonzero index"); + XRPL_ASSERT( + index_ != beast::kZERO, "xrpl::Dir::ConstIterator::operator++(int) : nonzero index"); ConstIterator tmp(*this); ++(*this); return tmp; @@ -103,7 +104,7 @@ const_iterator::nextPage() { page_ = keylet::page(root_, next); sle_ = view_->read(page_); - XRPL_ASSERT(sle_, "xrpl::const_iterator::next_page : non-null SLE"); + XRPL_ASSERT(sle_, "xrpl::Dir::ConstIterator::nextPage : non-null SLE"); indexes_ = &sle_->getFieldV256(sfIndexes); if (indexes_->empty()) { diff --git a/src/libxrpl/protocol/Indexes.cpp b/src/libxrpl/protocol/Indexes.cpp index b37428a6bf..a8ade0de0f 100644 --- a/src/libxrpl/protocol/Indexes.cpp +++ b/src/libxrpl/protocol/Indexes.cpp @@ -287,7 +287,7 @@ quality(Keylet const& k, std::uint64_t q) noexcept Keylet NextT::operator()(Keylet const& k) const { - XRPL_ASSERT(k.type == ltDIR_NODE, "xrpl::keylet::next_t::operator() : valid input type"); + XRPL_ASSERT(k.type == ltDIR_NODE, "xrpl::keylet::NextT::operator() : valid input type"); return {ltDIR_NODE, getQualityNext(k.key)}; } diff --git a/src/libxrpl/protocol/Quality.cpp b/src/libxrpl/protocol/Quality.cpp index d3997cf2db..35a3a3b3a5 100644 --- a/src/libxrpl/protocol/Quality.cpp +++ b/src/libxrpl/protocol/Quality.cpp @@ -62,10 +62,10 @@ ceilInImpl(Amounts const& amount, STAmount const& limit, bool roundUp, Quality c // Clamp out if (result.out > amount.out) result.out = amount.out; - XRPL_ASSERT(result.in == limit, "xrpl::ceil_in_impl : result matches limit"); + XRPL_ASSERT(result.in == limit, "xrpl::ceilInImpl : result matches limit"); return result; } - XRPL_ASSERT(amount.in <= limit, "xrpl::ceil_in_impl : result inside limit"); + XRPL_ASSERT(amount.in <= limit, "xrpl::ceilInImpl : result inside limit"); return amount; } @@ -91,10 +91,10 @@ ceilOutImpl(Amounts const& amount, STAmount const& limit, bool roundUp, Quality // Clamp in if (result.in > amount.in) result.in = amount.in; - XRPL_ASSERT(result.out == limit, "xrpl::ceil_out_impl : result matches limit"); + XRPL_ASSERT(result.out == limit, "xrpl::ceilOutImpl : result matches limit"); return result; } - XRPL_ASSERT(amount.out <= limit, "xrpl::ceil_out_impl : result inside limit"); + XRPL_ASSERT(amount.out <= limit, "xrpl::ceilOutImpl : result inside limit"); return amount; } @@ -114,10 +114,10 @@ Quality composedQuality(Quality const& lhs, Quality const& rhs) { STAmount const lhsRate(lhs.rate()); - XRPL_ASSERT(lhsRate != beast::kZERO, "xrpl::composed_quality : nonzero left input"); + XRPL_ASSERT(lhsRate != beast::kZERO, "xrpl::composedQuality : nonzero left input"); STAmount const rhsRate(rhs.rate()); - XRPL_ASSERT(rhsRate != beast::kZERO, "xrpl::composed_quality : nonzero right input"); + XRPL_ASSERT(rhsRate != beast::kZERO, "xrpl::composedQuality : nonzero right input"); STAmount const rate(mulRound(lhsRate, rhsRate, lhsRate.asset(), true)); @@ -125,7 +125,7 @@ composedQuality(Quality const& lhs, Quality const& rhs) std::uint64_t const storedMantissa(rate.mantissa()); XRPL_ASSERT( - (storedExponent > 0) && (storedExponent <= 255), "xrpl::composed_quality : valid exponent"); + (storedExponent > 0) && (storedExponent <= 255), "xrpl::composedQuality : valid exponent"); return Quality((storedExponent << (64 - 8)) | storedMantissa); } diff --git a/src/libxrpl/server/Port.cpp b/src/libxrpl/server/Port.cpp index ee8492c51e..9a6b6dce35 100644 --- a/src/libxrpl/server/Port.cpp +++ b/src/libxrpl/server/Port.cpp @@ -61,7 +61,7 @@ operator<<(std::ostream& os, Port const& p) if (!p.secure_gateway_nets_v4.empty() || !p.secure_gateway_nets_v6.empty()) { - os << "secureGateway nets:"; + os << "secure_gateway nets:"; for (auto const& net : p.secure_gateway_nets_v4) { os << net.to_string(); diff --git a/src/libxrpl/tx/applySteps.cpp b/src/libxrpl/tx/applySteps.cpp index 7833341808..5f73cbba87 100644 --- a/src/libxrpl/tx/applySteps.cpp +++ b/src/libxrpl/tx/applySteps.cpp @@ -158,7 +158,7 @@ invokePreflight(PreflightContext const& ctx) // Should never happen // LCOV_EXCL_START JLOG(ctx.j.fatal()) << "Unknown transaction type in preflight: " << e.txnType; - UNREACHABLE("xrpl::invoke_preflight : unknown transaction type"); + UNREACHABLE("xrpl::invokePreflight : unknown transaction type"); return {temUNKNOWN, TxConsequences{temUNKNOWN}}; // LCOV_EXCL_STOP } @@ -217,7 +217,7 @@ invokePreclaim(PreclaimContext const& ctx) // Should never happen // LCOV_EXCL_START JLOG(ctx.j.fatal()) << "Unknown transaction type in preclaim: " << e.txnType; - UNREACHABLE("xrpl::invoke_preclaim : unknown transaction type"); + UNREACHABLE("xrpl::invokePreclaim : unknown transaction type"); return temUNKNOWN; // LCOV_EXCL_STOP } @@ -307,7 +307,7 @@ invokeApply(ApplyContext& ctx) // Should never happen // LCOV_EXCL_START JLOG(ctx.journal.fatal()) << "Unknown transaction type in apply: " << e.txnType; - UNREACHABLE("xrpl::invoke_apply : unknown transaction type"); + UNREACHABLE("xrpl::invokeApply : unknown transaction type"); return {temUNKNOWN, false}; // LCOV_EXCL_STOP } diff --git a/src/test/app/MultiSign_test.cpp b/src/test/app/MultiSign_test.cpp index 55e1b73158..a4e972f504 100644 --- a/src/test/app/MultiSign_test.cpp +++ b/src/test/app/MultiSign_test.cpp @@ -1420,8 +1420,8 @@ public: uint8_t tag2[] = "hello world some ascii 32b long"; // including 1 byte for NUL - uint256 bogieTag = xrpl::BaseUint<256>::fromVoid(tag1); - uint256 demonTag = xrpl::BaseUint<256>::fromVoid(tag2); + uint256 bogieTag = xrpl::BaseUInt<256>::fromVoid(tag1); + uint256 demonTag = xrpl::BaseUInt<256>::fromVoid(tag2); // Attach phantom signers to alice and use them for a transaction. env(signers(alice, 1, {{bogie_, 1, bogieTag}, {demon_, 1, demonTag}})); diff --git a/src/test/app/Vault_test.cpp b/src/test/app/Vault_test.cpp index b0b93e0b3f..e8c1a16a70 100644 --- a/src/test/app/Vault_test.cpp +++ b/src/test/app/Vault_test.cpp @@ -206,7 +206,7 @@ class Vault_test : public beast::unit_test::Suite { testcase(prefix + " fail to set domain on public vault"); auto tx = vault.set({.owner = owner, .id = keylet.key}); - tx[sfDomainID] = to_string(BaseUint<256>(42ul)); + tx[sfDomainID] = to_string(BaseUInt<256>(42ul)); env(tx, Ter{tecNO_PERMISSION}); env.close(); } @@ -678,14 +678,14 @@ class Vault_test : public beast::unit_test::Suite env(tx); tx[sfFlags] = tx[sfFlags].asUInt() | tfVaultPrivate; - tx[sfDomainID] = to_string(BaseUint<256>(42ul)); + tx[sfDomainID] = to_string(BaseUInt<256>(42ul)); env(tx, Ter{temDISABLED}); { auto tx = vault.set({.owner = owner, .id = keylet.key}); env(tx, kDATA("Test")); - tx[sfDomainID] = to_string(BaseUint<256>(13ul)); + tx[sfDomainID] = to_string(BaseUInt<256>(13ul)); env(tx, Ter{temDISABLED}); } }, @@ -786,12 +786,12 @@ class Vault_test : public beast::unit_test::Suite testcase("disabled permissioned domain"); auto [tx, keylet] = vault.create({.owner = owner, .asset = xrpIssue()}); - tx[sfDomainID] = to_string(BaseUint<256>(42ul)); + tx[sfDomainID] = to_string(BaseUInt<256>(42ul)); env(tx, Ter{temDISABLED}); { auto tx = vault.set({.owner = owner, .id = keylet.key}); - tx[sfDomainID] = to_string(BaseUint<256>(42ul)); + tx[sfDomainID] = to_string(BaseUInt<256>(42ul)); env(tx, Ter{temDISABLED}); } @@ -1079,7 +1079,7 @@ class Vault_test : public beast::unit_test::Suite { auto tx = tx1; - tx[sfDomainID] = to_string(BaseUint<256>(42ul)); + tx[sfDomainID] = to_string(BaseUInt<256>(42ul)); env(tx, Ter{temMALFORMED}); } @@ -1238,7 +1238,7 @@ class Vault_test : public beast::unit_test::Suite Vault& vault) { auto [tx, keylet] = vault.create({.owner = owner, .asset = asset}); tx[sfFlags] = tfVaultPrivate; - tx[sfDomainID] = to_string(BaseUint<256>(42ul)); + tx[sfDomainID] = to_string(BaseUInt<256>(42ul)); testcase("non-existing domain"); env(tx, Ter{tecOBJECT_NOT_FOUND}); }); @@ -3065,7 +3065,7 @@ class Vault_test : public beast::unit_test::Suite { testcase("private vault cannot set non-existing domain"); auto tx = vault.set({.owner = owner, .id = keylet.key}); - tx[sfDomainID] = to_string(BaseUint<256>(42ul)); + tx[sfDomainID] = to_string(BaseUInt<256>(42ul)); env(tx, Ter{tecOBJECT_NOT_FOUND}); } diff --git a/src/test/basics/base_uint_test.cpp b/src/test/basics/base_uint_test.cpp index cf5ece6240..8d5b56d480 100644 --- a/src/test/basics/base_uint_test.cpp +++ b/src/test/basics/base_uint_test.cpp @@ -49,7 +49,7 @@ struct Nonhash struct base_uint_test : beast::unit_test::Suite { - using test96 = BaseUint<96>; + using test96 = BaseUInt<96>; static_assert(std::is_copy_constructible_v); static_assert(std::is_copy_assignable_v); @@ -68,7 +68,7 @@ struct base_uint_test : beast::unit_test::Suite for (auto const& arg : kTEST_ARGS) { - xrpl::BaseUint<64> const u{arg.first}, v{arg.second}; + xrpl::BaseUInt<64> const u{arg.first}, v{arg.second}; BEAST_EXPECT(u < v); BEAST_EXPECT(u <= v); BEAST_EXPECT(u != v); @@ -99,7 +99,7 @@ struct base_uint_test : beast::unit_test::Suite for (auto const& arg : kTEST_ARGS) { - xrpl::BaseUint<96> const u{arg.first}, v{arg.second}; + xrpl::BaseUInt<96> const u{arg.first}, v{arg.second}; BEAST_EXPECT(u < v); BEAST_EXPECT(u <= v); BEAST_EXPECT(u != v); @@ -327,16 +327,16 @@ struct base_uint_test : beast::unit_test::Suite // Verify that constexpr base_uints interpret a string the same // way parseHex() does. - struct StrBaseUint + struct StrBaseUInt { char const* const str; test96 tst; - constexpr StrBaseUint(char const* s) : str(s), tst(s) + constexpr StrBaseUInt(char const* s) : str(s), tst(s) { } }; - constexpr StrBaseUint kTEST_CASES[] = { + constexpr StrBaseUInt kTEST_CASES[] = { "000000000000000000000000", "000000000000000000000001", "fedcba9876543210ABCDEF91", @@ -344,7 +344,7 @@ struct base_uint_test : beast::unit_test::Suite "800000000000000000000000", "fFfFfFfFfFfFfFfFfFfFfFfF"}; - for (StrBaseUint const& t : kTEST_CASES) + for (StrBaseUInt const& t : kTEST_CASES) { test96 t96; BEAST_EXPECT(t96.parseHex(t.str)); diff --git a/src/test/beast/beast_io_latency_probe_test.cpp b/src/test/beast/beast_io_latency_probe_test.cpp index a884256986..5f183ef091 100644 --- a/src/test/beast/beast_io_latency_probe_test.cpp +++ b/src/test/beast/beast_io_latency_probe_test.cpp @@ -112,7 +112,7 @@ class io_latency_probe_test : public beast::unit_test::Suite, public beast::test struct TestSampler { - beast::IoLatencyProbe probe; + beast::IOLatencyProbe probe; std::vector durations; TestSampler(std::chrono::milliseconds interval, boost::asio::io_context& ios) diff --git a/src/test/protocol/STIssue_test.cpp b/src/test/protocol/STIssue_test.cpp index 04364510f0..1d6d750355 100644 --- a/src/test/protocol/STIssue_test.cpp +++ b/src/test/protocol/STIssue_test.cpp @@ -55,7 +55,7 @@ public: auto const data = "00000000000000000000000055534400000000000000000000000000000000" "000000000000000000"; - BaseUint<320> uint; + BaseUInt<320> uint; (void)uint.parseHex(data); SerialIter iter(Slice(uint.data(), uint.size())); STIssue const stissue(iter, sfAsset); @@ -89,7 +89,7 @@ public: auto const data = "0000000000000000000000005553440000000000ae123a8556f3cf91154711" "376afb0f894f832b3d"; - BaseUint<320> uint; + BaseUInt<320> uint; (void)uint.parseHex(data); SerialIter iter(Slice(uint.data(), uint.size())); STIssue const stissue(iter, sfAsset); @@ -103,7 +103,7 @@ public: try { auto const data = "0000000000000000000000000000000000000000"; - BaseUint<160> uint; + BaseUInt<160> uint; (void)uint.parseHex(data); SerialIter iter(Slice(uint.data(), uint.size())); STIssue const stissue(iter, sfAsset); diff --git a/src/xrpld/app/main/Application.cpp b/src/xrpld/app/main/Application.cpp index 800d398eca..b8975f748b 100644 --- a/src/xrpld/app/main/Application.cpp +++ b/src/xrpld/app/main/Application.cpp @@ -141,16 +141,16 @@ fixConfigPorts(Config& config, Endpoints const& endpoints); class ApplicationImp : public Application, public BasicApp { private: - class IoLatencySampler + class IOLatencySampler { private: beast::insight::Event event_; beast::Journal journal_; - beast::IoLatencyProbe probe_; + beast::IOLatencyProbe probe_; std::atomic lastSample_; public: - IoLatencySampler( + IOLatencySampler( beast::insight::Event ev, beast::Journal journal, std::chrono::milliseconds interval, @@ -272,7 +272,7 @@ public: std::unique_ptr resolver_; - IoLatencySampler io_latency_sampler_; + IOLatencySampler io_latency_sampler_; std::unique_ptr grpcServer_; // NOLINTEND(readability-identifier-naming) diff --git a/src/xrpld/app/main/GRPCServer.cpp b/src/xrpld/app/main/GRPCServer.cpp index 8427d41397..d89735f521 100644 --- a/src/xrpld/app/main/GRPCServer.cpp +++ b/src/xrpld/app/main/GRPCServer.cpp @@ -376,8 +376,8 @@ GRPCServerImpl::GRPCServerImpl(Application& app) if (addr.is_unspecified()) { JLOG(journal_.error()) << "Can't pass unspecified IP in " - << "secureGateway section of port_grpc"; - Throw("Unspecified IP in secureGateway section"); + << "secure_gateway section of port_grpc"; + Throw("Unspecified IP in secure_gateway section"); } secureGatewayIPs_.emplace_back(addr); @@ -386,7 +386,7 @@ GRPCServerImpl::GRPCServerImpl(Application& app) catch (std::exception const&) { JLOG(journal_.error()) << "Error parsing secure gateway IPs for grpc server"; - Throw("Error parsing secureGateway section"); + Throw("Error parsing secure_gateway section"); } } diff --git a/src/xrpld/app/rdb/backend/detail/Node.cpp b/src/xrpld/app/rdb/backend/detail/Node.cpp index 4b8c318be8..0bf6086ead 100644 --- a/src/xrpld/app/rdb/backend/detail/Node.cpp +++ b/src/xrpld/app/rdb/backend/detail/Node.cpp @@ -87,7 +87,7 @@ toString(TableType type) return "AccountTransactions"; // LCOV_EXCL_START default: - UNREACHABLE("xrpl::detail::to_string : invalid TableType"); + UNREACHABLE("xrpl::detail::toString : invalid TableType"); return "Unknown"; // LCOV_EXCL_STOP } diff --git a/src/xrpld/overlay/detail/Handshake.cpp b/src/xrpld/overlay/detail/Handshake.cpp index af0585f8ad..b32d5280e2 100644 --- a/src/xrpld/overlay/detail/Handshake.cpp +++ b/src/xrpld/overlay/detail/Handshake.cpp @@ -132,7 +132,7 @@ makeFeaturesResponseHeader( this topic, see https://github.com/openssl/openssl/issues/5509 and https://github.com/XRPLF/rippled/issues/2413. */ -static std::optional> +static std::optional> hashLastMessage(SSL const* ssl, size_t (*get)(const SSL*, void*, size_t)) { constexpr std::size_t kSSL_MINIMUM_FINISHED_LENGTH = 12; @@ -145,7 +145,7 @@ hashLastMessage(SSL const* ssl, size_t (*get)(const SSL*, void*, size_t)) sha512_hasher const h; - BaseUint<512> cookie; + BaseUInt<512> cookie; SHA512(buf, len, cookie.data()); return cookie; } diff --git a/src/xrpld/overlay/detail/OverlayImpl.cpp b/src/xrpld/overlay/detail/OverlayImpl.cpp index e21d00a1e7..4db379cee5 100644 --- a/src/xrpld/overlay/detail/OverlayImpl.cpp +++ b/src/xrpld/overlay/detail/OverlayImpl.cpp @@ -475,14 +475,14 @@ OverlayImpl::addActive(std::shared_ptr const& peer) { auto const result = peers_.emplace(peer->slot(), peer); - XRPL_ASSERT(result.second, "xrpl::OverlayImpl::add_active : peer is inserted"); + XRPL_ASSERT(result.second, "xrpl::OverlayImpl::addActive : peer is inserted"); (void)result.second; } { auto const result = ids_.emplace( std::piecewise_construct, std::make_tuple(peer->id()), std::make_tuple(peer)); - XRPL_ASSERT(result.second, "xrpl::OverlayImpl::add_active : peer ID is inserted"); + XRPL_ASSERT(result.second, "xrpl::OverlayImpl::addActive : peer ID is inserted"); (void)result.second; } diff --git a/src/xrpld/peerfinder/detail/Bootcache.cpp b/src/xrpld/peerfinder/detail/Bootcache.cpp index 140d0f01c6..b2e5795661 100644 --- a/src/xrpld/peerfinder/detail/Bootcache.cpp +++ b/src/xrpld/peerfinder/detail/Bootcache.cpp @@ -143,7 +143,7 @@ Bootcache::onSuccess(beast::IP::Endpoint const& endpoint) ++entry.valence(); map_.erase(result.first); result = map_.insert(value_type(endpoint, entry)); - XRPL_ASSERT(result.second, "xrpl::PeerFinder::Bootcache::on_success : endpoint inserted"); + XRPL_ASSERT(result.second, "xrpl::PeerFinder::Bootcache::onSuccess : endpoint inserted"); } Entry const& entry(result.first->right); JLOG(journal_.info()) << beast::Leftw(18) << "Bootcache connect " << endpoint << " with " @@ -166,7 +166,7 @@ Bootcache::onFailure(beast::IP::Endpoint const& endpoint) --entry.valence(); map_.erase(result.first); result = map_.insert(value_type(endpoint, entry)); - XRPL_ASSERT(result.second, "xrpl::PeerFinder::Bootcache::on_failure : endpoint inserted"); + XRPL_ASSERT(result.second, "xrpl::PeerFinder::Bootcache::onFailure : endpoint inserted"); } Entry const& entry(result.first->right); auto const n(std::abs(entry.valence())); diff --git a/src/xrpld/peerfinder/detail/Handouts.h b/src/xrpld/peerfinder/detail/Handouts.h index f4c7483e3f..b26a44015d 100644 --- a/src/xrpld/peerfinder/detail/Handouts.h +++ b/src/xrpld/peerfinder/detail/Handouts.h @@ -23,7 +23,7 @@ template std::size_t handoutOne(Target& t, HopContainer& h) { - XRPL_ASSERT(!t.full(), "xrpl::PeerFinder::detail::handout_one : target is not full"); + XRPL_ASSERT(!t.full(), "xrpl::PeerFinder::detail::handoutOne : target is not full"); for (auto it = h.begin(); it != h.end(); ++it) { auto const& e = *it; diff --git a/src/xrpld/peerfinder/detail/Livecache.h b/src/xrpld/peerfinder/detail/Livecache.h index 063fb622cf..3222a13d60 100644 --- a/src/xrpld/peerfinder/detail/Livecache.h +++ b/src/xrpld/peerfinder/detail/Livecache.h @@ -499,7 +499,7 @@ Livecache::HopsT::insert(Element& e) { XRPL_ASSERT( e.endpoint.hops <= Tuning::kMAX_HOPS + 1, - "xrpl::PeerFinder::Livecache::hops_t::insert : maximum input hops"); + "xrpl::PeerFinder::Livecache::HopsT::insert : maximum input hops"); // This has security implications without a shuffle lists_[e.endpoint.hops].push_front(e); ++hist_[e.endpoint.hops]; @@ -511,7 +511,7 @@ Livecache::HopsT::reinsert(Element& e, std::uint32_t numHops) { XRPL_ASSERT( numHops <= Tuning::kMAX_HOPS + 1, - "xrpl::PeerFinder::Livecache::hops_t::reinsert : maximum hops input"); + "xrpl::PeerFinder::Livecache::HopsT::reinsert : maximum hops input"); auto& list = lists_[e.endpoint.hops]; list.erase(list.iterator_to(e)); diff --git a/src/xrpld/peerfinder/detail/Logic.h b/src/xrpld/peerfinder/detail/Logic.h index 89e7336a33..831942d45c 100644 --- a/src/xrpld/peerfinder/detail/Logic.h +++ b/src/xrpld/peerfinder/detail/Logic.h @@ -745,12 +745,12 @@ public: // The object must exist in our table XRPL_ASSERT( slots.contains(slot->remoteEndpoint()), - "xrpl::PeerFinder::Logic::on_endpoints : valid slot input"); + "xrpl::PeerFinder::Logic::onEndpoints : valid slot input"); // Must be handshaked! XRPL_ASSERT( slot->state() == Slot::State::Active, - "xrpl::PeerFinder::Logic::on_endpoints : valid slot state"); + "xrpl::PeerFinder::Logic::onEndpoints : valid slot state"); clock_type::time_point const now(clock.now()); @@ -762,7 +762,7 @@ public: for (auto const& ep : list) { - XRPL_ASSERT(ep.hops, "xrpl::PeerFinder::Logic::on_endpoints : nonzero hops"); + XRPL_ASSERT(ep.hops, "xrpl::PeerFinder::Logic::onEndpoints : nonzero hops"); slot->recent.insert(ep.address, ep.hops);