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

Handle events without contract IDs correctly #883

Merged
merged 4 commits into from
Nov 29, 2023
Merged

Conversation

Shaptic
Copy link
Contributor

@Shaptic Shaptic commented Nov 27, 2023

As reported on Discord and confirmed by an example in the docs, the SorobanRpc.Server.getEvents method will fail when the event response contains an empty contract ID. There was an implicit assumption in the code that it would always be present and valid, but in fact it can sometimes be empty.

This modifies the parseRawEvents code to omit the contractId field from the parsed response.

@Shaptic Shaptic added the bug label Nov 27, 2023
@Shaptic Shaptic self-assigned this Nov 27, 2023
Copy link

github-actions bot commented Nov 27, 2023

Size Change: +4.39 kB (0%)

Total Size: 12.1 MB

Filename Size Change
dist/stellar-sdk.js 6.96 MB +3.02 kB (0%)
dist/stellar-sdk.min.js 5.1 MB +1.37 kB (0%)

compressed-size-action

src/soroban/parsers.ts Outdated Show resolved Hide resolved
@Shaptic Shaptic merged commit f3384ce into master Nov 29, 2023
8 checks passed
@Shaptic Shaptic deleted the fixup-event-parsing branch November 29, 2023 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants