From 1ef4dfcb55fc7831663e17d94ccd253d9372ed2e Mon Sep 17 00:00:00 2001 From: Paul Bellamy Date: Thu, 17 Nov 2022 13:42:09 +0000 Subject: [PATCH 1/2] Make events a list of lists so we can associate events with their operation --- Stellar-ledger.x | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Stellar-ledger.x b/Stellar-ledger.x index ce4d697..f1a81e7 100644 --- a/Stellar-ledger.x +++ b/Stellar-ledger.x @@ -419,8 +419,8 @@ struct TransactionMetaV3 OperationMeta operations<>; // meta for each operation LedgerEntryChanges txChangesAfter; // tx level changes after operations are // applied if any - ContractEvent events<>; // custom events populated by the - // contracts themselves + ContractEvent events<><>; // custom events populated by the + // contracts themselves. One list per operation. TransactionResult txResult; Hash hashes[3]; // stores sha256(txChangesBefore, operations, txChangesAfter), From c0d201a6fd7861d862f3bdfebdf719f1e90d846c Mon Sep 17 00:00:00 2001 From: Paul Bellamy Date: Thu, 17 Nov 2022 13:48:07 +0000 Subject: [PATCH 2/2] Add a OperationEvents struct --- Stellar-ledger.x | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Stellar-ledger.x b/Stellar-ledger.x index f1a81e7..eaf1e89 100644 --- a/Stellar-ledger.x +++ b/Stellar-ledger.x @@ -412,6 +412,11 @@ struct ContractEvent body; }; +struct OperationEvents +{ + ContractEvent events<>; +}; + struct TransactionMetaV3 { LedgerEntryChanges txChangesBefore; // tx level changes before operations @@ -419,7 +424,7 @@ struct TransactionMetaV3 OperationMeta operations<>; // meta for each operation LedgerEntryChanges txChangesAfter; // tx level changes after operations are // applied if any - ContractEvent events<><>; // custom events populated by the + OperationEvents events<>; // custom events populated by the // contracts themselves. One list per operation. TransactionResult txResult;