Kagome
Polkadot Runtime Engine in C++17
kagome::network::StateProtocolObserverImpl Class Reference

#include <state_protocol_observer_impl.hpp>

Inheritance diagram for kagome::network::StateProtocolObserverImpl:
Collaboration diagram for kagome::network::StateProtocolObserverImpl:

Public Types

enum  Error { Error::INVALID_CHILD_ROOTHASH = 1, Error::NOTFOUND_CHILD_ROOTHASH }
 

Public Member Functions

 StateProtocolObserverImpl (std::shared_ptr< blockchain::BlockHeaderRepository > blocks_headers, std::shared_ptr< storage::trie::TrieStorage > storage)
 
 ~StateProtocolObserverImpl () override=default
 
outcome::result< StateResponseonStateRequest (const StateRequest &request) const override
 
- Public Member Functions inherited from kagome::network::StateProtocolObserver
virtual ~StateProtocolObserver ()=default
 

Private Member Functions

outcome::result< std::pair< KeyValueStateEntry, size_t > > getEntry (const storage::trie::RootHash &hash, const common::Buffer &key, size_t limit) const
 

Private Attributes

std::shared_ptr< blockchain::BlockHeaderRepositoryblocks_headers_
 
std::shared_ptr< storage::trie::TrieStoragestorage_
 
log::Logger log_
 

Detailed Description

Definition at line 27 of file state_protocol_observer_impl.hpp.

Member Enumeration Documentation

Enumerator
INVALID_CHILD_ROOTHASH 
NOTFOUND_CHILD_ROOTHASH 

Definition at line 31 of file state_protocol_observer_impl.hpp.

Constructor & Destructor Documentation

kagome::network::StateProtocolObserverImpl::StateProtocolObserverImpl ( std::shared_ptr< blockchain::BlockHeaderRepository blocks_headers,
std::shared_ptr< storage::trie::TrieStorage storage 
)

Definition at line 35 of file state_protocol_observer_impl.cpp.

kagome::network::StateProtocolObserverImpl::~StateProtocolObserverImpl ( )
overridedefault

Member Function Documentation

outcome::result< std::pair< KeyValueStateEntry, size_t > > kagome::network::StateProtocolObserverImpl::getEntry ( const storage::trie::RootHash hash,
const common::Buffer key,
size_t  limit 
) const
private

Definition at line 46 of file state_protocol_observer_impl.cpp.

outcome::result< network::StateResponse > kagome::network::StateProtocolObserverImpl::onStateRequest ( const StateRequest request) const
overridevirtual

Process a state request

Parameters
requestto be processed
Returns
state request or error

Implements kagome::network::StateProtocolObserver.

Definition at line 81 of file state_protocol_observer_impl.cpp.

Member Data Documentation

std::shared_ptr<blockchain::BlockHeaderRepository> kagome::network::StateProtocolObserverImpl::blocks_headers_
private

Definition at line 48 of file state_protocol_observer_impl.hpp.

log::Logger kagome::network::StateProtocolObserverImpl::log_
private

Definition at line 50 of file state_protocol_observer_impl.hpp.

std::shared_ptr<storage::trie::TrieStorage> kagome::network::StateProtocolObserverImpl::storage_
private

Definition at line 49 of file state_protocol_observer_impl.hpp.


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