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

Add missing methods to TypeScript definitions #766

Merged
merged 5 commits into from
Sep 12, 2024
Merged

Conversation

Shaptic
Copy link
Contributor

@Shaptic Shaptic commented Aug 8, 2024

Self-explanatory, see diff.

@Shaptic Shaptic requested review from sreuland, aditya1702, psheth9 and a team August 8, 2024 02:55
@Shaptic Shaptic added the bug label Aug 8, 2024
@Shaptic Shaptic added this to the platform sprint 49 milestone Aug 8, 2024
Copy link

github-actions bot commented Aug 8, 2024

Size Change: 0 B

Total Size: 3.25 MB

ℹ️ View Unchanged
Filename Size
dist/stellar-base.js 2.39 MB
dist/stellar-base.min.js 867 kB

compressed-size-action

@Shaptic Shaptic mentioned this pull request Aug 8, 2024
@@ -1058,7 +1059,9 @@ export class TransactionBuilder {
options?: TransactionBuilder.TransactionBuilderOptions
);
addOperation(operation: xdr.Operation): this;
addOperationAt(op: xdr.Operation, i: number): this;
Copy link
Contributor

Choose a reason for hiding this comment

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

is it getting to point where it's worthwhile to add ts tests, index.d.test.ts? how do we know addOperation will work when used by a client, or is there some base validation done in build pipeline?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's JS unit tests for it but you're right that we should generally add more to the types/test.ts file. Unfortunately said tests only fail when you, well, add to them, and if you're adding to them then you're adding to the index.d.ts file anyway, so it wouldn't have prevented this slip-up (which came from an external contributor anyway).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added the typing tests in c5c5f9b!

Copy link
Contributor

@sreuland sreuland left a comment

Choose a reason for hiding this comment

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

lgtm, and thanks for insight there on ts testing mechanics.

@Shaptic Shaptic merged commit ed89fec into master Sep 12, 2024
8 checks passed
@Shaptic Shaptic deleted the typescript-fixups branch September 12, 2024 17:35
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.

3 participants