-
Notifications
You must be signed in to change notification settings - Fork 212
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
vaultFactory proposal shapes #7094
Conversation
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.
LGTM, thanks!
packages/ERTP/src/paymentLedger.js
Outdated
/** | ||
* @param {Brand} brand | ||
* @param {AssetKind} assetKind | ||
* @param {Matcher} elementShape |
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.
* @param {Matcher} elementShape | |
* @param {Pattern} elementShape |
For example, harden({ x: M.bigint() })
is a Pattern
but not a Matcher
, whereas M.bigint()
is both a Pattern
and a Matcher
.
0a5c7de
to
3ea332d
Compare
Can this wait until after #7047? |
3ea332d
to
dfbf8c5
Compare
Datadog ReportBranch report: ✅ |
refs: #7041
Description
assertProposalShape
has deprecated and the replacement is to use a new argument tomakeInvitations
, which provides better protection for contracts against malformed offers. When an offer's proposal violates the contract's required proposalShape pattern, it is rejected in Zoe and the contract never even sees the malformed offer.This does that for vaultFactory. While touching these it also specifies the brand in the shape guard. To do this without an
E(brand).getAmountShape()
remote call it uses a new helpermakeNatAmountShape()
that can be safely used in Inter Protocol because the amount kinds are known. I put it in inter-protocol's contractSupport so not endorse the usage elsewhere.Security Considerations
Improves guarding by testing earlier and including the brand.
Scaling Considerations
The shape is now constructed on each makeInvitation instead of once at module scope. If this is a problem it could be memoized.
Documentation Considerations
--
Testing Considerations
CI