CCF
Loading...
Searching...
No Matches
tx_receipt_impl.h
Go to the documentation of this file.
1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the Apache 2.0 License.
3#pragma once
4
6#include "ccf/receipt.h"
7#include "node/history.h"
8
9namespace ccf
10{
11 // Representation of receipt used by internal framework code. Mirrored in
12 // public interface by ccf::Receipt
14 {
15 std::vector<uint8_t> signature;
16 std::optional<std::vector<uint8_t>> cose_signature = std::nullopt;
17 HistoryTree::Hash root;
18 std::shared_ptr<ccf::HistoryTree::Path> path;
20 std::optional<ccf::crypto::Pem> node_cert = std::nullopt;
21 std::optional<ccf::crypto::Sha256Hash> write_set_digest = std::nullopt;
22 std::optional<std::string> commit_evidence = std::nullopt;
24 std::optional<std::vector<ccf::crypto::Pem>> service_endorsements =
25 std::nullopt;
26 std::optional<CoseEndorsementsChain> cose_endorsements = std::nullopt;
27
29 const std::vector<uint8_t>& signature_,
30 const std::optional<std::vector<uint8_t>>& cose_signature,
31 const HistoryTree::Hash& root_,
32 std::shared_ptr<ccf::HistoryTree::Path> path_,
33 NodeId node_id_,
34 const std::optional<ccf::crypto::Pem>& node_cert_,
35 const std::optional<ccf::crypto::Sha256Hash>& write_set_digest_ =
36 std::nullopt,
37 // Optional to support historical transactions, where it may be absent
38 const std::optional<std::string>& commit_evidence_ = std::nullopt,
39 // May not be set on historical transactions
40 ccf::ClaimsDigest claims_digest_ = ccf::no_claims(),
41 const std::optional<std::vector<ccf::crypto::Pem>>&
42 service_endorsements_ = std::nullopt,
43 const std::optional<CoseEndorsementsChain>& cose_endorsements_ =
44 std::nullopt) :
45 signature(signature_),
47 root(root_),
48 path(std::move(path_)),
49 node_id(std::move(node_id_)),
50 node_cert(node_cert_),
51 write_set_digest(write_set_digest_),
52 commit_evidence(commit_evidence_),
53 claims_digest(std::move(claims_digest_)),
54 service_endorsements(service_endorsements_),
55 cose_endorsements(cose_endorsements_)
56 {}
57 };
58
59 using TxReceiptImplPtr = std::shared_ptr<TxReceiptImpl>;
60}
Definition claims_digest.h:10
Definition app_interface.h:14
std::shared_ptr< TxReceiptImpl > TxReceiptImplPtr
Definition receipt.h:133
STL namespace.
Definition tx_receipt_impl.h:14
std::optional< ccf::crypto::Sha256Hash > write_set_digest
Definition tx_receipt_impl.h:21
HistoryTree::Hash root
Definition tx_receipt_impl.h:17
std::shared_ptr< ccf::HistoryTree::Path > path
Definition tx_receipt_impl.h:18
std::optional< std::vector< uint8_t > > cose_signature
Definition tx_receipt_impl.h:16
ccf::ClaimsDigest claims_digest
Definition tx_receipt_impl.h:23
std::optional< std::vector< ccf::crypto::Pem > > service_endorsements
Definition tx_receipt_impl.h:24
std::vector< uint8_t > signature
Definition tx_receipt_impl.h:15
std::optional< std::string > commit_evidence
Definition tx_receipt_impl.h:22
TxReceiptImpl(const std::vector< uint8_t > &signature_, const std::optional< std::vector< uint8_t > > &cose_signature, const HistoryTree::Hash &root_, std::shared_ptr< ccf::HistoryTree::Path > path_, NodeId node_id_, const std::optional< ccf::crypto::Pem > &node_cert_, const std::optional< ccf::crypto::Sha256Hash > &write_set_digest_=std::nullopt, const std::optional< std::string > &commit_evidence_=std::nullopt, ccf::ClaimsDigest claims_digest_=ccf::no_claims(), const std::optional< std::vector< ccf::crypto::Pem > > &service_endorsements_=std::nullopt, const std::optional< CoseEndorsementsChain > &cose_endorsements_=std::nullopt)
Definition tx_receipt_impl.h:28
ccf::NodeId node_id
Definition tx_receipt_impl.h:19
std::optional< CoseEndorsementsChain > cose_endorsements
Definition tx_receipt_impl.h:26
std::optional< ccf::crypto::Pem > node_cert
Definition tx_receipt_impl.h:20