-
Notifications
You must be signed in to change notification settings - Fork 208
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(types): board values #9332
fix(types): board values #9332
Conversation
Deploying agoric-sdk with Cloudflare Pages
|
packages/vats/src/lib-board.js
Outdated
* @param {PassableCap} value | ||
* @throws if `value` is not a Key in the @agoric/store sense | ||
* @param {RemotableObject} value | ||
* @throws if `value` is not a ScalarKey in the @agoric/store sense |
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.
I'm not sure @agoric/store
has a ScalarKey
sense. maybe "in the @endo/patterns sense"
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.
agreed. though this is one place ScalarKey ought to be mentioned, because this code only throws at runtime if it's it's not a ScalarKey. (it doesn't check that it's a remotable)
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.
I made it check with isRemotable()
@@ -267,8 +270,7 @@ export const prepareBoardKit = baggage => { | |||
* `value` for its entire lifetime. For a well-known board, this is | |||
* essentially forever. | |||
* | |||
* @param {PassableCap} value | |||
* @throws if `value` is not a Key in the @agoric/store sense |
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.
removed this because it shouldn't come as a surprise to get an error when the argument doesn't satisfy the param type
@@ -101,7 +101,9 @@ const makeInvitation = async ( | |||
board, | |||
zoe, | |||
) => { | |||
const instance = E(board).getValue(instanceHandleBoardId); | |||
const instance = /** @type {Promise<Instance>} */ ( |
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.
getPublicFacet won't take any old Remotable
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.
an Upgrade Consideration: like many/most recent changes, I expect upgrade to happen by way of
* @param {PassableCap} val | ||
* @param {RemotableObject} val |
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.
👍
@@ -26,7 +26,6 @@ const makeOnChainWallet = board => { | |||
getCurrentAmount: () => harden({ brand, value: 100 }), | |||
}); | |||
// only for private brands | |||
// context.initBrandId(boardId, brand); |
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.
weird
if (!isRemotable(value)) { | ||
Fail`Board cannot create id for non-remotable`; | ||
} |
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.
one could look at that as a breaking change... I think I'll look at it as a (non-breaking) fix: the fact that you used to be able store primitives is a bug.
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.
good point and I agree
Description
Follow up to #8774
Fix the Board types
Security Considerations
Scaling Considerations
Documentation Considerations
Testing Considerations
Upgrade Considerations
The one behavior change is to omit non-remotables from the board, but nothing should have been doing that and if it was this error will help.
Of course that doesn't need to go out in any particular chain upgrade, but it could to minimize divergence from master until,