Kagome
Polkadot Runtime Engine in C++17
module_repository.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_CORE_RUNTIME_IMPL_MODULE_REPOSITORY_HPP
7 #define KAGOME_CORE_RUNTIME_IMPL_MODULE_REPOSITORY_HPP
8 
9 #include <memory>
10 
11 #include <gsl/span>
12 
13 #include "host_api/host_api.hpp"
14 #include "outcome/outcome.hpp"
16 
17 namespace kagome::runtime {
18 
19  class ModuleInstance;
20  class Module;
21  class Memory;
22  class RuntimeCodeProvider;
23 
30  public:
31  virtual ~ModuleRepository() = default;
32 
42  virtual outcome::result<std::shared_ptr<ModuleInstance>> getInstanceAt(
43  std::shared_ptr<const RuntimeCodeProvider> code_provider,
44  const primitives::BlockInfo &block,
45  const primitives::BlockHeader &header) = 0;
46  };
47 
48 } // namespace kagome::runtime
49 
50 #endif // KAGOME_CORE_RUNTIME_IMPL_MODULE_REPOSITORY_HPP
virtual ~ModuleRepository()=default
virtual outcome::result< std::shared_ptr< ModuleInstance > > getInstanceAt(std::shared_ptr< const RuntimeCodeProvider > code_provider, const primitives::BlockInfo &block, const primitives::BlockHeader &header)=0
Returns a module instance for runtime at the.