Kagome
Polkadot Runtime Engine in C++17
|
#include <chain_api_impl.hpp>
Public Types | |
enum | Error { Error::BLOCK_NOT_FOUND = 1, Error::HEADER_NOT_FOUND } |
Public Types inherited from kagome::api::ChainApi | |
using | BlockNumber = primitives::BlockNumber |
using | BlockHash = kagome::primitives::BlockHash |
using | ValueType = boost::variant< BlockNumber, std::string > |
Public Member Functions | |
~ChainApiImpl () override=default | |
ChainApiImpl (std::shared_ptr< blockchain::BlockHeaderRepository > block_repo, std::shared_ptr< blockchain::BlockTree > block_tree, std::shared_ptr< blockchain::BlockStorage > block_storage) | |
void | setApiService (std::shared_ptr< api::ApiService > const &api_service) override |
outcome::result< BlockHash > | getBlockHash () const override |
outcome::result< BlockHash > | getBlockHash (BlockNumber value) const override |
outcome::result< BlockHash > | getBlockHash (std::string_view value) const override |
outcome::result< std::vector< BlockHash > > | getBlockHash (gsl::span< const ValueType > values) const override |
outcome::result< primitives::BlockHeader > | getHeader (std::string_view hash) override |
outcome::result< primitives::BlockHeader > | getHeader () override |
outcome::result< primitives::BlockData > | getBlock (std::string_view hash) override |
outcome::result< primitives::BlockData > | getBlock () override |
outcome::result< primitives::BlockHash > | getFinalizedHead () const override |
outcome::result< uint32_t > | subscribeFinalizedHeads () override |
outcome::result< void > | unsubscribeFinalizedHeads (uint32_t subscription_id) override |
outcome::result< uint32_t > | subscribeNewHeads () override |
outcome::result< void > | unsubscribeNewHeads (uint32_t subscription_id) override |
Public Member Functions inherited from kagome::api::ChainApi | |
virtual | ~ChainApi ()=default |
Private Attributes | |
std::shared_ptr< blockchain::BlockHeaderRepository > | header_repo_ |
std::shared_ptr< blockchain::BlockTree > | block_tree_ |
std::weak_ptr< api::ApiService > | api_service_ |
std::shared_ptr< blockchain::BlockStorage > | block_storage_ |
Definition at line 18 of file chain_api_impl.hpp.
|
strong |
Enumerator | |
---|---|
BLOCK_NOT_FOUND | |
HEADER_NOT_FOUND |
Definition at line 20 of file chain_api_impl.hpp.
|
overridedefault |
kagome::api::ChainApiImpl::ChainApiImpl | ( | std::shared_ptr< blockchain::BlockHeaderRepository > | block_repo, |
std::shared_ptr< blockchain::BlockTree > | block_tree, | ||
std::shared_ptr< blockchain::BlockStorage > | block_storage | ||
) |
Definition at line 29 of file chain_api_impl.cpp.
|
overridevirtual |
hash | hex-string of a block to retrieve |
Implements kagome::api::ChainApi.
Definition at line 86 of file chain_api_impl.cpp.
|
overridevirtual |
Returns header of a last finalized block.
Implements kagome::api::ChainApi.
Definition at line 94 of file chain_api_impl.cpp.
|
overridevirtual |
Implements kagome::api::ChainApi.
Definition at line 42 of file chain_api_impl.cpp.
|
overridevirtual |
block_number | block number |
Implements kagome::api::ChainApi.
Definition at line 46 of file chain_api_impl.cpp.
|
overridevirtual |
hex_number | hex-encoded block number |
Implements kagome::api::ChainApi.
Definition at line 57 of file chain_api_impl.cpp.
|
overridevirtual |
values | mixed values array either of block number of hex-encoded block number as string |
Implements kagome::api::ChainApi.
Definition at line 67 of file chain_api_impl.cpp.
|
overridevirtual |
Get hash of the last finalized block in the canon chain.
Implements kagome::api::ChainApi.
Definition at line 101 of file chain_api_impl.cpp.
|
inlineoverridevirtual |
hash | hex-string of a block to retrieve |
Implements kagome::api::ChainApi.
Definition at line 44 of file chain_api_impl.hpp.
|
inlineoverridevirtual |
Returns header of a last finalized block.
Implements kagome::api::ChainApi.
Definition at line 50 of file chain_api_impl.hpp.
|
overridevirtual |
Implements kagome::api::ChainApi.
Definition at line 51 of file chain_api_impl.cpp.
|
overridevirtual |
Subscribes to events of Finalized Heads type.
Implements kagome::api::ChainApi.
Definition at line 106 of file chain_api_impl.cpp.
|
overridevirtual |
Subscribes to events of New Heads type
Implements kagome::api::ChainApi.
Definition at line 126 of file chain_api_impl.cpp.
|
overridevirtual |
Unsubscribes from events of Finalized Heads type.
Implements kagome::api::ChainApi.
Definition at line 114 of file chain_api_impl.cpp.
|
overridevirtual |
Unsubscribes from events of New Heads type.
Implements kagome::api::ChainApi.
Definition at line 134 of file chain_api_impl.cpp.
|
private |
Definition at line 72 of file chain_api_impl.hpp.
|
private |
Definition at line 73 of file chain_api_impl.hpp.
|
private |
Definition at line 71 of file chain_api_impl.hpp.
|
private |
Definition at line 70 of file chain_api_impl.hpp.