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 <optional>
10 
12 #include "common/result.hpp"
14 
15 namespace iroha {
16 
17  namespace ametsuchi {
21  class BlockQuery {
22  public:
23  struct GetBlockError {
24  enum class Code {
25  kNoBlock,
27  };
29  std::string message;
30  };
31 
32  using BlockResult =
35 
36  virtual ~BlockQuery() = default;
37 
43  virtual BlockResult getBlock(
45 
51  getTopBlockHeight() = 0;
52 
60  virtual std::optional<TxCacheStatusType> checkTxPresence(
61  const shared_model::crypto::Hash &hash) = 0;
62  };
63  } // namespace ametsuchi
64 } // namespace iroha
65 
66 #endif // IROHA_BLOCK_QUERY_HPP
std::string message
Definition: block_query.hpp:29
uint64_t HeightType
Type of height (for Block, Proposal etc)
Definition: types.hpp:43
Definition: hash.hpp:18
Definition: block_query.hpp:21
Definition: result_fwd.hpp:27
virtual shared_model::interface::types::HeightType getTopBlockHeight()=0
Definition: block_query.hpp:15
hash256_t hash(const T &pb)
Definition: pb_common.hpp:43
virtual BlockResult getBlock(shared_model::interface::types::HeightType height)=0
Definition: block_query.hpp:23
virtual ~BlockQuery()=default
Code code
Definition: block_query.hpp:28
Code
Definition: block_query.hpp:24
virtual std::optional< TxCacheStatusType > checkTxPresence(const shared_model::crypto::Hash &hash)=0