Skip to content

Commit

Permalink
fix: make CandidateReceipt custom decomposable
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitriy Khaustov aka xDimon <[email protected]>
  • Loading branch information
xDimon committed Feb 20, 2025
1 parent 1c7feca commit 28d3219
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 23 deletions.
6 changes: 4 additions & 2 deletions core/parachain/types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,6 @@ namespace kagome::network {
struct CandidateReceipt {
CandidateDescriptor descriptor; /// Candidate descriptor
parachain::Hash commitments_hash; /// Hash of candidate commitments
mutable std::optional<parachain::Hash> hash_{};

const parachain::Hash &hash(const crypto::Hasher &hasher) const {
if (not hash_.has_value()) {
hash_.emplace(hasher.blake2b_256(
Expand All @@ -192,6 +190,10 @@ namespace kagome::network {
}

CUSTOM_EQUALITY(CandidateReceipt, descriptor, commitments_hash);
SCALE_CUSTOM_DECOMPOSITION(CandidateReceipt, descriptor, commitments_hash)

private:
mutable std::optional<parachain::Hash> hash_{};
};

struct CommittedCandidateReceipt {
Expand Down
21 changes: 0 additions & 21 deletions core/scale/encoder/concepts.hpp

This file was deleted.

0 comments on commit 28d3219

Please sign in to comment.