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

Fix how failed getTransaction responses are parsed #872

Merged
merged 3 commits into from
Oct 27, 2023
Merged

Conversation

Shaptic
Copy link
Contributor

@Shaptic Shaptic commented Oct 25, 2023

@tyvdh reported that the failed case should have way more fields (which is true!) and this should fix that up.

(This also renames soroban_rpc.ts to api.ts for consistency.)

@Shaptic Shaptic added the bug label Oct 25, 2023
@Shaptic Shaptic added this to the Soroban Stable P20 Release milestone Oct 25, 2023
@Shaptic Shaptic self-assigned this Oct 25, 2023
@Shaptic Shaptic requested a review from sreuland October 25, 2023 20:55
@github-actions
Copy link

Size Change: +1.05 kB (0%)

Total Size: 12.1 MB

Filename Size Change
dist/stellar-sdk.js 6.96 MB +577 B (0%)
dist/stellar-sdk.min.js 5.1 MB +474 B (0%)

compressed-size-action

@@ -307,14 +307,14 @@ export class Server {
hash: string
): Promise<Api.GetTransactionResponse> {
return this._getTransaction(hash).then((raw) => {
let successInfo: Omit<
let foundInfo: Omit<

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason why this type is calculated each time in method rather than a non-exported const at top of server.ts or exported as a static Type from api.ts? i.e. TransactionFoundResponse = Omit<...>;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it won't happen each time, it'll just happen once at "compile time" when the TypeScript is turned into JavaScript. It's not part of the API because this is specifying "the subset of the 'success/failure' schema that does not contain the 'missing' schema," which isn't like a well-defined API concept, it's just useful here because we're trying to create a partially-(but well-)defined subset of an object.

@Shaptic Shaptic merged commit 2b8af68 into master Oct 27, 2023
7 checks passed
@Shaptic Shaptic deleted the sim-error-fixup branch October 27, 2023 17:44
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