-
Notifications
You must be signed in to change notification settings - Fork 179
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
src/hooks/swap/useWrapCallback.tsx
Outdated
case TransactionType.UNWRAP: | ||
return { | ||
response: await wrappedNativeCurrencyContract.withdraw(`0x${parsedAmountIn.quotient.toString(16)}`), | ||
type: TransactionType.WRAP, | ||
type: TransactionType.UNWRAP, |
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.
This is a current bug caught by narrower typings.
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. |
🎉 This PR is included in version 2.48.7 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Narrows
WidgetPromise
typings such that we can be certain we are only triggering the events with promises that will reject in aWidgetError
.This is primarily a refactor, but it adds type safety to the internals of the
PerfEventHandlers
.