Kagome
Polkadot Runtime Engine in C++17
module_factory_impl.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_CORE_RUNTIME_BINARYEN_MODULE_MODULE_FACTORY_IMPL_HPP
7 #define KAGOME_CORE_RUNTIME_BINARYEN_MODULE_MODULE_FACTORY_IMPL_HPP
8 
10 
11 namespace kagome::runtime {
12  class TrieStorageProvider;
13 }
14 
15 namespace kagome::crypto {
16  class Hasher;
17 }
18 
19 namespace kagome::host_api {
20  class HostApiFactory;
21 }
22 
23 namespace kagome::storage::trie {
24  class TrieStorage;
25 }
26 
27 namespace kagome::blockchain {
28  class BlockHeaderRepository;
29 }
30 
32  class ChangesTracker;
33 }
34 
35 namespace kagome::runtime::binaryen {
36 
37  class InstanceEnvironmentFactory;
38 
39  class ModuleFactoryImpl final : public ModuleFactory {
40  public:
41  ModuleFactoryImpl(std::shared_ptr<InstanceEnvironmentFactory> env_factory,
42  std::shared_ptr<storage::trie::TrieStorage> storage,
43  std::shared_ptr<crypto::Hasher> hasher);
44 
45  outcome::result<std::unique_ptr<Module>> make(
46  gsl::span<const uint8_t> code) const override;
47 
48  private:
49  std::shared_ptr<InstanceEnvironmentFactory> env_factory_;
50  std::shared_ptr<storage::trie::TrieStorage> storage_;
51  std::shared_ptr<crypto::Hasher> hasher_;
52  };
53 
54 } // namespace kagome::runtime::binaryen
55 
56 #endif // KAGOME_CORE_RUNTIME_BINARYEN_MODULE_MODULE_FACTORY_IMPL_HPP
std::shared_ptr< InstanceEnvironmentFactory > env_factory_
std::shared_ptr< storage::trie::TrieStorage > storage_
std::shared_ptr< crypto::Hasher > hasher_