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
5#include "ccf/receipt.h"
6#include "node/history.h"
7
8namespace ccf
9{
10 // Representation of receipt used by internal framework code. Mirrored in
11 // public interface by ccf::Receipt
13 {
14 std::vector<uint8_t> signature = {};
15 std::optional<std::vector<uint8_t>> cose_signature = std::nullopt;
16 HistoryTree::Hash root = {};
17 std::shared_ptr<ccf::HistoryTree::Path> path = {};
19 std::optional<ccf::crypto::Pem> node_cert = std::nullopt;
20 std::optional<ccf::crypto::Sha256Hash> write_set_digest = std::nullopt;
21 std::optional<std::string> commit_evidence = std::nullopt;
23 std::optional<std::vector<ccf::crypto::Pem>> service_endorsements =
24 std::nullopt;
25 std::optional<std::vector<std::vector<uint8_t>>> cose_endorsements =
26 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 const 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 const 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<std::vector<std::vector<uint8_t>>>&
44 cose_endorsements_ = std::nullopt) :
45 signature(signature_),
47 root(root_),
48 path(path_),
49 node_id(node_id_),
50 node_cert(node_cert_),
51 write_set_digest(write_set_digest_),
52 commit_evidence(commit_evidence_),
53 claims_digest(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:136
Definition tx_receipt_impl.h:13
std::optional< ccf::crypto::Sha256Hash > write_set_digest
Definition tx_receipt_impl.h:20
HistoryTree::Hash root
Definition tx_receipt_impl.h:16
std::shared_ptr< ccf::HistoryTree::Path > path
Definition tx_receipt_impl.h:17
std::optional< std::vector< uint8_t > > cose_signature
Definition tx_receipt_impl.h:15
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_, const 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, const ccf::ClaimsDigest &claims_digest_=ccf::no_claims(), const std::optional< std::vector< ccf::crypto::Pem > > &service_endorsements_=std::nullopt, const std::optional< std::vector< std::vector< uint8_t > > > &cose_endorsements_=std::nullopt)
Definition tx_receipt_impl.h:28
ccf::ClaimsDigest claims_digest
Definition tx_receipt_impl.h:22
std::optional< std::vector< ccf::crypto::Pem > > service_endorsements
Definition tx_receipt_impl.h:23
std::vector< uint8_t > signature
Definition tx_receipt_impl.h:14
std::optional< std::string > commit_evidence
Definition tx_receipt_impl.h:21
std::optional< std::vector< std::vector< uint8_t > > > cose_endorsements
Definition tx_receipt_impl.h:25
ccf::NodeId node_id
Definition tx_receipt_impl.h:18
std::optional< ccf::crypto::Pem > node_cert
Definition tx_receipt_impl.h:19