6 #ifndef KAGOME_BLOCK_TREE_HPP 7 #define KAGOME_BLOCK_TREE_HPP 63 virtual outcome::result<primitives::BlockBody>
getBlockBody(
136 virtual outcome::result<void>
finalize(
200 const std::optional<primitives::BlockNumber> &max_number)
const = 0;
206 virtual std::vector<primitives::BlockHash>
getLeaves()
const = 0;
225 #endif // KAGOME_BLOCK_TREE_HPP virtual bool hasDirectChain(const primitives::BlockHash &ancestor, const primitives::BlockHash &descendant) const =0
virtual BlockHashVecRes getChildren(const primitives::BlockHash &block) const =0
std::vector< Extrinsic > BlockBody
Block class represents polkadot block primitive.
virtual outcome::result< void > addBlockHeader(const primitives::BlockHeader &header)=0
virtual outcome::result< primitives::BlockHeader > getBlockHeader(const primitives::BlockId &block) const =0
virtual outcome::result< primitives::Justification > getBlockJustification(const primitives::BlockId &block) const =0
virtual outcome::result< bool > hasBlockHeader(const primitives::BlockId &block) const =0
virtual outcome::result< primitives::BlockInfo > getBestContaining(const primitives::BlockHash &target_hash, const std::optional< primitives::BlockNumber > &max_number) const =0
Get the most recent block of the best (longest) chain among those that contain a block with...
virtual outcome::result< void > addBlock(const primitives::Block &block)=0
virtual outcome::result< void > addExistingBlock(const primitives::BlockHash &block_hash, const primitives::BlockHeader &block_header)=0
virtual BlockHashVecRes getBestChainFromBlock(const primitives::BlockHash &block, uint64_t maximum) const =0
virtual outcome::result< void > removeLeaf(const primitives::BlockHash &block_hash)=0
outcome::result< std::vector< primitives::BlockHash >> BlockHashVecRes
virtual BlockHashVecRes getChainByBlocks(const primitives::BlockHash &ancestor, const primitives::BlockHash &descendant) const =0
virtual std::vector< primitives::BlockHash > getLeaves() const =0
virtual BlockHashVecRes getDescendingChainToBlock(const primitives::BlockHash &block, uint64_t maximum) const =0
virtual outcome::result< void > addBlockBody(primitives::BlockNumber block_number, const primitives::BlockHash &block_hash, const primitives::BlockBody &block_body)=0
boost::variant< BlockHash, BlockNumber > BlockId
Block id is the variant over BlockHash and BlockNumber.
virtual const primitives::BlockHash & getGenesisBlockHash() const =0
virtual outcome::result< void > finalize(const primitives::BlockHash &block, const primitives::Justification &justification)=0
virtual primitives::BlockInfo deepestLeaf() const =0
virtual ~BlockTree()=default
virtual outcome::result< primitives::BlockBody > getBlockBody(const primitives::BlockId &block) const =0
virtual primitives::BlockInfo getLastFinalized() const =0