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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the interpreted value of the getEvents endpoint #876

Merged
merged 4 commits into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ A breaking change will get clearly marked in this log.
## Unreleased

### Fixed
* The `SorobanRpc.Server.getTransaction` method will now return the full response when encountering a `FAILED` transaction result ([#872](https://github.com/stellar/js-stellar-sdk/pull/872)).
* The `SorobanRpc.Server.getTransaction()` method will now return the full response when encountering a `FAILED` transaction result ([#872](https://github.com/stellar/js-stellar-sdk/pull/872)).
* The `SorobanRpc.Server.getEvents()` method will correctly parse the event value (which is an `xdr.ScVal` rather than an `xdr.DiagnosticEvent`, see the modified `SorobanRpc.Api.EventResponse.value`; [#876](https://github.com/stellar/js-stellar-sdk/pull/876)).


## [v11.0.0-beta.5](https://github.com/stellar/js-stellar-sdk/compare/v11.0.0-beta.4...v11.0.0-beta.5)
Expand Down
2 changes: 1 addition & 1 deletion src/soroban/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export namespace Api {
interface EventResponse extends BaseEventResponse {
contractId: Contract;
topic: xdr.ScVal[];
value: xdr.DiagnosticEvent;
value: xdr.ScVal;
}

export interface RawGetEventsResponse {
Expand Down
2 changes: 1 addition & 1 deletion src/soroban/parsers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function parseRawEvents(
...evt,
contractId: new Contract(evt.contractId),
topic: evt.topic.map((topic) => xdr.ScVal.fromXDR(topic, 'base64')),
value: xdr.DiagnosticEvent.fromXDR(evt.value.xdr, 'base64')
value: xdr.ScVal.fromXDR(evt.value.xdr, 'base64')
};
})
};
Expand Down