6 #ifndef KAGOME_BLOCK_STORAGE_HPP 7 #define KAGOME_BLOCK_STORAGE_HPP 28 virtual outcome::result<std::vector<primitives::BlockHash>>
36 std::vector<primitives::BlockHash> leaves) = 0;
46 virtual outcome::result<std::optional<primitives::BlockHeader>>
53 virtual outcome::result<std::optional<primitives::BlockBody>>
getBlockBody(
60 virtual outcome::result<std::optional<primitives::BlockData>>
getBlockData(
67 virtual outcome::result<std::optional<primitives::Justification>>
104 virtual outcome::result<primitives::BlockHash>
putBlock(
129 virtual outcome::result<primitives::BlockInfo>
getLastFinalized()
const = 0;
141 #endif // KAGOME_BLOCK_STORAGE_HPP virtual outcome::result< void > removeBlockData(primitives::BlockNumber block_number, const primitives::BlockDataFlags &remove_flags)=0
virtual outcome::result< std::optional< primitives::BlockBody > > getBlockBody(const primitives::BlockId &id) const =0
virtual outcome::result< void > setBlockTreeLeaves(std::vector< primitives::BlockHash > leaves)=0
virtual outcome::result< void > removeBlock(const primitives::BlockInfo &block)=0
Block class represents polkadot block primitive.
virtual outcome::result< void > putJustification(const primitives::Justification &justification, const primitives::BlockHash &hash, primitives::BlockNumber number)=0
virtual outcome::result< void > removeJustification(const primitives::BlockHash &hash, primitives::BlockNumber number)=0
virtual outcome::result< std::optional< primitives::Justification > > getJustification(const primitives::BlockId &block) const =0
virtual outcome::result< std::vector< primitives::BlockHash > > getBlockTreeLeaves() const =0
virtual outcome::result< std::optional< primitives::BlockData > > getBlockData(const primitives::BlockId &id) const =0
virtual outcome::result< void > putNumberToIndexKey(const primitives::BlockInfo &block)=0
virtual outcome::result< primitives::BlockInfo > getLastFinalized() const =0
virtual outcome::result< bool > hasBlockHeader(const primitives::BlockId &id) const =0
Check if header existing by provided block {.
virtual outcome::result< primitives::BlockHash > putBlock(const primitives::Block &block)=0
virtual outcome::result< primitives::BlockHash > putBlockHeader(const primitives::BlockHeader &header)=0
virtual outcome::result< void > putBlockData(primitives::BlockNumber, const primitives::BlockData &block_data)=0
virtual outcome::result< std::optional< primitives::BlockHeader > > getBlockHeader(const primitives::BlockId &id) const =0
boost::variant< BlockHash, BlockNumber > BlockId
Block id is the variant over BlockHash and BlockNumber.
virtual ~BlockStorage()=default