hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
iroha::ametsuchi::BlockQueryBase Class Referenceabstract

#include "block_query_base.hpp"

Inheritance diagram for iroha::ametsuchi::BlockQueryBase:
Inheritance graph
Collaboration diagram for iroha::ametsuchi::BlockQueryBase:
Collaboration graph

Public Member Functions

 BlockQueryBase (BlockStorage &block_storage, logger::LoggerPtr log)
 
BlockResult getBlock (shared_model::interface::types::HeightType height) override
 
shared_model::interface::types::HeightType getTopBlockHeight () override
 
void reloadBlockstore () override
 
std::optional< TxCacheStatusTypecheckTxPresence (const shared_model::crypto::Hash &hash) override
 
virtual std::optional< int32_t > getTxStatus (const shared_model::crypto::Hash &hash)=0
 
- Public Member Functions inherited from iroha::ametsuchi::BlockQuery
virtual ~BlockQuery ()=default
 

Protected Attributes

BlockStorageblock_storage_
 
logger::LoggerPtr log_
 

Additional Inherited Members

- Public Types inherited from iroha::ametsuchi::BlockQuery
using BlockResult = expected::Result< std::unique_ptr< shared_model::interface::Block >, GetBlockError >
 

Detailed Description

Class which implements BlockQuery.

Constructor & Destructor Documentation

◆ BlockQueryBase()

iroha::ametsuchi::BlockQueryBase::BlockQueryBase ( BlockStorage block_storage,
logger::LoggerPtr  log 
)

Member Function Documentation

◆ checkTxPresence()

std::optional< TxCacheStatusType > iroha::ametsuchi::BlockQueryBase::checkTxPresence ( const shared_model::crypto::Hash hash)
overridevirtual

Synchronously checks whether transaction with given hash is present in any block

Parameters
hash- transaction's hash
Returns
TxCacheStatusType which returns status (Committed, Rejected or Missing) of transaction if storage query was successful, null otherwise

Implements iroha::ametsuchi::BlockQuery.

Here is the call graph for this function:

◆ getBlock()

BlockQuery::BlockResult iroha::ametsuchi::BlockQueryBase::getBlock ( shared_model::interface::types::HeightType  height)
overridevirtual

Retrieve block with given height from block storage

Parameters
height- height of a block to retrieve
Returns
block with given height

Implements iroha::ametsuchi::BlockQuery.

Here is the call graph for this function:

◆ getTopBlockHeight()

shared_model::interface::types::HeightType iroha::ametsuchi::BlockQueryBase::getTopBlockHeight ( )
overridevirtual

Get height of the top block.

Returns
height

Implements iroha::ametsuchi::BlockQuery.

Here is the call graph for this function:

◆ getTxStatus()

virtual std::optional<int32_t> iroha::ametsuchi::BlockQueryBase::getTxStatus ( const shared_model::crypto::Hash hash)
pure virtual

Implemented in iroha::ametsuchi::PostgresBlockQuery, and iroha::ametsuchi::RocksDbBlockQuery.

Here is the caller graph for this function:

◆ reloadBlockstore()

void iroha::ametsuchi::BlockQueryBase::reloadBlockstore ( )
overridevirtual

Reloads blockstore

Implements iroha::ametsuchi::BlockQuery.

Here is the call graph for this function:

Member Data Documentation

◆ block_storage_

BlockStorage& iroha::ametsuchi::BlockQueryBase::block_storage_
protected

◆ log_

logger::LoggerPtr iroha::ametsuchi::BlockQueryBase::log_
protected

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