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: narrow WidgetPromise typings #565

Merged
merged 7 commits into from
Mar 17, 2023
Merged

fix: narrow WidgetPromise typings #565

merged 7 commits into from
Mar 17, 2023

Conversation

zzmp
Copy link
Contributor

@zzmp zzmp commented Mar 16, 2023

Narrows WidgetPromise typings such that we can be certain we are only triggering the events with promises that will reject in a WidgetError.

This is primarily a refactor, but it adds type safety to the internals of the PerfEventHandlers.

@zzmp zzmp requested a review from just-toby March 16, 2023 23:56
@vercel
Copy link

vercel bot commented Mar 16, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
widgets ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 17, 2023 at 3:16AM (UTC)

case TransactionType.UNWRAP:
return {
response: await wrappedNativeCurrencyContract.withdraw(`0x${parsedAmountIn.quotient.toString(16)}`),
type: TransactionType.WRAP,
type: TransactionType.UNWRAP,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a current bug caught by narrower typings.

@vercel vercel bot temporarily deployed to Preview March 17, 2023 00:05 Inactive
@vercel vercel bot temporarily deployed to Preview March 17, 2023 00:11 Inactive
@vercel vercel bot temporarily deployed to Preview March 17, 2023 00:28 Inactive
@vercel vercel bot temporarily deployed to Preview March 17, 2023 00:39 Inactive
@vercel vercel bot temporarily deployed to Preview March 17, 2023 00:49 Inactive
@mikeki
Copy link

mikeki commented Mar 17, 2023

Types look good, it's quite a complex typing though but seems like it is necessary to accomplish what you need.

Approving with my review based on code check, but please consider that I don't regularly work with this repo.

@mikeki mikeki self-requested a review March 17, 2023 00:58
@vercel vercel bot temporarily deployed to Preview March 17, 2023 03:16 Inactive
@zzmp zzmp merged commit 9d4c776 into main Mar 17, 2023
@zzmp zzmp deleted the widget-promise-typings branch March 17, 2023 16:53
@github-actions
Copy link

🎉 This PR is included in version 2.48.7 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants