purify
C++ Purify implementation with native circuit and BPP support
Loading...
Searching...
No Matches
construction_receipt_envelope.hpp
Go to the documentation of this file.
1// Copyright (c) 2026 Judica, Inc.
2// Distributed under the MIT software license, see the accompanying
3// file COPYING or https://opensource.org/license/mit/.
4
9
10#pragma once
11
12#include <cstddef>
13#include <span>
14#include <utility>
15
17
18namespace purify::accountable {
19
28class ConstructionReceiptEnvelope {
29public:
31 static constexpr std::size_t kParentProofSize = 15'076;
32
36
38 std::span<const unsigned char> encoded);
39
40 [[nodiscard]] Bytes serialize() const;
41 [[nodiscard]] std::size_t serialized_size() const noexcept;
42
43 [[nodiscard]] const ConstructionReceiptPayload& payload() const noexcept {
44 return payload_;
45 }
46
47 [[nodiscard]] const Bytes& parent_proof() const noexcept {
48 return parent_proof_;
49 }
50
51private:
54 : payload_(std::move(payload)),
55 parent_proof_(std::move(parent_proof)) {}
56
57 ConstructionReceiptPayload payload_;
58 Bytes parent_proof_;
59};
60
61} // namespace purify::accountable
static Result< ConstructionReceiptEnvelope > create(ConstructionReceiptPayload payload, Bytes parent_proof)
static Result< ConstructionReceiptEnvelope > deserialize(std::span< const unsigned char > encoded)
const ConstructionReceiptPayload & payload() const noexcept
Canonical public payload for a coalition construction receipt.
Canonical public statement for a coalition construction receipt.
Expected< T, Error > Result
Expected-returning convenience alias for Purify value-producing APIs.
Definition error.hpp:99
std::vector< unsigned char > Bytes
Dynamically sized byte string used for messages, serialized witnesses, and proofs.
Definition common.hpp:99