Skip to content

Commit

Permalink
injector default
Browse files Browse the repository at this point in the history
Signed-off-by: turuslan <[email protected]>
  • Loading branch information
turuslan committed Mar 8, 2024
1 parent 51e5406 commit ea7fa12
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
7 changes: 0 additions & 7 deletions core/injector/application_injector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<kagome::runtime::RuntimeInstancesPoolImpl> {
BOOST_DI_INJECT_TRAITS(std::shared_ptr<kagome::runtime::ModuleFactory>);
};
} // namespace boost::di

namespace {
template <class T>
using sptr = std::shared_ptr<T>;
Expand Down
5 changes: 5 additions & 0 deletions core/runtime/common/runtime_instances_pool.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <shared_mutex>
#include <unordered_set>

#include "injector/inject.hpp"
#include "runtime/common/stack_limiter.hpp"
#include "runtime/module_factory.hpp"
#include "utils/lru.hpp"
Expand All @@ -30,6 +31,10 @@ namespace kagome::runtime {
std::shared_ptr<ModuleFactory> module_factory,
size_t capacity = DEFAULT_MODULES_CACHE_SIZE);

explicit RuntimeInstancesPoolImpl(
Inject, std::shared_ptr<ModuleFactory> module_factory, ...)
: RuntimeInstancesPoolImpl{std::move(module_factory)} {}

outcome::result<std::shared_ptr<ModuleInstance>> instantiateFromCode(
const CodeHash &code_hash,
common::BufferView code_zstd,
Expand Down

0 comments on commit ea7fa12

Please sign in to comment.