OpenCBDC Transaction Processor
Loading...
Searching...
No Matches
cbdc::watchtower::tx_error Class Reference

Wrapper for transaction errors. More...

#include <tx_error_messages.hpp>

Public Member Functions

auto operator== (const tx_error &rhs) const -> bool
 
 tx_error ()=delete
 
 tx_error (const hash_t &tx_id, const tx_error_sync &err)
 Sync error constructor.
 
 tx_error (const hash_t &tx_id, const tx_error_inputs_dne &err)
 Input does-not-exist error constructor.
 
 tx_error (const hash_t &tx_id, const tx_error_stxo_range &err)
 STXO range error constructor.
 
 tx_error (const hash_t &tx_id, const tx_error_incomplete &err)
 Incomplete error constructor.
 
 tx_error (const hash_t &tx_id, const tx_error_inputs_spent &err)
 Inputs spent error constructor.
 
 tx_error (cbdc::serializer &pkt)
 Construct from a packet.
 
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 to_string () const -> std::string
 Returns a human-friendly description of the error.
 

Friends

auto cbdc::operator<< (cbdc::serializer &packet, const cbdc::watchtower::tx_error &err) -> cbdc::serializer &
 
auto cbdc::operator>> (cbdc::serializer &packet, cbdc::watchtower::tx_error &err) -> cbdc::serializer &
 

Detailed Description

Wrapper for transaction errors.

Definition at line 168 of file tx_error_messages.hpp.

Constructor & Destructor Documentation

◆ tx_error() [1/7]

cbdc::watchtower::tx_error::tx_error ( )
delete

◆ tx_error() [2/7]

cbdc::watchtower::tx_error::tx_error ( const hash_t & tx_id,
const tx_error_sync & err )

Sync error constructor.

Parameters
tx_idthe transaction ID to which this error pertains.
errsync error.

Definition at line 116 of file tx_error_messages.cpp.

◆ tx_error() [3/7]

cbdc::watchtower::tx_error::tx_error ( const hash_t & tx_id,
const tx_error_inputs_dne & err )

Input does-not-exist error constructor.

Parameters
tx_idthe transaction ID to which this error pertains.
errdoes-not-exist error.

Definition at line 120 of file tx_error_messages.cpp.

◆ tx_error() [4/7]

cbdc::watchtower::tx_error::tx_error ( const hash_t & tx_id,
const tx_error_stxo_range & err )

STXO range error constructor.

Parameters
tx_idthe transaction ID to which this error pertains.
errSTXO range error.

Definition at line 124 of file tx_error_messages.cpp.

◆ tx_error() [5/7]

cbdc::watchtower::tx_error::tx_error ( const hash_t & tx_id,
const tx_error_incomplete & err )

Incomplete error constructor.

Parameters
tx_idthe transaction ID to which this error pertains.
errincomplete error.

Definition at line 128 of file tx_error_messages.cpp.

◆ tx_error() [6/7]

cbdc::watchtower::tx_error::tx_error ( const hash_t & tx_id,
const tx_error_inputs_spent & err )

Inputs spent error constructor.

Parameters
tx_idthe transaction ID to which this error pertains.
errinputs spent error.

Definition at line 132 of file tx_error_messages.cpp.

◆ tx_error() [7/7]

cbdc::watchtower::tx_error::tx_error ( cbdc::serializer & pkt)
explicit

Construct from a packet.

Parameters
pktpacket containing a serialized tx_error_inputs_spent.

Definition at line 76 of file tx_error_messages.cpp.

Member Function Documentation

◆ info()

auto cbdc::watchtower::tx_error::info ( ) const -> tx_error_info
nodiscard

Returns the type and associated information about this error.

Returns
error information.

Definition at line 84 of file tx_error_messages.cpp.

◆ operator==()

auto cbdc::watchtower::tx_error::operator== ( const tx_error & rhs) const -> bool

Definition at line 112 of file tx_error_messages.cpp.

◆ to_string()

auto cbdc::watchtower::tx_error::to_string ( ) const -> std::string
nodiscard

Returns a human-friendly description of the error.

Returns
error description.

Definition at line 88 of file tx_error_messages.cpp.

◆ tx_id()

auto cbdc::watchtower::tx_error::tx_id ( ) const -> hash_t
nodiscard

Returns the transaction ID to which this error pertains.

Returns
Tx ID.

Definition at line 80 of file tx_error_messages.cpp.

Friends And Related Symbol Documentation

◆ cbdc::operator<<

auto cbdc::operator<< ( cbdc::serializer & packet,
const cbdc::watchtower::tx_error & err ) -> cbdc::serializer &
friend

◆ cbdc::operator>>

auto cbdc::operator>> ( cbdc::serializer & packet,
cbdc::watchtower::tx_error & err ) -> cbdc::serializer &
friend

The documentation for this class was generated from the following files: