Kagome
Polkadot Runtime Engine in C++17
host_api_factory_impl.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_CORE_EXTENSIONS_IMPL_HOST_API_FACTORY_IMPL_HPP
7 #define KAGOME_CORE_EXTENSIONS_IMPL_HOST_API_FACTORY_IMPL_HPP
8 
10 
12 #include "crypto/crypto_store.hpp"
15 #include "crypto/hasher.hpp"
19 
20 namespace kagome::offchain {
22  class OffchainWorkerPool;
23 } // namespace kagome::offchain
24 
25 namespace kagome::host_api {
26 
27  class HostApiFactoryImpl final : public HostApiFactory {
28  public:
29  ~HostApiFactoryImpl() override = default;
30 
32  const OffchainExtensionConfig &offchain_config,
33  std::shared_ptr<crypto::Sr25519Provider> sr25519_provider,
34  std::shared_ptr<crypto::EcdsaProvider> ecdsa_provider,
35  std::shared_ptr<crypto::Ed25519Provider> ed25519_provider,
36  std::shared_ptr<crypto::Secp256k1Provider> secp256k1_provider,
37  std::shared_ptr<crypto::Hasher> hasher,
38  std::shared_ptr<crypto::CryptoStore> crypto_store,
39  std::shared_ptr<crypto::Bip39Provider> bip39_provider,
40  std::shared_ptr<offchain::OffchainPersistentStorage>
41  offchain_persistent_storage,
42  std::shared_ptr<offchain::OffchainWorkerPool> offchain_worker_pool);
43 
44  std::unique_ptr<HostApi> make(
45  std::shared_ptr<const runtime::CoreApiFactory> core_factory,
46  std::shared_ptr<const runtime::MemoryProvider> memory_provider,
47  std::shared_ptr<runtime::TrieStorageProvider> storage_provider)
48  const override;
49 
50  private:
52  std::shared_ptr<crypto::Sr25519Provider> sr25519_provider_;
53  std::shared_ptr<crypto::EcdsaProvider> ecdsa_provider_;
54  std::shared_ptr<crypto::Ed25519Provider> ed25519_provider_;
55  std::shared_ptr<crypto::Secp256k1Provider> secp256k1_provider_;
56  std::shared_ptr<crypto::Hasher> hasher_;
57  std::shared_ptr<crypto::CryptoStore> crypto_store_;
58  std::shared_ptr<crypto::Bip39Provider> bip39_provider_;
59  std::shared_ptr<offchain::OffchainPersistentStorage>
61  std::shared_ptr<offchain::OffchainWorkerPool> offchain_worker_pool_;
62  };
63 
64 } // namespace kagome::host_api
65 
66 #endif // KAGOME_CORE_EXTENSIONS_IMPL_HOST_API_FACTORY_IMPL_HPP
std::shared_ptr< crypto::Ed25519Provider > ed25519_provider_
std::shared_ptr< crypto::CryptoStore > crypto_store_
std::shared_ptr< offchain::OffchainWorkerPool > offchain_worker_pool_
It is non-revertible and not fork-aware. It means that any value set by the offchain worker is persis...
std::shared_ptr< crypto::EcdsaProvider > ecdsa_provider_
std::shared_ptr< crypto::Bip39Provider > bip39_provider_
std::shared_ptr< offchain::OffchainPersistentStorage > offchain_persistent_storage_
std::shared_ptr< crypto::Hasher > hasher_
std::shared_ptr< crypto::Sr25519Provider > sr25519_provider_
std::shared_ptr< crypto::Secp256k1Provider > secp256k1_provider_