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

#include "postgres_block_query.hpp"

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

Public Member Functions

 PostgresBlockQuery (soci::session &sql, KeyValueStorage &file_store, std::shared_ptr< shared_model::interface::BlockJsonDeserializer > converter, logger::LoggerPtr log)
 
 PostgresBlockQuery (std::unique_ptr< soci::session > sql, KeyValueStorage &file_store, std::shared_ptr< shared_model::interface::BlockJsonDeserializer > converter, logger::LoggerPtr log)
 
BlockResult getBlock (shared_model::interface::types::HeightType height) override
 
shared_model::interface::types::HeightType getTopBlockHeight () override
 
boost::optional< TxCacheStatusTypecheckTxPresence (const shared_model::crypto::Hash &hash) override
 
- Public Member Functions inherited from iroha::ametsuchi::BlockQuery
virtual ~BlockQuery ()=default
 

Additional Inherited Members

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

Detailed Description

Class which implements BlockQuery with a Postgres backend.

Constructor & Destructor Documentation

iroha::ametsuchi::PostgresBlockQuery::PostgresBlockQuery ( soci::session &  sql,
KeyValueStorage file_store,
std::shared_ptr< shared_model::interface::BlockJsonDeserializer converter,
logger::LoggerPtr  log 
)
iroha::ametsuchi::PostgresBlockQuery::PostgresBlockQuery ( std::unique_ptr< soci::session >  sql,
KeyValueStorage file_store,
std::shared_ptr< shared_model::interface::BlockJsonDeserializer converter,
logger::LoggerPtr  log 
)

Member Function Documentation

boost::optional< TxCacheStatusType > iroha::ametsuchi::PostgresBlockQuery::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, boost::none otherwise

Implements iroha::ametsuchi::BlockQuery.

Here is the call graph for this function:

BlockQuery::BlockResult iroha::ametsuchi::PostgresBlockQuery::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:

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

Get height of the top block.

Returns
height

Implements iroha::ametsuchi::BlockQuery.

Here is the call graph for this function:

Here is the caller graph for this function:


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