16 if (info.
status == ccf::FinalTxStatus::Invalid)
19 HTTP_STATUS_INTERNAL_SERVER_ERROR,
20 ccf::errors::TransactionInvalid,
22 "While waiting for TxID {} to commit, it was invalidated",
35 if (info.status == ccf::FinalTxStatus::Invalid)
37 info.rpc_ctx->set_error(
38 HTTP_STATUS_INTERNAL_SERVER_ERROR,
39 ccf::errors::TransactionInvalid,
41 "While waiting for TxID {} to commit, it was invalidated",
42 info.tx_id.to_str()));
48 if (receipt ==
nullptr)
54 if (!cose_receipt.has_value())
56 info.rpc_ctx->set_error(
57 HTTP_STATUS_INTERNAL_SERVER_ERROR,
58 ccf::errors::InternalError,
59 "No COSE receipt produced for this transaction");
63 info.rpc_ctx->set_response_status(HTTP_STATUS_OK);
64 info.rpc_ctx->set_response_header(
65 ccf::http::headers::CONTENT_TYPE,
66 ccf::http::headervalues::contenttype::COSE);
67 info.rpc_ctx->set_response_body(cose_receipt.value());
std::function< void(CommittedTxInfo &info)> ConsensusCommittedEndpointFunction
Definition endpoint_context.h:82
ccf::TxReceiptImplPtr build_receipt_for_committed_tx(ccf::AbstractNodeContext &context, CommittedTxInfo &info)
Definition endpoint_registry.cpp:208
Definition default_on_commit.h:11
void default_respond_on_commit(ccf::endpoints::CommittedTxInfo &info)
Definition default_on_commit.h:14
ccf::endpoints::ConsensusCommittedEndpointFunction make_respond_with_receipt_on_commit(ccf::AbstractNodeContext &context)
Definition default_on_commit.h:32
std::optional< SerialisedCoseReceipt > describe_cose_receipt_v1(const TxReceiptImpl &receipt)
Definition historical_queries_adapter.cpp:274
Definition node_context.h:12
std::string to_str() const
Definition tx_id.h:48
Definition endpoint_context.h:72
std::shared_ptr< ccf::RpcContext > rpc_ctx
Definition endpoint_context.h:73
ccf::FinalTxStatus status
Definition endpoint_context.h:75
ccf::TxID tx_id
Definition endpoint_context.h:74