Kagome
Polkadot Runtime Engine in C++17
offchain_worker_api.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_RUNTIME_OFFCHAINWORKERAPIIMPL
7 #define KAGOME_RUNTIME_OFFCHAINWORKERAPIIMPL
8 
10 
11 namespace kagome::application {
12  class AppConfiguration;
13 }
14 namespace kagome::offchain {
15  class OffchainWorkerFactory;
16 }
17 
18 namespace kagome::runtime {
19 
20  class Executor;
21 
23  : public OffchainWorkerApi,
24  std::enable_shared_from_this<OffchainWorkerApiImpl> {
25  public:
27  const application::AppConfiguration &app_config,
28  std::shared_ptr<offchain::OffchainWorkerFactory> ocw_factory,
29  std::shared_ptr<Executor> executor);
30 
31  outcome::result<void> offchain_worker(
32  const primitives::BlockHash &block,
33  const primitives::BlockHeader &header) override;
34 
35  private:
37  std::shared_ptr<offchain::OffchainWorkerFactory> ocw_factory_;
38  std::shared_ptr<Executor> executor_;
39  };
40 
41 } // namespace kagome::runtime
42 
43 #endif // KAGOME_RUNTIME_OFFCHAINWORKERAPIIMPL
std::shared_ptr< offchain::OffchainWorkerFactory > ocw_factory_
const application::AppConfiguration & app_config_