Kagome
Polkadot Runtime Engine in C++17
core.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_RUNTIME_IMPL_CORE_HPP
7 #define KAGOME_RUNTIME_IMPL_CORE_HPP
8 
11 
12 namespace kagome::blockchain {
13  class BlockHeaderRepository;
14 }
15 
16 namespace kagome::runtime {
17 
18  class Executor;
19 
20  class CoreImpl final : public Core {
21  public:
22  CoreImpl(
23  std::shared_ptr<Executor> executor,
24  std::shared_ptr<storage::changes_trie::ChangesTracker> changes_tracker,
25  std::shared_ptr<const blockchain::BlockHeaderRepository> header_repo);
26 
27  outcome::result<primitives::Version> version(
28  primitives::BlockHash const &block) override;
29 
30  outcome::result<primitives::Version> version() override;
31 
32  outcome::result<void> execute_block(
33  const primitives::Block &block) override;
34 
35  outcome::result<storage::trie::RootHash> initialize_block(
36  const primitives::BlockHeader &header) override;
37 
38  private:
39  std::shared_ptr<Executor> executor_;
40  std::shared_ptr<storage::changes_trie::ChangesTracker> changes_tracker_;
41  std::shared_ptr<const blockchain::BlockHeaderRepository> header_repo_;
42  };
43 
44 } // namespace kagome::runtime
45 
46 #endif // KAGOME_RUNTIME_IMPL_CORE_HPP
Block class represents polkadot block primitive.
Definition: block.hpp:19
std::shared_ptr< storage::changes_trie::ChangesTracker > changes_tracker_
Definition: core.hpp:40
std::shared_ptr< Executor > executor_
Definition: core.hpp:39
string version
Definition: conf.py:16
std::shared_ptr< const blockchain::BlockHeaderRepository > header_repo_
Definition: core.hpp:41