6 #ifndef KAGOME_CHILD_STATE_API_IMPL_HPP 7 #define KAGOME_CHILD_STATE_API_IMPL_HPP 21 std::shared_ptr<blockchain::BlockHeaderRepository> block_repo,
22 std::shared_ptr<const storage::trie::TrieStorage> trie_storage,
23 std::shared_ptr<blockchain::BlockTree> block_tree,
24 std::shared_ptr<runtime::Core> runtime_core,
25 std::shared_ptr<runtime::Metadata> metadata);
28 const std::shared_ptr<api::ApiService> &api_service)
override;
30 outcome::result<std::vector<common::Buffer>>
getKeys(
32 const std::optional<common::Buffer> &prefix_opt,
33 const std::optional<primitives::BlockHash> &block_hash_opt)
36 outcome::result<std::vector<common::Buffer>>
getKeysPaged(
38 const std::optional<common::Buffer> &prefix_opt,
40 const std::optional<common::Buffer> &prev_key_opt,
41 const std::optional<primitives::BlockHash> &block_hash_opt)
44 outcome::result<std::optional<common::Buffer>>
getStorage(
47 const std::optional<primitives::BlockHash> &block_hash_opt)
50 outcome::result<std::optional<primitives::BlockHash>>
getStorageHash(
53 const std::optional<primitives::BlockHash> &block_hash_opt)
59 const std::optional<primitives::BlockHash> &block_hash_opt)
64 std::shared_ptr<const storage::trie::TrieStorage>
storage_;
74 #endif // KAGOME_CHILD_STATE_API_IMPL_HPP Class represents arbitrary (including empty) byte buffer.
std::shared_ptr< blockchain::BlockTree > block_tree_
std::weak_ptr< api::ApiService > api_service_
outcome::result< std::optional< common::Buffer > > getStorage(const common::Buffer &child_storage_key, const common::Buffer &key, const std::optional< primitives::BlockHash > &block_hash_opt) const override
Returns a child storage entry.
std::shared_ptr< blockchain::BlockHeaderRepository > header_repo_
std::shared_ptr< runtime::Metadata > metadata_
ChildStateApiImpl(std::shared_ptr< blockchain::BlockHeaderRepository > block_repo, std::shared_ptr< const storage::trie::TrieStorage > trie_storage, std::shared_ptr< blockchain::BlockTree > block_tree, std::shared_ptr< runtime::Core > runtime_core, std::shared_ptr< runtime::Metadata > metadata)
std::shared_ptr< const storage::trie::TrieStorage > storage_
std::shared_ptr< runtime::Core > runtime_core_
outcome::result< std::vector< common::Buffer > > getKeysPaged(const common::Buffer &child_storage_key, const std::optional< common::Buffer > &prefix_opt, uint32_t keys_amount, const std::optional< common::Buffer > &prev_key_opt, const std::optional< primitives::BlockHash > &block_hash_opt) const override
Warning: This method is UNSAFE. Returns the keys from the specified child storage. Paginated version of getKeys. The keys can also be filtered based on a prefix.
outcome::result< std::vector< common::Buffer > > getKeys(const common::Buffer &child_storage_key, const std::optional< common::Buffer > &prefix_opt, const std::optional< primitives::BlockHash > &block_hash_opt) const override
Warning: This method is UNSAFE. Returns the keys from the specified child storage. The keys can also be filtered based on a prefix.
void setApiService(const std::shared_ptr< api::ApiService > &api_service) override
outcome::result< std::optional< primitives::BlockHash > > getStorageHash(const common::Buffer &child_storage_key, const common::Buffer &key, const std::optional< primitives::BlockHash > &block_hash_opt) const override
Returns the hash of a child storage entry.
outcome::result< std::optional< uint64_t > > getStorageSize(const common::Buffer &child_storage_key, const common::Buffer &key, const std::optional< primitives::BlockHash > &block_hash_opt) const override
Returns the size of a child storage entry.