Skip to content

feat(ertp): ertp-only part of minimal want-patterns #11235

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

erights
Copy link
Member

@erights erights commented Apr 8, 2025

closes: #XXXX
refs: endojs/endo#2710 #1905 #1913 #1915 #2155 #2156 #2230 #4212 #4217 #10951 #10952

Description

Implements the ERTP part of minimal want patterns, where the only supported pattern is M.containerHas. #10952 then implements the zoe portion.

Security Considerations

none

Scaling Considerations

at the ERTP level, none.

Documentation Considerations

Need to update ERTP docs to explain the use of M.has patterns in AmountMath.isGTE and AmountMath.subtract.

Testing Considerations

ERTP tests already added.

Upgrade Considerations

None

  • Need to update NEWS.md for ERTP

@erights erights self-assigned this Apr 8, 2025
Copy link

cloudflare-workers-and-pages bot commented Apr 8, 2025

Deploying agoric-sdk with  Cloudflare Pages  Cloudflare Pages

Latest commit: 979da2a
Status: ✅  Deploy successful!
Preview URL: https://0caa23d4.agoric-sdk.pages.dev
Branch Preview URL: https://markm-want-patterns-only-ert.agoric-sdk.pages.dev

View logs

@erights erights force-pushed the markm-want-patterns-only-ertp branch from 2e4d932 to 979da2a Compare April 8, 2025 21:09
@@ -116,7 +116,7 @@ export const makeRatioFromAmounts = (numeratorAmount, denominatorAmount) => {
* @returns {Amount<'nat'>}
*/
const multiplyHelper = (amount, ratio, divideOp) => {
AmountMath.coerce(amount.brand, amount);
amount = AmountMath.coerce(amount.brand, amount);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A drive-by. coerce only produces a valid output from valid or almost-valid input. It does not validate or modify the input. So either we should use the result of coerce or we should remove it. Not sure yet whether this coerce is actually needed.

@@ -0,0 +1,60 @@
import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava.js';
import { M, makeCopySet } from '@endo/patterns';

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO do we also need a copyBagBoundMathHelpers.test.js?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant