Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add diagnosticEvents #74

Merged
merged 1 commit into from
Mar 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion Stellar-ledger.x
Original file line number Diff line number Diff line change
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<>;
sisuresh marked this conversation as resolved.
Show resolved Hide resolved
};

// this is the meta produced when applying transactions
Expand Down