Kagome
Polkadot Runtime Engine in C++17
host_api_factory_impl.cpp
Go to the documentation of this file.
1 
7 
9 
10 namespace kagome::host_api {
11 
13  const OffchainExtensionConfig &offchain_config,
14  std::shared_ptr<crypto::Sr25519Provider> sr25519_provider,
15  std::shared_ptr<crypto::EcdsaProvider> ecdsa_provider,
16  std::shared_ptr<crypto::Ed25519Provider> ed25519_provider,
17  std::shared_ptr<crypto::Secp256k1Provider> secp256k1_provider,
18  std::shared_ptr<crypto::Hasher> hasher,
19  std::shared_ptr<crypto::CryptoStore> crypto_store,
20  std::shared_ptr<crypto::Bip39Provider> bip39_provider,
21  std::shared_ptr<offchain::OffchainPersistentStorage>
22  offchain_persistent_storage,
23  std::shared_ptr<offchain::OffchainWorkerPool> offchain_worker_pool)
24  : offchain_config_(offchain_config),
25  sr25519_provider_(std::move(sr25519_provider)),
26  ecdsa_provider_(std::move(ecdsa_provider)),
27  ed25519_provider_(std::move(ed25519_provider)),
28  secp256k1_provider_(std::move(secp256k1_provider)),
29  hasher_(std::move(hasher)),
30  crypto_store_(std::move(crypto_store)),
31  bip39_provider_(std::move(bip39_provider)),
32  offchain_persistent_storage_(std::move(offchain_persistent_storage)),
33  offchain_worker_pool_(std::move(offchain_worker_pool)) {
34  BOOST_ASSERT(sr25519_provider_ != nullptr);
35  BOOST_ASSERT(ed25519_provider_ != nullptr);
36  BOOST_ASSERT(secp256k1_provider_ != nullptr);
37  BOOST_ASSERT(hasher_ != nullptr);
38  BOOST_ASSERT(crypto_store_ != nullptr);
39  BOOST_ASSERT(bip39_provider_ != nullptr);
40  BOOST_ASSERT(offchain_persistent_storage_ != nullptr);
41  BOOST_ASSERT(offchain_worker_pool_ != nullptr);
42  }
43 
44  std::unique_ptr<HostApi> HostApiFactoryImpl::make(
45  std::shared_ptr<const runtime::CoreApiFactory> core_provider,
46  std::shared_ptr<const runtime::MemoryProvider> memory_provider,
47  std::shared_ptr<runtime::TrieStorageProvider> storage_provider) const {
48  return std::make_unique<HostApiImpl>(offchain_config_,
49  memory_provider,
50  core_provider,
51  storage_provider,
56  hasher_,
61  }
62 
63 } // namespace kagome::host_api
std::shared_ptr< crypto::Ed25519Provider > ed25519_provider_
std::shared_ptr< crypto::CryptoStore > crypto_store_
std::shared_ptr< offchain::OffchainWorkerPool > offchain_worker_pool_
STL namespace.
std::shared_ptr< crypto::EcdsaProvider > ecdsa_provider_
HostApiFactoryImpl(const OffchainExtensionConfig &offchain_config, std::shared_ptr< crypto::Sr25519Provider > sr25519_provider, std::shared_ptr< crypto::EcdsaProvider > ecdsa_provider, std::shared_ptr< crypto::Ed25519Provider > ed25519_provider, std::shared_ptr< crypto::Secp256k1Provider > secp256k1_provider, std::shared_ptr< crypto::Hasher > hasher, std::shared_ptr< crypto::CryptoStore > crypto_store, std::shared_ptr< crypto::Bip39Provider > bip39_provider, std::shared_ptr< offchain::OffchainPersistentStorage > offchain_persistent_storage, std::shared_ptr< offchain::OffchainWorkerPool > offchain_worker_pool)
std::shared_ptr< crypto::Bip39Provider > bip39_provider_
std::unique_ptr< HostApi > make(std::shared_ptr< const runtime::CoreApiFactory > core_factory, std::shared_ptr< const runtime::MemoryProvider > memory_provider, std::shared_ptr< runtime::TrieStorageProvider > storage_provider) const override
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_