hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
block_query.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_BLOCK_QUERY_HPP
7 #define IROHA_BLOCK_QUERY_HPP
8 
9 #include <boost/optional.hpp>
11 #include "common/result.hpp"
13 
14 namespace iroha {
15 
16  namespace ametsuchi {
20  class BlockQuery {
21  public:
22  using BlockResult =
23  expected::Result<std::unique_ptr<shared_model::interface::Block>,
24  std::string>;
25 
26  virtual ~BlockQuery() = default;
27 
33  virtual BlockResult getBlock(
35 
41  getTopBlockHeight() = 0;
42 
51  virtual boost::optional<TxCacheStatusType> checkTxPresence(
52  const shared_model::crypto::Hash &hash) = 0;
53  };
54  } // namespace ametsuchi
55 } // namespace iroha
56 
57 #endif // IROHA_BLOCK_QUERY_HPP
uint64_t HeightType
Type of height (for Block, Proposal etc)
Definition: types.hpp:43
Definition: hash.hpp:18
Definition: block_query.hpp:20
virtual shared_model::interface::types::HeightType getTopBlockHeight()=0
Definition: block_query.hpp:14
hash256_t hash(const T &pb)
Definition: pb_common.hpp:43
virtual BlockResult getBlock(shared_model::interface::types::HeightType height)=0
virtual boost::optional< TxCacheStatusType > checkTxPresence(const shared_model::crypto::Hash &hash)=0
virtual ~BlockQuery()=default
expected::Result< std::unique_ptr< shared_model::interface::Block >, std::string > BlockResult
Definition: block_query.hpp:24