Kagome
Polkadot Runtime Engine in C++17
block_builder.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_RUNTIME_BLOCK_BUILDER_HPP
7 #define KAGOME_RUNTIME_BLOCK_BUILDER_HPP
8 
9 #include <list>
10 
11 #include <outcome/outcome.hpp>
13 #include "primitives/block.hpp"
16 #include "primitives/extrinsic.hpp"
19 
20 namespace kagome::runtime {
24  class BlockBuilder {
25  public:
26  virtual ~BlockBuilder() = default;
27 
31  virtual outcome::result<PersistentResult<primitives::ApplyExtrinsicResult>>
33  storage::trie::RootHash const &storage_hash,
34  const primitives::Extrinsic &extrinsic) = 0;
35 
39  virtual outcome::result<primitives::BlockHeader> finalize_block(
40  const primitives::BlockInfo &block,
41  storage::trie::RootHash const &storage_hash) = 0;
42 
47  virtual outcome::result<std::vector<primitives::Extrinsic>>
49  storage::trie::RootHash const &storage_hash,
50  const primitives::InherentData &data) = 0;
51 
56  virtual outcome::result<primitives::CheckInherentsResult> check_inherents(
57  const primitives::Block &block,
58  const primitives::InherentData &data) = 0;
59 
63  virtual outcome::result<common::Hash256> random_seed(
64  const primitives::BlockHash &block) = 0;
65  };
66 } // namespace kagome::runtime
67 
68 #endif // KAGOME_RUNTIME_BLOCK_BUILDER_HPP
Block class represents polkadot block primitive.
Definition: block.hpp:19
virtual outcome::result< primitives::BlockHeader > finalize_block(const primitives::BlockInfo &block, storage::trie::RootHash const &storage_hash)=0
virtual outcome::result< common::Hash256 > random_seed(const primitives::BlockHash &block)=0
virtual outcome::result< std::vector< primitives::Extrinsic > > inherent_extrinsics(const primitives::BlockInfo &block, storage::trie::RootHash const &storage_hash, const primitives::InherentData &data)=0
virtual outcome::result< primitives::CheckInherentsResult > check_inherents(const primitives::Block &block, const primitives::InherentData &data)=0
virtual ~BlockBuilder()=default
Extrinsic class represents extrinsic.
Definition: extrinsic.hpp:24
virtual outcome::result< PersistentResult< primitives::ApplyExtrinsicResult > > apply_extrinsic(const primitives::BlockInfo &block, storage::trie::RootHash const &storage_hash, const primitives::Extrinsic &extrinsic)=0