Skip to content

Commit

Permalink
Add diagnosticEvents (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
sisuresh committed Mar 14, 2023
1 parent 32718f0 commit 7356dc2
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion Stellar-ledger.x
Expand Up @@ -388,7 +388,8 @@ struct TransactionMetaV2
enum ContractEventType
{
SYSTEM = 0,
CONTRACT = 1
CONTRACT = 1,
DIAGNOSTIC = 2
};

struct ContractEvent
Expand All @@ -412,6 +413,17 @@ struct ContractEvent
body;
};

struct DiagnosticEvent
{
bool inSuccessfulContractCall;
ContractEvent event;
};

struct OperationDiagnosticEvents
{
DiagnosticEvent events<>;
};

struct OperationEvents
{
ContractEvent events<>;
Expand All @@ -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
Expand Down

0 comments on commit 7356dc2

Please sign in to comment.