refactor: stop using deprecated "sloppy" interface option#11931
refactor: stop using deprecated "sloppy" interface option#11931mergify[bot] merged 1 commit intomasterfrom
Conversation
Deploying agoric-sdk with
|
| Latest commit: |
0ca5765
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://6fa28407.agoric-sdk.pages.dev |
| Branch Preview URL: | https://markm-stop-using-sloppy-opti.agoric-sdk.pages.dev |
| }; | ||
|
|
||
| const ZCFSeatI = M.interface('ZCFSeat', {}, { sloppy: true }); | ||
| const ZCFSeatI = M.interface('ZCFSeat', {}, { defaultGuards: 'passable' }); |
There was a problem hiding this comment.
This strikes me as a particular dangerous place to omit explicit method guards. Am I missing something?
There was a problem hiding this comment.
This question is not relevant to this PR though. Just asking.
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the codebase to replace the deprecated "sloppy" interface option with the newer "defaultGuards: 'passable'" option in Marshal interface definitions.
- Updates interface definitions from
{ sloppy: true }to{ defaultGuards: 'passable' } - Updates associated comments to reflect the new interface option terminology
- Maintains the same functional behavior while using the current API
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/zoe/src/contractFacet/zcfSeat.js | Updates ZCFSeat interface to use defaultGuards instead of sloppy |
| packages/internal/src/typeGuards.js | Updates UnguardedHelperI interface and comment |
| packages/inter-protocol/src/vaultFactory/vaultManager.js | Updates helper interface definition and comment |
| packages/inter-protocol/src/price/fluxAggregatorKit.js | Updates creator interface to use defaultGuards with multi-line formatting |
Refs: #1831, Agoric/agoric-sdk#11931 ## Description We wish to visibly deprecate the `sloppy` option of `@endo/patterns` interface guards. To avoid an explosion of `@typedef` blocks, we migrate the `@endo/patterns` types to TypeScript and then add the minimally required `@deprecated` tags. ### Security Considerations N/A ### Scaling Considerations N/A ### Documentation Considerations N/A ### Testing Considerations This modifies the implementation of the `@endo/patterns` types, but should not modify them. Since the number of lines changed is larged, we should attempt to convince ourselves that the types are in fact the same. ### Compatibility Considerations N/A ### Upgrade Considerations Deprecates but does not remove the `sloppy` option. `NEWS.md` is updated.
0ca5765 to
8a708e3
Compare
📝 WalkthroughWalkthroughGuard configuration in four interface declarations is updated from Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
closes: #XXXX
refs: #XXXX
Description
The copilot text at #11931 (review) seems like a fine description.
This PR refactors the codebase to replace the deprecated "sloppy" interface option with the newer "defaultGuards: 'passable'" option in Marshal interface definitions.
Updates interface definitions from { sloppy: true } to { defaultGuards: 'passable' }
Updates associated comments to reflect the new interface option terminology
Maintains the same functional behavior while using the current API
Security Considerations
Should be semantically identical, but easier to understand, so slight security improvement
Scaling Considerations
none
Documentation Considerations
If we can stop using
sloppycompletely, perhaps we can avoid documenting it in normal developer-facing documentation.Testing Considerations
Adequate testing already in heap-classes.test.js in
@endo/exoUpgrade Considerations
Since we still support the deprecated option at this time, none.
Summary by CodeRabbit