OpenCBDC Transaction Processor
Loading...
Searching...
No Matches
uhs/sentinel/interface.cpp
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#include "interface.hpp"
7
8namespace cbdc::sentinel {
10 const cbdc::sentinel::execute_response& rhs) const -> bool {
11 return std::tie(m_tx_status, m_tx_error)
12 == std::tie(rhs.m_tx_status, rhs.m_tx_error);
13 }
14
15 auto to_string(tx_status status) -> std::string {
16 auto ret = std::string();
17 switch(status) {
19 ret = "Contextually invalid";
20 break;
22 ret = "Confirmed";
23 break;
25 ret = "Pending";
26 break;
28 ret = "Statically invalid";
29 break;
30 }
31 return ret;
32 }
33}
auto to_string(tx_status status) -> std::string
Return a human-readable string describing a tx_status.
tx_status
Status of the transaction following sentinel processing.
@ static_invalid
Statically invalid. Must be fixed and resubmitted.
@ state_invalid
Statically valid, but rejected by the shards for trying to spend inputs either that do not exist or t...
@ pending
Statically valid, and the sentinel has submitted the transaction to the network for processing.
@ confirmed
Executed to completion.
auto operator==(const execute_response &rhs) const -> bool