hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
tx_presence_cache_impl.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_TX_PRESENCE_CACHE_IMPL_HPP
7 #define IROHA_TX_PRESENCE_CACHE_IMPL_HPP
8 
9 #include "ametsuchi/storage.hpp"
11 #include "cache/cache.hpp"
12 
13 namespace iroha {
14  namespace ametsuchi {
15 
17  public:
18  explicit TxPresenceCacheImpl(std::shared_ptr<Storage> storage);
19 
20  boost::optional<TxCacheStatusType> check(
21  const shared_model::crypto::Hash &hash) const override;
22 
23  boost::optional<BatchStatusCollectionType> check(
25  const override;
26 
27  private:
34  boost::optional<TxCacheStatusType> checkInStorage(
35  const shared_model::crypto::Hash &hash) const;
36 
37  std::shared_ptr<Storage> storage_;
41  memory_cache_;
42  };
43  } // namespace ametsuchi
44 } // namespace iroha
45 
46 #endif // IROHA_TX_PRESENCE_CACHE_IMPL_HPP
Definition: hash.hpp:18
Definition: tx_presence_cache_impl.hpp:16
Definition: block_query.hpp:16
hash256_t hash(const T &pb)
Definition: pb_common.hpp:43
boost::variant< tx_cache_status_responses::Committed, tx_cache_status_responses::Rejected, tx_cache_status_responses::Missing > TxCacheStatusType
Sum type of all possible concrete responses from the tx cache.
Definition: tx_cache_response.hpp:64
TxPresenceCacheImpl(std::shared_ptr< Storage > storage)
Definition: tx_presence_cache_impl.cpp:15
Definition: transaction_batch.hpp:22
Definition: tx_presence_cache.hpp:30
boost::optional< TxCacheStatusType > check(const shared_model::crypto::Hash &hash) const override
Definition: tx_presence_cache_impl.cpp:18
Definition: cache.hpp:25
Definition: hash.hpp:23