hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
indexer.hpp
Go to the documentation of this file.
1 
6 #ifndef AMETSUCHI_INDEXER_HPP
7 #define AMETSUCHI_INDEXER_HPP
8 
9 #include <string>
10 
11 #include "common/result.hpp"
13 
14 namespace iroha {
15  namespace ametsuchi {
16 
21  class Indexer {
22  public:
23  virtual ~Indexer() = default;
24 
26  struct TxPosition {
29  size_t index;
30  };
31 
33  virtual void committedTxHash(
34  const TxPosition &position,
37  &committed_tx_hash) = 0;
38 
40  virtual void rejectedTxHash(
41  const TxPosition &position,
43  const shared_model::interface::types::HashType &rejected_tx_hash) = 0;
44 
46  virtual void txPositions(
49  boost::optional<shared_model::interface::types::AssetIdType>
50  &&asset_id,
52  TxPosition const &position) = 0;
53 
61  };
62 
63  } // namespace ametsuchi
64 } // namespace iroha
65 
66 #endif /* AMETSUCHI_INDEXER_HPP */
Definition: block_query.hpp:17
uint64_t HeightType
Type of height (for Block, Proposal etc)
Definition: types.hpp:48
Definition: hash.hpp:18
Definition: result_fwd.hpp:27
size_t index
the number of this transaction in the block
Definition: indexer.hpp:29
virtual void rejectedTxHash(const TxPosition &position, shared_model::interface::types::TimestampType const ts, const shared_model::interface::types::HashType &rejected_tx_hash)=0
Store a rejected tx hash.
virtual void committedTxHash(const TxPosition &position, shared_model::interface::types::TimestampType const ts, const shared_model::interface::types::HashType &committed_tx_hash)=0
Store a committed tx hash.
Definition: block_query.hpp:15
std::string AccountIdType
Type of account id.
Definition: types.hpp:38
hash256_t hash(const T &pb)
Definition: pb_common.hpp:43
virtual iroha::expected::Result< void, std::string > flush()=0
virtual void txPositions(shared_model::interface::types::AccountIdType const &creator, shared_model::interface::types::HashType const &hash, boost::optional< shared_model::interface::types::AssetIdType > &&asset_id, shared_model::interface::types::TimestampType const ts, TxPosition const &position)=0
Index tx info.
Position of a transaction in the ledger.
Definition: indexer.hpp:26
shared_model::interface::types::HeightType height
the height of block containing this transaction
Definition: indexer.hpp:28
virtual ~Indexer()=default
Definition: indexer.hpp:21
uint64_t TimestampType
Type of timestamp.
Definition: types.hpp:69