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

#include "block_query.hpp"

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

Classes

struct  GetBlockError
 

Public Types

using BlockResult = expected::Result< std::unique_ptr< shared_model::interface::Block >, GetBlockError >
 

Public Member Functions

virtual ~BlockQuery ()=default
 
virtual BlockResult getBlock (shared_model::interface::types::HeightType height)=0
 
virtual shared_model::interface::types::HeightType getTopBlockHeight ()=0
 
virtual void reloadBlockstore ()=0
 
virtual std::optional< TxCacheStatusTypecheckTxPresence (const shared_model::crypto::Hash &hash)=0
 

Detailed Description

Public interface for queries on blocks and transactions

Member Typedef Documentation

◆ BlockResult

Constructor & Destructor Documentation

◆ ~BlockQuery()

virtual iroha::ametsuchi::BlockQuery::~BlockQuery ( )
virtualdefault

Member Function Documentation

◆ checkTxPresence()

virtual std::optional<TxCacheStatusType> iroha::ametsuchi::BlockQuery::checkTxPresence ( const shared_model::crypto::Hash hash)
pure virtual

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

Implemented in iroha::ametsuchi::BlockQueryBase.

◆ getBlock()

virtual BlockResult iroha::ametsuchi::BlockQuery::getBlock ( shared_model::interface::types::HeightType  height)
pure virtual

Retrieve block with given height from block storage

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

Implemented in iroha::ametsuchi::BlockQueryBase.

◆ getTopBlockHeight()

virtual shared_model::interface::types::HeightType iroha::ametsuchi::BlockQuery::getTopBlockHeight ( )
pure virtual

Get height of the top block.

Returns
height

Implemented in iroha::ametsuchi::BlockQueryBase.

Here is the caller graph for this function:

◆ reloadBlockstore()

virtual void iroha::ametsuchi::BlockQuery::reloadBlockstore ( )
pure virtual

Reloads blockstore

Implemented in iroha::ametsuchi::BlockQueryBase.


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