Kagome
Polkadot Runtime Engine in C++17
core.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_RUNTIME_CORE_HPP
7 #define KAGOME_RUNTIME_CORE_HPP
8 
9 #include <vector>
10 
11 #include <optional>
12 #include <outcome/outcome.hpp>
13 
14 #include "primitives/block.hpp"
15 #include "primitives/block_id.hpp"
16 #include "primitives/common.hpp"
18 #include "primitives/version.hpp"
19 
20 namespace kagome::runtime {
21  class RuntimeCodeProvider;
22 
26  class Core {
27  public:
28  virtual ~Core() = default;
29 
34  virtual outcome::result<primitives::Version> version(
35  primitives::BlockHash const &block) = 0;
36 
42  virtual outcome::result<primitives::Version> version() = 0;
43 
48  virtual outcome::result<void> execute_block(
49  const primitives::Block &block) = 0;
50 
55  virtual outcome::result<storage::trie::RootHash> initialize_block(
56  const primitives::BlockHeader &header) = 0;
57  };
58 
59 } // namespace kagome::runtime
60 
61 #endif // KAGOME_RUNTIME_CORE_HPP
Block class represents polkadot block primitive.
Definition: block.hpp:19
virtual outcome::result< storage::trie::RootHash > initialize_block(const primitives::BlockHeader &header)=0
Initialize a block with the given header.
virtual ~Core()=default
virtual outcome::result< void > execute_block(const primitives::Block &block)=0
Executes the given block.
virtual outcome::result< primitives::Version > version()=0
Returns the version of the runtime - version for nested calls, such as in MiscExtension.