OpenCBDC Transaction Processor
Loading...
Searching...
No Matches
status_interface.hpp
Go to the documentation of this file.
1// Copyright (c) 2021 MIT Digital Currency Initiative,
2// Federal Reserve Bank of Boston
3// Distributed under the MIT software license, see the accompanying
4// file COPYING or http://www.opensource.org/licenses/mit-license.php.
5
6#ifndef OPENCBDC_TX_SRC_LOCKING_SHARD_STATUS_INTERFACE_H_
7#define OPENCBDC_TX_SRC_LOCKING_SHARD_STATUS_INTERFACE_H_
8
10
11#include <optional>
12#include <variant>
13
14namespace cbdc::locking_shard {
19 public:
20 status_interface() = default;
21 virtual ~status_interface() = default;
23 auto operator=(const status_interface&) -> status_interface& = default;
26
31 [[nodiscard]] virtual auto check_unspent(const hash_t& uhs_id)
32 -> std::optional<bool> = 0;
33
39 [[nodiscard]] virtual auto check_tx_id(const hash_t& tx_id)
40 -> std::optional<bool> = 0;
41 };
42}
43
44#endif
Interface for querying the read-only state of a locking shard.
status_interface(status_interface &&)=default
virtual auto check_unspent(const hash_t &uhs_id) -> std::optional< bool >=0
Queries whether the shard's UHS contains the given UHS ID.
auto operator=(const status_interface &) -> status_interface &=default
status_interface(const status_interface &)=default
auto operator=(status_interface &&) -> status_interface &=default
virtual auto check_tx_id(const hash_t &tx_id) -> std::optional< bool >=0
Queries whether the given TX ID is confirmed in the cache of recently confirmed TX IDs.
std::array< unsigned char, cbdc::hash_size > hash_t
SHA256 hash container.