From 61122c43315ff9976eaa109772d9b9cc95418721 Mon Sep 17 00:00:00 2001 From: turuslan Date: Thu, 14 Nov 2024 11:26:42 +0500 Subject: [PATCH] fix build Signed-off-by: turuslan --- core/common/blob.hpp | 16 ++++++++++++---- core/parachain/validator/impl/candidates.hpp | 3 ++- core/parachain/validator/parachain_processor.hpp | 3 ++- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/core/common/blob.hpp b/core/common/blob.hpp index 620d7824c0..87ec763881 100644 --- a/core/common/blob.hpp +++ b/core/common/blob.hpp @@ -14,6 +14,7 @@ #include "common/buffer_view.hpp" #include "common/hexutil.hpp" +#include "common/span_adl.hpp" #include "macro/endianness_utils.hpp" #define KAGOME_BLOB_STRICT_TYPEDEF(space_name, class_name, blob_size) \ @@ -89,8 +90,8 @@ struct fmt::formatter \ : fmt::formatter { \ template \ - auto format(const space_name::class_name &blob, \ - FormatCtx &ctx) const -> decltype(ctx.out()) { \ + auto format(const space_name::class_name &blob, FormatCtx &ctx) const \ + -> decltype(ctx.out()) { \ return fmt::formatter::format(blob, ctx); \ } \ }; @@ -211,6 +212,13 @@ namespace kagome::common { std::ranges::copy(span, blob.begin()); return blob; } + + auto operator<=>(const Blob &other) const { + return SpanAdl{*this} <=> other; + } + bool operator==(const Blob &other) const { + return SpanAdl{*this} == other; + } }; // extern specification of the most frequently instantiated blob @@ -269,8 +277,8 @@ struct fmt::formatter> { // Formats the Blob using the parsed format specification (presentation) // stored in this formatter. template - auto format(const kagome::common::Blob &blob, - FormatContext &ctx) const -> decltype(ctx.out()) { + auto format(const kagome::common::Blob &blob, FormatContext &ctx) const + -> decltype(ctx.out()) { if (presentation == 's') { if constexpr (N > 4) { uint16_t head = static_cast(blob[1]) diff --git a/core/parachain/validator/impl/candidates.hpp b/core/parachain/validator/impl/candidates.hpp index 3411e34af6..001fc89adb 100644 --- a/core/parachain/validator/impl/candidates.hpp +++ b/core/parachain/validator/impl/candidates.hpp @@ -519,7 +519,8 @@ namespace kagome::parachain { }; retain_if(candidates, [&](auto &pair) { - auto &[c_hash, state] = pair; + auto &[_c_hash, state] = pair; + auto &c_hash = _c_hash; return visit_in_place( state, [&](ConfirmedCandidate &c) { diff --git a/core/parachain/validator/parachain_processor.hpp b/core/parachain/validator/parachain_processor.hpp index 03fdc5a9fe..8ad5cc8fee 100644 --- a/core/parachain/validator/parachain_processor.hpp +++ b/core/parachain/validator/parachain_processor.hpp @@ -99,7 +99,8 @@ namespace kagome::parachain { BlockedCollationId(ParachainId pid, const Hash &h) : para_id(pid), parent_head_data_hash(h) {} - constexpr auto operator<=>(const BlockedCollationId &) const = default; + auto operator<=>(const BlockedCollationId &) const = default; + bool operator==(const BlockedCollationId &) const = default; }; } // namespace kagome::parachain