Kagome
Polkadot Runtime Engine in C++17
offchain_worker_factory_impl.cpp
Go to the documentation of this file.
1 
7 
10 
11 namespace kagome::offchain {
12 
14  const application::AppConfiguration &app_config,
15  std::shared_ptr<clock::SystemClock> clock,
16  std::shared_ptr<crypto::Hasher> hasher,
17  std::shared_ptr<storage::BufferStorage> storage,
18  std::shared_ptr<crypto::CSPRNG> random_generator,
19  std::shared_ptr<api::AuthorApi> author_api,
20  const network::OwnPeerInfo &current_peer_info,
21  std::shared_ptr<offchain::OffchainPersistentStorage> persistent_storage,
22  std::shared_ptr<offchain::OffchainWorkerPool> offchain_worker_pool)
23  : app_config_(app_config),
24  clock_(std::move(clock)),
25  hasher_(std::move(hasher)),
26  storage_(std::move(storage)),
27  random_generator_(std::move(random_generator)),
28  author_api_(std::move(author_api)),
29  current_peer_info_(current_peer_info),
30  persistent_storage_(std::move(persistent_storage)),
31  offchain_worker_pool_(std::move(offchain_worker_pool)) {
32  BOOST_ASSERT(clock_);
33  BOOST_ASSERT(hasher_);
34  BOOST_ASSERT(storage_);
35  BOOST_ASSERT(random_generator_);
36  BOOST_ASSERT(author_api_);
37  BOOST_ASSERT(persistent_storage_);
38  BOOST_ASSERT(offchain_worker_pool_);
39  }
40 
41  std::shared_ptr<OffchainWorker> OffchainWorkerFactoryImpl::make(
42  std::shared_ptr<runtime::Executor> executor,
43  const primitives::BlockHeader &header) {
44  return std::make_shared<OffchainWorkerImpl>(app_config_,
45  clock_,
46  hasher_,
47  storage_,
52  executor,
53  header,
55  }
56 
57 } // namespace kagome::offchain
STL namespace.
std::shared_ptr< offchain::OffchainPersistentStorage > persistent_storage_
OffchainWorkerFactoryImpl(const application::AppConfiguration &app_config, std::shared_ptr< clock::SystemClock > clock, std::shared_ptr< crypto::Hasher > hasher, std::shared_ptr< storage::BufferStorage > storage, std::shared_ptr< crypto::CSPRNG > random_generator, std::shared_ptr< api::AuthorApi > author_api, const network::OwnPeerInfo &current_peer_info, std::shared_ptr< offchain::OffchainPersistentStorage > persistent_storage, std::shared_ptr< offchain::OffchainWorkerPool > offchain_worker_pool)
std::shared_ptr< OffchainWorker > make(std::shared_ptr< runtime::Executor > executor, const primitives::BlockHeader &header) override
std::shared_ptr< offchain::OffchainWorkerPool > offchain_worker_pool_
std::shared_ptr< storage::BufferStorage > storage_
const application::AppConfiguration & app_config_