-
Notifications
You must be signed in to change notification settings - Fork 312
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
Conversation
Size Change: +1.05 kB (0%) Total Size: 12.1 MB
|
@@ -307,14 +307,14 @@ export class Server { | |||
hash: string | |||
): Promise<Api.GetTransactionResponse> { | |||
return this._getTransaction(hash).then((raw) => { | |||
let successInfo: Omit< | |||
let foundInfo: Omit< |
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.
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<...>;
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.
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.
@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
toapi.ts
for consistency.)