26 return m_input_uhs_ids;
30 : m_input_uhs_ids(std::move(input_uhs_ids)) {}
34 return m_input_uhs_ids == rhs.m_input_uhs_ids;
62 -> std::unordered_set<
hash_t, hashing::null> {
63 return m_input_uhs_ids;
67 std::unordered_set<hash_t, hashing::null> input_uhs_ids)
68 : m_input_uhs_ids(std::move(input_uhs_ids)) {}
73 return rhs.m_input_uhs_ids == m_input_uhs_ids;
89 const auto* ret =
"Unknown error";
93 ret =
"Shard is not synchronized with atomizer";
96 ret =
"Input(s) do not exist";
99 ret =
"Transaction not in STXO Cache range";
102 ret =
"Input(s) are already spent";
105 ret =
"Did not receive attestations to all inputs before "
106 "STXO cache expired";
113 return rhs.m_tx_id == m_tx_id && *rhs.m_info == *m_info;
118 m_info(std::make_shared<decltype(m_info)::element_type>(err)) {}
122 m_info(std::make_shared<decltype(m_info)::element_type>(err)) {}
126 m_info(std::make_shared<decltype(m_info)::element_type>(err)) {}
130 m_info(std::make_shared<decltype(m_info)::element_type>(err)) {}
135 m_info(std::make_shared<decltype(m_info)::element_type>(err)) {}
142 packet << err.m_input_uhs_ids;
149 packet >> err.m_input_uhs_ids;
156 packet << err.m_input_uhs_ids;
163 packet >> err.m_input_uhs_ids;
170 return packet << err.m_tx_id << *err.m_info;
175 packet >> err.m_tx_id;
176 err.m_info = std::make_shared<
decltype(err.m_info)::element_type>(
Interface for serializing objects into and out of raw bytes representations.
Wrapper for transaction errors.
auto to_string() const -> std::string
Returns a human-friendly description of the error.
auto tx_id() const -> hash_t
Returns the transaction ID to which this error pertains.
auto info() const -> tx_error_info
Returns the type and associated information about this error.
auto operator==(const tx_error &rhs) const -> bool
std::variant< tx_error_sync, tx_error_inputs_dne, tx_error_stxo_range, tx_error_incomplete, tx_error_inputs_spent > tx_error_info
auto get_variant(serializer &deser) -> std::variant< Ts... >
Deserializes a variant where the alternatives are all default constructible or all are not default co...
std::array< unsigned char, cbdc::hash_size > hash_t
SHA256 hash container.
auto operator>>(serializer &deser, parsec::agent::rpc::request &req) -> serializer &
auto operator<<(serializer &ser, const parsec::agent::rpc::request &req) -> serializer &
Variant handler template.
Indicates that the atomizer did not receive enough attestations for a particular transaction from sha...
tx_error_incomplete()=default
auto operator==(const tx_error_incomplete &rhs) const -> bool
Indicates that a shard did not attest to this transaction recently enough for the atomizer to check i...
auto operator==(const tx_error_stxo_range &rhs) const -> bool
tx_error_stxo_range()=default
Indicates a shard that tried to process a given transaction was out of sync with the atomizer,...
auto operator==(const tx_error_sync &rhs) const -> bool
Messages atomizers and shards can use to transmit errors to the watchtower, and which the watchtower ...