6 #ifndef KAGOME_CORE_RUNTIME_RUNTIME_ENVIRONMENT_FACTORY_HPP 7 #define KAGOME_CORE_RUNTIME_RUNTIME_ENVIRONMENT_FACTORY_HPP 20 #include "scale/scale.hpp" 39 :
public std::enable_shared_from_this<RuntimeEnvironmentFactory> {
42 PARENT_FACTORY_EXPIRED = 1,
45 FAILED_TO_SET_STORAGE_STATE
50 std::shared_ptr<const runtime::RuntimeCodeProvider> code_provider,
51 std::shared_ptr<ModuleRepository> module_repo,
52 std::shared_ptr<const blockchain::BlockHeaderRepository> header_repo);
66 [[nodiscard]]
virtual std::unique_ptr<RuntimeEnvironmentTemplate> start(
77 [[nodiscard]]
virtual outcome::result<
78 std::unique_ptr<RuntimeEnvironmentTemplate>>
87 [[nodiscard]]
virtual outcome::result<
88 std::unique_ptr<RuntimeEnvironmentTemplate>>
94 std::shared_ptr<const blockchain::BlockHeaderRepository>
header_repo_;
101 std::weak_ptr<const RuntimeEnvironmentFactory> parent_factory_,
109 [[nodiscard]]
virtual outcome::result<std::unique_ptr<RuntimeEnvironment>>
122 bool persistent_{
false};
129 #endif // KAGOME_CORE_RUNTIME_RUNTIME_ENVIRONMENT_FACTORY_HPP primitives::BlockInfo blockchain_state_
OUTCOME_HPP_DECLARE_ERROR(kagome::runtime, RuntimeEnvironmentFactory::Error)
const std::shared_ptr< const MemoryProvider > memory_provider
const std::shared_ptr< TrieStorageProvider > storage_provider
std::weak_ptr< const RuntimeEnvironmentFactory > parent_factory_
std::shared_ptr< soralog::Logger > Logger
RuntimeEnvironment(std::shared_ptr< ModuleInstance > module_instance, std::shared_ptr< const MemoryProvider > memory_provider, std::shared_ptr< TrieStorageProvider > storage_provider, primitives::BlockInfo blockchain_state)
std::shared_ptr< const blockchain::BlockHeaderRepository > header_repo_
std::shared_ptr< const runtime::RuntimeCodeProvider > code_provider_
std::shared_ptr< ModuleRepository > module_repo_
storage::trie::RootHash storage_state_
const std::shared_ptr< ModuleInstance > module_instance
primitives::BlockInfo blockchain_state_