hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
tx_presence_cache_utils.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_TX_PRESENCE_CACHE_UTILS_HPP
7 #define IROHA_TX_PRESENCE_CACHE_UTILS_HPP
8 
10 #include "common/visitor.hpp"
11 
12 namespace iroha {
13  namespace ametsuchi {
19  inline bool isAlreadyProcessed(
20  const TxCacheStatusType &tx_status) noexcept {
21  return iroha::visit_in_place(
22  tx_status,
24  return false;
25  },
26  [](const auto &) { return true; });
27  }
28 
35  const TxCacheStatusType &status) noexcept {
36  return iroha::visit_in_place(
37  status, [](const auto &status) { return status.hash; });
38  }
39  } // namespace ametsuchi
40 } // namespace iroha
41 
42 #endif // IROHA_TX_PRESENCE_CACHE_HPP
Definition: hash.hpp:18
Definition: block_query.hpp:16
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
bool isAlreadyProcessed(const TxCacheStatusType &tx_status) noexcept
Definition: tx_presence_cache_utils.hpp:19
Definition: tx_cache_response.hpp:55
tx_cache_response_details::HashType getHash(const TxCacheStatusType &status) noexcept
Definition: tx_presence_cache_utils.hpp:34