Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
Signed-off-by: turuslan <[email protected]>
  • Loading branch information
turuslan committed Nov 14, 2024
1 parent b57dbc9 commit 61122c4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
16 changes: 12 additions & 4 deletions core/common/blob.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down Expand Up @@ -89,8 +90,8 @@
struct fmt::formatter<space_name::class_name> \
: fmt::formatter<space_name::class_name::Base> { \
template <typename FormatCtx> \
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<space_name::class_name::Base>::format(blob, ctx); \
} \
};
Expand Down Expand Up @@ -211,6 +212,13 @@ namespace kagome::common {
std::ranges::copy(span, blob.begin());
return blob;
}

auto operator<=>(const Blob<size_> &other) const {
return SpanAdl{*this} <=> other;
}
bool operator==(const Blob<size_> &other) const {
return SpanAdl{*this} == other;
}
};

// extern specification of the most frequently instantiated blob
Expand Down Expand Up @@ -269,8 +277,8 @@ struct fmt::formatter<kagome::common::Blob<N>> {
// Formats the Blob using the parsed format specification (presentation)
// stored in this formatter.
template <typename FormatContext>
auto format(const kagome::common::Blob<N> &blob,
FormatContext &ctx) const -> decltype(ctx.out()) {
auto format(const kagome::common::Blob<N> &blob, FormatContext &ctx) const
-> decltype(ctx.out()) {
if (presentation == 's') {
if constexpr (N > 4) {
uint16_t head = static_cast<uint16_t>(blob[1])
Expand Down
3 changes: 2 additions & 1 deletion core/parachain/validator/impl/candidates.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
3 changes: 2 additions & 1 deletion core/parachain/validator/parachain_processor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 61122c4

Please sign in to comment.