15 #include "scale/scale.hpp" 25 std::shared_ptr<storage::BufferStorage> map,
26 std::shared_ptr<crypto::Hasher> hasher)
27 : map_{std::move(map)},
hasher_{std::move(hasher)} {
43 OUTCOME_TRY(enc_header, scale::encode(header));
44 return hasher_->blake2b_256(enc_header);
47 outcome::result<primitives::BlockHeader>
50 if (header_opt.has_value()) {
51 return scale::decode<primitives::BlockHeader>(header_opt.value());
outcome::result< primitives::BlockNumber > lookupKeyToNumber(const common::BufferView &key)
outcome::result< std::optional< common::Buffer > > idToLookupKey(const ReadableBufferStorage &map, const primitives::BlockId &id)
outcome::result< std::optional< common::Buffer > > getWithPrefix(const storage::BufferStorage &map, prefix::Prefix prefix, const primitives::BlockId &block_id)
boost::variant< BlockHash, BlockNumber > BlockId
Block id is the variant over BlockHash and BlockNumber.