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 HistoryTree::Hash root = {};
16 std::shared_ptr<ccf::HistoryTree::Path> path = {};
18 std::optional<ccf::crypto::Pem> node_cert = std::nullopt;
19 std::optional<ccf::crypto::Sha256Hash> write_set_digest = std::nullopt;
20 std::optional<std::string> commit_evidence = std::nullopt;
22 std::optional<std::vector<ccf::crypto::Pem>> service_endorsements =
23 std::nullopt;
24
26 const std::vector<uint8_t>& signature_,
27 const HistoryTree::Hash& root_,
28 std::shared_ptr<ccf::HistoryTree::Path> path_,
29 const NodeId& node_id_,
30 const std::optional<ccf::crypto::Pem>& node_cert_,
31 const std::optional<ccf::crypto::Sha256Hash>& write_set_digest_ =
32 std::nullopt,
33 // Optional to support historical transactions, where it may be absent
34 const std::optional<std::string>& commit_evidence_ = std::nullopt,
35 // May not be set on historical transactions
36 const ccf::ClaimsDigest& claims_digest_ = ccf::no_claims(),
37 const std::optional<std::vector<ccf::crypto::Pem>>&
38 service_endorsements_ = std::nullopt) :
39 signature(signature_),
40 root(root_),
41 path(path_),
42 node_id(node_id_),
43 node_cert(node_cert_),
44 write_set_digest(write_set_digest_),
45 commit_evidence(commit_evidence_),
46 claims_digest(claims_digest_),
47 service_endorsements(service_endorsements_)
48 {}
49 };
50
51 using TxReceiptImplPtr = std::shared_ptr<TxReceiptImpl>;
52}
Definition claims_digest.h:10
Definition app_interface.h:15
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:19
TxReceiptImpl(const std::vector< uint8_t > &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)
Definition tx_receipt_impl.h:25
HistoryTree::Hash root
Definition tx_receipt_impl.h:15
std::shared_ptr< ccf::HistoryTree::Path > path
Definition tx_receipt_impl.h:16
ccf::ClaimsDigest claims_digest
Definition tx_receipt_impl.h:21
std::optional< std::vector< ccf::crypto::Pem > > service_endorsements
Definition tx_receipt_impl.h:22
std::vector< uint8_t > signature
Definition tx_receipt_impl.h:14
std::optional< std::string > commit_evidence
Definition tx_receipt_impl.h:20
ccf::NodeId node_id
Definition tx_receipt_impl.h:17
std::optional< ccf::crypto::Pem > node_cert
Definition tx_receipt_impl.h:18