OpenCBDC Transaction Processor
Loading...
Searching...
No Matches
uhs/transaction/messages.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 "messages.hpp"
7
8#include "transaction.hpp"
11
12namespace cbdc {
14 -> serializer& {
15 return packet << op.m_tx_id << op.m_index;
16 }
17
19 -> serializer& {
20 return packet >> op.m_tx_id >> op.m_index;
21 }
22
23 auto operator<<(serializer& packet, const transaction::output& out)
24 -> serializer& {
25 return packet << out.m_witness_program_commitment << out.m_value;
26 }
27
29 -> serializer& {
30 return packet >> out.m_witness_program_commitment >> out.m_value;
31 }
32
33 auto operator<<(serializer& packet, const transaction::input& inp)
34 -> serializer& {
35 return packet << inp.m_prevout << inp.m_prevout_data;
36 }
37
39 -> serializer& {
40 return packet >> inp.m_prevout >> inp.m_prevout_data;
41 }
42
44 -> serializer& {
45 return packet << tx.m_inputs << tx.m_outputs << tx.m_witness;
46 }
47
49 -> serializer& {
50 return packet >> tx.m_inputs >> tx.m_outputs >> tx.m_witness;
51 }
52
54 -> serializer& {
55 return packet << tx.m_id << tx.m_inputs << tx.m_uhs_outputs
56 << tx.m_attestations;
57 }
58
60 -> serializer& {
61 return packet >> tx.m_id >> tx.m_inputs >> tx.m_uhs_outputs
62 >> tx.m_attestations;
63 }
64
65 auto operator>>(serializer& packet,
67 return packet >> e.m_code >> e.m_data_err >> e.m_idx;
68 }
69
70 auto operator<<(serializer& packet,
72 -> serializer& {
73 return packet << e.m_code << e.m_data_err << e.m_idx;
74 }
75
76 auto operator>>(serializer& packet,
78 return packet >> e.m_code >> e.m_idx;
79 }
80
81 auto operator<<(serializer& packet,
83 -> serializer& {
84 return packet << e.m_code << e.m_idx;
85 }
86
87 auto operator>>(serializer& packet,
89 return packet >> e.m_code >> e.m_idx;
90 }
91
92 auto operator<<(serializer& packet,
94 -> serializer& {
95 return packet << e.m_code << e.m_idx;
96 }
97}
Interface for serializing objects into and out of raw bytes representations.
auto operator>>(serializer &deser, parsec::agent::rpc::request &req) -> serializer &
auto operator<<(serializer &ser, const parsec::agent::rpc::request &req) -> serializer &
A condensed, hash-only transaction representation.
A complete transaction.
An input for a new transaction.
The unique identifier of a specific output from a transaction.
An output of a transaction.
An error that may occur when sentinels validate inputs.
An error that may occur when sentinels validate transaction outputs.
An error that may occur when sentinels validate witness commitments.