Kagome
Polkadot Runtime Engine in C++17
runtime_properties_cache_impl.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_RUNTIME_RUNTIMEPROPERTIESCACHEIMPL
7 #define KAGOME_RUNTIME_RUNTIMEPROPERTIESCACHEIMPL
8 
10 
11 namespace kagome::runtime {
12 
14  public:
15  RuntimePropertiesCacheImpl() = default;
16 
17  outcome::result<primitives::Version> getVersion(
18  const common::Hash256 &hash,
19  std::function<outcome::result<primitives::Version>()> obtainer)
20  override;
21 
22  outcome::result<primitives::OpaqueMetadata> getMetadata(
23  const common::Hash256 &hash,
24  std::function<outcome::result<primitives::OpaqueMetadata>()> obtainer)
25  override;
26 
27  private:
28  std::map<common::Hash256, primitives::Version> cached_versions_;
29  std::map<common::Hash256, primitives::OpaqueMetadata> cached_metadata_;
30  };
31 
32 } // namespace kagome::runtime
33 
34 #endif // KAGOME_RUNTIME_RUNTIMEPROPERTIESCACHEIMPL
std::map< common::Hash256, primitives::Version > cached_versions_
std::map< common::Hash256, primitives::OpaqueMetadata > cached_metadata_
outcome::result< primitives::Version > getVersion(const common::Hash256 &hash, std::function< outcome::result< primitives::Version >()> obtainer) override
outcome::result< primitives::OpaqueMetadata > getMetadata(const common::Hash256 &hash, std::function< outcome::result< primitives::OpaqueMetadata >()> obtainer) override