hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
postgres_indexer.hpp
Go to the documentation of this file.
1 
6 #ifndef AMETSUCHI_POSTGRES_INDEXER_HPP
7 #define AMETSUCHI_POSTGRES_INDEXER_HPP
8 
9 #include "ametsuchi/indexer.hpp"
10 
11 namespace soci {
12  class session;
13 }
14 
15 namespace iroha {
16  namespace ametsuchi {
17 
18  class PostgresIndexer : public Indexer {
19  public:
20  PostgresIndexer(soci::session &sql);
21 
22  void txHashPosition(const shared_model::interface::types::HashType &hash,
23  TxPosition position) override;
24 
25  void committedTxHash(const shared_model::interface::types::HashType
26  &committed_tx_hash) override;
27 
28  void rejectedTxHash(const shared_model::interface::types::HashType
29  &rejected_tx_hash) override;
30 
31  void txPositionByCreator(
33  TxPosition position) override;
34 
35  void accountAssetTxPosition(
38  TxPosition position) override;
39 
40  iroha::expected::Result<void, std::string> flush() override;
41 
42  private:
44  void txHashStatus(
45  const shared_model::interface::types::HashType &rejected_tx_hash,
46  bool is_committed);
47 
48  soci::session &sql_;
49  std::string statements_;
50  };
51 
52  } // namespace ametsuchi
53 } // namespace iroha
54 
55 #endif /* AMETSUCHI_POSTGRES_INDEXER_HPP */
Definition: hash.hpp:18
Definition: block_query.hpp:14
std::string AccountIdType
Type of account id.
Definition: types.hpp:39
hash256_t hash(const T &pb)
Definition: pb_common.hpp:43
Position of a transaction in the ledger.
Definition: indexer.hpp:26
Definition: postgres_indexer.hpp:18
Definition: pool_wrapper.hpp:11
Definition: indexer.hpp:21
std::string AssetIdType
Type of asset id.
Definition: types.hpp:55