Kagome
Polkadot Runtime Engine in C++17
kagome::api::ChildStateApi Class Referenceabstract

#include <child_state_api.hpp>

Inheritance diagram for kagome::api::ChildStateApi:
Collaboration diagram for kagome::api::ChildStateApi:

Public Member Functions

virtual ~ChildStateApi ()=default
 
virtual void setApiService (const std::shared_ptr< api::ApiService > &api_service)=0
 
virtual outcome::result< std::vector< common::Buffer > > getKeys (const common::Buffer &child_storage_key, const std::optional< common::Buffer > &prefix, const std::optional< primitives::BlockHash > &block_hash_opt) const =0
 Warning: This method is UNSAFE. Returns the keys from the specified child storage. The keys can also be filtered based on a prefix. More...
 
virtual outcome::result< std::vector< common::Buffer > > getKeysPaged (const common::Buffer &child_storage_key, const std::optional< common::Buffer > &prefix, uint32_t keys_amount, const std::optional< common::Buffer > &prev_key_opt, const std::optional< primitives::BlockHash > &block_hash_opt) const =0
 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. More...
 
virtual 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 =0
 Returns a child storage entry. More...
 
virtual 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 =0
 Returns the hash of a child storage entry. More...
 
virtual 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 =0
 Returns the size of a child storage entry. More...
 

Detailed Description

Definition at line 20 of file child_state_api.hpp.

Constructor & Destructor Documentation

virtual kagome::api::ChildStateApi::~ChildStateApi ( )
virtualdefault

Member Function Documentation

virtual outcome::result<std::vector<common::Buffer> > kagome::api::ChildStateApi::getKeys ( const common::Buffer child_storage_key,
const std::optional< common::Buffer > &  prefix,
const std::optional< primitives::BlockHash > &  block_hash_opt 
) const
pure virtual

Warning: This method is UNSAFE. Returns the keys from the specified child storage. The keys can also be filtered based on a prefix.

Parameters
child_storage_keyThe child storage key.
prefixThe prefix of the child storage keys to be filtered for. Leave empty ("") to return all child storage keys.
block_hash_opt(OPTIONAL) The block hash indicating the state. NULL implies the current state.
Returns
(OPTIONAL) Storage keys (Array)

Implemented in kagome::api::ChildStateApiImpl.

virtual outcome::result<std::vector<common::Buffer> > kagome::api::ChildStateApi::getKeysPaged ( const common::Buffer child_storage_key,
const std::optional< common::Buffer > &  prefix,
uint32_t  keys_amount,
const std::optional< common::Buffer > &  prev_key_opt,
const std::optional< primitives::BlockHash > &  block_hash_opt 
) const
pure virtual

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.

Parameters
child_storage_keyThe child storage key.
prefixThe prefix of the child storage keys to be filtered for.
keys_amountResult page limit
prev_key_optLast reported key
block_hash_opt(OPTIONAL) The block hash indicating the state. NULL implies the current state.
Returns
(OPTIONAL) Storage keys (Array, up to keys_amount of size)

Implemented in kagome::api::ChildStateApiImpl.

virtual outcome::result<std::optional<common::Buffer> > kagome::api::ChildStateApi::getStorage ( const common::Buffer child_storage_key,
const common::Buffer key,
const std::optional< primitives::BlockHash > &  block_hash_opt 
) const
pure virtual

Returns a child storage entry.

Parameters
child_storage_keyThe child storage key.
keyThe key within the child storage.
block_hash_opt(OPTIONAL) The block hash indicating the state. NULL implies the current state.
Returns
(OPTIONAL) Storage data, if found.

Implemented in kagome::api::ChildStateApiImpl.

virtual outcome::result<std::optional<primitives::BlockHash> > kagome::api::ChildStateApi::getStorageHash ( const common::Buffer child_storage_key,
const common::Buffer key,
const std::optional< primitives::BlockHash > &  block_hash_opt 
) const
pure virtual

Returns the hash of a child storage entry.

Parameters
child_storage_keyThe child storage key.
keyThe key within the child storage.
block_hash_opt(OPTIONAL) The block hash indicating the state. NULL implies the current state.
Returns
(OPTIONAL) The hash of the child storage entry, if found.

Implemented in kagome::api::ChildStateApiImpl.

virtual outcome::result<std::optional<uint64_t> > kagome::api::ChildStateApi::getStorageSize ( const common::Buffer child_storage_key,
const common::Buffer key,
const std::optional< primitives::BlockHash > &  block_hash_opt 
) const
pure virtual

Returns the size of a child storage entry.

Parameters
child_storage_keyThe child storage key.
keyThe key within the child storage.
block_hash_opt(OPTIONAL) The block hash indicating the state. NULL implies the current state.
Returns
(OPTIONAL) The size of the storage entry in bytes, if found.

Implemented in kagome::api::ChildStateApiImpl.

virtual void kagome::api::ChildStateApi::setApiService ( const std::shared_ptr< api::ApiService > &  api_service)
pure virtual

The documentation for this class was generated from the following file: