6 #ifndef KAGOME_BLOCKCHAIN_BLOCKSTORAGEIMPL 7 #define KAGOME_BLOCKCHAIN_BLOCKSTORAGEIMPL 29 static outcome::result<std::shared_ptr<BlockStorageImpl>>
create(
31 const std::shared_ptr<storage::BufferStorage> &storage,
32 const std::shared_ptr<crypto::Hasher> &hasher);
37 std::vector<primitives::BlockHash> leaves)
override;
42 outcome::result<std::optional<primitives::BlockHeader>>
getBlockHeader(
44 outcome::result<std::optional<primitives::BlockBody>>
getBlockBody(
46 outcome::result<std::optional<primitives::BlockData>>
getBlockData(
62 outcome::result<primitives::BlockHash>
putBlock(
80 std::shared_ptr<crypto::Hasher> hasher);
82 std::shared_ptr<storage::BufferStorage>
storage_;
86 mutable std::optional<std::vector<primitives::BlockHash>>
91 #endif // KAGOME_BLOCKCHAIN_BLOCKSTORAGEIMPL
outcome::result< void > putJustification(const primitives::Justification &j, const primitives::BlockHash &hash, primitives::BlockNumber number) override
~BlockStorageImpl() override=default
Block class represents polkadot block primitive.
outcome::result< void > removeBlockData(primitives::BlockNumber block_number, const primitives::BlockDataFlags &remove_flags) override
outcome::result< void > setBlockTreeLeaves(std::vector< primitives::BlockHash > leaves) override
outcome::result< void > removeJustification(const primitives::BlockHash &hash, primitives::BlockNumber number) override
outcome::result< void > putBlockData(primitives::BlockNumber block_number, const primitives::BlockData &block_data) override
BlockStorageImpl(std::shared_ptr< storage::BufferStorage > storage, std::shared_ptr< crypto::Hasher > hasher)
outcome::result< std::optional< primitives::Justification > > getJustification(const primitives::BlockId &block) const override
outcome::result< void > putNumberToIndexKey(const primitives::BlockInfo &block) override
std::shared_ptr< storage::BufferStorage > storage_
std::shared_ptr< soralog::Logger > Logger
outcome::result< std::optional< primitives::BlockData > > getBlockData(const primitives::BlockId &id) const override
static outcome::result< std::shared_ptr< BlockStorageImpl > > create(storage::trie::RootHash state_root, const std::shared_ptr< storage::BufferStorage > &storage, const std::shared_ptr< crypto::Hasher > &hasher)
std::optional< std::vector< primitives::BlockHash > > block_tree_leaves_
outcome::result< primitives::BlockInfo > getLastFinalized() const override
outcome::result< bool > hasBlockHeader(const primitives::BlockId &id) const override
Check if header existing by provided block {.
outcome::result< std::vector< primitives::BlockHash > > getBlockTreeLeaves() const override
outcome::result< std::optional< primitives::BlockHeader > > getBlockHeader(const primitives::BlockId &id) const override
boost::variant< BlockHash, BlockNumber > BlockId
Block id is the variant over BlockHash and BlockNumber.
outcome::result< void > removeBlock(const primitives::BlockInfo &block) override
outcome::result< std::optional< primitives::BlockBody > > getBlockBody(const primitives::BlockId &id) const override
outcome::result< primitives::BlockHash > putBlockHeader(const primitives::BlockHeader &header) override
outcome::result< primitives::BlockHash > putBlock(const primitives::Block &block) override
std::shared_ptr< crypto::Hasher > hasher_