From 124caad51979699e15f25bb3aef2057c2bd5f4a3 Mon Sep 17 00:00:00 2001 From: Siddharth Suresh Date: Tue, 24 Jan 2023 16:22:03 -0800 Subject: [PATCH] Add diagnosticEvents --- Stellar-ledger.x | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Stellar-ledger.x b/Stellar-ledger.x index eaf1e89..1563fb9 100644 --- a/Stellar-ledger.x +++ b/Stellar-ledger.x @@ -388,7 +388,8 @@ struct TransactionMetaV2 enum ContractEventType { SYSTEM = 0, - CONTRACT = 1 + CONTRACT = 1, + DIAGNOSTIC = 2 }; struct ContractEvent @@ -412,6 +413,17 @@ struct ContractEvent body; }; +struct DiagnosticEvent +{ + bool inSuccessfulContractCall; + ContractEvent event; +}; + +struct OperationDiagnosticEvents +{ + DiagnosticEvent events<>; +}; + struct OperationEvents { ContractEvent events<>; @@ -430,6 +442,11 @@ struct TransactionMetaV3 Hash hashes[3]; // stores sha256(txChangesBefore, operations, txChangesAfter), // sha256(events), and sha256(txResult) + + // Diagnostics events that are not hashed. One list per operation. + // This will contain all contract and diagnostic events. Even ones + // that were emitted in a failed contract call. + OperationDiagnosticEvents diagnosticEvents<>; }; // this is the meta produced when applying transactions