-
Notifications
You must be signed in to change notification settings - Fork 124
Add self-describing events for stellar events and contract invoke.
#2380
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
Conversation
|
Looks awesome! My one nit is that the invoke line is too long. If the invoke had multiple events could they share the same output as the other event examples? |
|
@willemneal I decided to keep the same previous output mostly because in a real terminal you get the autowrap. |
|
That's true, just find it more readable than an auto wrap, since it would be predictable line breaks and chunked logically. |
leighmcculloch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏🏻 So good. Few questions and comments inline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Implements self-describing (spec-decoded) contract event rendering for stellar events and stellar contract invoke, leveraging Protocol 23 event definitions in contract specs to display named parameters and improved human-readable/JSON output.
Changes:
- Add event-spec decoding support to
soroban-spec-tools(neweventmodule +Spec::find_events+ decoding helpers/tests). - Update
stellar eventsto optionally fetch contract specs and render decoded Pretty/Plain/Json outputs, plus add a--output rawmode. - Update
stellar contract invoketo render decoded contract events when the invoked contract’s spec is available.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| cmd/soroban-cli/src/log/event.rs | Adds contract_with_spec to render decoded contract events when a spec is provided, with raw fallback. |
| cmd/soroban-cli/src/commands/events.rs | Adds decoded event rendering (Pretty/Plain/Json), spec fetching/cache, and a new raw output mode. |
| cmd/soroban-cli/src/commands/contract/invoke.rs | Switches invoke event printing to the new spec-aware event renderer. |
| cmd/soroban-cli/Cargo.toml | Adds indexmap dependency for stable param ordering in decoded output. |
| cmd/crates/soroban-spec-tools/src/lib.rs | Exposes new event module and adds Spec::find_events with tests. |
| cmd/crates/soroban-spec-tools/src/event.rs | Introduces event spec matching/decoding to named parameters + unit tests. |
| cmd/crates/soroban-spec-tools/Cargo.toml | Adds serde and indexmap dependencies needed for decoded event types. |
| FULL_HELP_DOCS.md | Documents new/updated stellar events --output behaviors (decoded formats + raw). |
| Cargo.lock | Locks new transitive dependencies (indexmap, serde). |
What
Using
stellar contract invoke:Using
stellar events:Why
Implement #2086.
Known limitations
N/A