From ea7fa12ce679b018b1035d5830941b941758affc Mon Sep 17 00:00:00 2001 From: turuslan Date: Fri, 8 Mar 2024 11:39:42 +0300 Subject: [PATCH] injector default Signed-off-by: turuslan --- core/injector/application_injector.cpp | 7 ------- core/runtime/common/runtime_instances_pool.hpp | 5 +++++ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/core/injector/application_injector.cpp b/core/injector/application_injector.cpp index f7bcbc0253..3b9076342b 100644 --- a/core/injector/application_injector.cpp +++ b/core/injector/application_injector.cpp @@ -216,13 +216,6 @@ #include "transaction_pool/impl/pool_moderator_impl.hpp" #include "transaction_pool/impl/transaction_pool_impl.hpp" -namespace boost::di { - template <> - struct ctor_traits { - BOOST_DI_INJECT_TRAITS(std::shared_ptr); - }; -} // namespace boost::di - namespace { template using sptr = std::shared_ptr; diff --git a/core/runtime/common/runtime_instances_pool.hpp b/core/runtime/common/runtime_instances_pool.hpp index 22170df0fb..e637e11b9f 100644 --- a/core/runtime/common/runtime_instances_pool.hpp +++ b/core/runtime/common/runtime_instances_pool.hpp @@ -13,6 +13,7 @@ #include #include +#include "injector/inject.hpp" #include "runtime/common/stack_limiter.hpp" #include "runtime/module_factory.hpp" #include "utils/lru.hpp" @@ -30,6 +31,10 @@ namespace kagome::runtime { std::shared_ptr module_factory, size_t capacity = DEFAULT_MODULES_CACHE_SIZE); + explicit RuntimeInstancesPoolImpl( + Inject, std::shared_ptr module_factory, ...) + : RuntimeInstancesPoolImpl{std::move(module_factory)} {} + outcome::result> instantiateFromCode( const CodeHash &code_hash, common::BufferView code_zstd,