OpenCBDC Transaction Processor
Loading...
Searching...
No Matches
uhs/twophase/locking_shard/messages.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_MESSAGES_H_
7#define OPENCBDC_TX_SRC_LOCKING_SHARD_MESSAGES_H_
8
9#include "interface.hpp"
10
13 using lock_params = std::vector<tx>;
17 using apply_params = std::vector<bool>;
20 constexpr auto operator==(const discard_params& /* rhs */) const
21 -> bool {
22 return true;
23 };
24 };
25
27 struct request {
32 std::variant<lock_params, apply_params, discard_params> m_params{};
33
34 auto operator==(const request& rhs) const -> bool;
35 };
36
40 using lock_response = std::vector<bool>;
43 constexpr auto operator==(const apply_response& /* rhs */) const
44 -> bool {
45 return true;
46 };
47 };
50 constexpr auto operator==(const discard_response& /* rhs */) const
51 -> bool {
52 return true;
53 };
54 };
55
58 = std::variant<lock_response, apply_response, discard_response>;
59}
60
61#endif
std::vector< tx > lock_params
Transactions whose outputs the locking shard should lock.
std::variant< lock_response, apply_response, discard_response > response
Response to a locking shard request.
std::vector< bool > apply_params
Vector of bools.
std::vector< bool > lock_response
Response from a lock command, a vector of flags indicating which transactions in the batch had their ...
std::array< unsigned char, cbdc::hash_size > hash_t
SHA256 hash container.
constexpr auto operator==(const apply_response &) const -> bool
constexpr auto operator==(const discard_params &) const -> bool
constexpr auto operator==(const discard_response &) const -> bool
std::variant< lock_params, apply_params, discard_params > m_params
If the command is lock or apply, the parameters for these commands.
auto operator==(const request &rhs) const -> bool
hash_t m_dtx_id
The distributed transaction ID corresponding to the request.