Repository navigation
Conversation
Ryang-21
force-pushed
the
feat/soroban-ledger-keys-diagnostics-1244
branch
from
November 24, 2026 01:37
ade81b3 to
e693359
Compare
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block approval of the diagnostic-event inspection helper.
No open issues 🎉
What changed in this PR
Adds rpc.inspectDiagnosticEvents() to provide a consistent, readable view of diagnostic events across parsed Stellar RPC responses.
Changes:
- Converts event topics and data to native values while preserving event type, contract ID, and call-success status.
- Supports simulation, submission, and transaction lookup responses, with transaction metadata fallback when needed.
- Adds runtime and compile-time tests, API documentation, and a failed-call example.
| File | Description |
|---|---|
test/unit/server/soroban/inspect_diagnostic_events.test.ts |
Tests response formats, metadata fallback, event conversion, and empty results. |
test/types/diagnostic-events.ts |
Checks public input and output types and rejects raw events. |
src/rpc/index.ts |
Exports the helper and its public types. |
src/rpc/diagnostics.ts |
Implements diagnostic event extraction and conversion. |
examples/guides/invoke-a-contract.ts |
Demonstrates inspecting a failed contract simulation. |
docs/reference/network-rpc.md |
Documents the helper and its types. |
docs/guides/06-invoke-a-contract.md |
Adds guidance on diagnosing failed calls. |
CHANGELOG.md |
Records the new helper under Unreleased. |
Review effort: Balanced
Ryang-21
marked this pull request as ready for review
November 24, 2026 18:58
quietbits
approved these changes
Nov 24, 2026
Shaptic
approved these changes
Nov 24, 2026
| /** A diagnostic event with its topics and data converted to native values. */ | ||
| export interface DiagnosticEventInfo { | ||
| /** whether the contract call that emitted the event succeeded */ | ||
| inSuccessfulContractCall: boolean; |
Contributor
There was a problem hiding this comment.
this is a deprecated field iirc
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
rpc.inspectDiagnosticEvents(response). It takes asendTransaction,getTransactionorsimulateTransactionresponse, or agetTransactionsentry, and returns its diagnostic events with topics and data as native values, plusinSuccessfulContractCall. It returns an empty list when there are none, and makes no network calls.For
getTransactionandgetTransactionsit reads the events inresultMetaXdrwhen the deprecated top-leveldiagnosticEventsXdris missing or empty.Why
Each response keeps diagnostic events in a different field and shape, so finding why a contract call failed meant knowing all of them. The fallback keeps the helper working once RPC removes the deprecated field.
Closes #1258