-
Notifications
You must be signed in to change notification settings - Fork 221
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
chore(smart-wallet): don't try to distinguish presences statically #8120
Conversation
Using static types to distinguish a Purse from a presence-for-a-Purse (likewise Payment) is not common in our code; the attempt to do it here seems to cause unwarranted friction.
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.
A little sad to see this loss of specificity but we don't have the types support yet to make it practical.
@michaelfig , I thought you do. Did I misunderstand? |
I think they're all expressible with the types from
|
ok, that's more than I knew. But ERTP just uses /**
* @param {ERef<Purse>} purse
* @param {Awaited<import('@endo/far').FarRef<Payment>>} pmt
*/
const funWithTypes = async (purse, pmt) => {
return E(purse).deposit(pmt);
}; I get an error:
It reminds me of trying to use |
One thing that I think makes using this sort of distinction awkward is: it's not a pass-invariant property. In Maybe there's some that the type for But normally, the caller and the callee in an API use the same type. |
What I'm suggesting would only work by changing the typing on all |
The constraints on what you can pass to But another motivation was synchronous calls such as |
chore(smart-wallet): don't try to distinguish presences statically
refs: #7226, #8071
Description
Using static types to distinguish a Purse from a presence-for-a-Purse (likewise Payment) is not common in our code; the attempt to do it here seems to cause unwarranted friction.
Security...Testing Considerations
none; types only