Skip to content
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

BREAKING CHANGE: remove old amountMath #2894

Merged
merged 9 commits into from
Apr 22, 2021

Conversation

katelynsills
Copy link
Contributor

@katelynsills katelynsills commented Apr 16, 2021

Merging is blocked by removing the old amountMath in the dapps (#2603), but we can still get it reviewed.

@katelynsills katelynsills force-pushed the 2602-remove-old-amount-math branch from b74a863 to f6dbb33 Compare April 16, 2021 23:31
@katelynsills katelynsills changed the title chore: remove old amountMath BREAKING CHANGE: remove old amountMath Apr 17, 2021
@katelynsills katelynsills force-pushed the 2602-remove-old-amount-math branch 2 times, most recently from 5979e05 to 963a8a1 Compare April 17, 2021 01:33
@katelynsills katelynsills self-assigned this Apr 19, 2021
@katelynsills
Copy link
Contributor Author

@erights, I think the majority of the review is for you but @michaelfig could you check on the wallet and any other code you're the owner for? And @FUDCo I made some changes to swingset-runner tests. Thanks!

Copy link
Contributor

@FUDCo FUDCo left a comment

Choose a reason for hiding this comment

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

The changes to the swingset-runner tests look fine. Overall, very tidy for something that touches so many files. The cleanerness (is that a word?) of the new API really comes through when you look at all the diffs.

@katelynsills
Copy link
Contributor Author

Adding @Chris-Hibbert to take over part or all of @erights's review. @Chris-Hibbert, can you check ERTP and Zoe especially? Thanks!

Copy link
Contributor

@Chris-Hibbert Chris-Hibbert left a comment

Choose a reason for hiding this comment

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

one tiny cleanup, and one oversight. Looks good!


const result = await Promise.all([emptyPurseMadeP, localAmountMathSavedP]);
const result = await emptyPurseMadeP;
Copy link
Contributor

Choose a reason for hiding this comment

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

might as well get rid of emptyPurseMadeP, and await makeEmptyPurse(). Actually, can't the log message go before the await, and this can just return the awaited value?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup, I think that's right

const { offer } = makeOfferAndFindInvitationAmount(
walletAdmin,
zoe,
zoeInvitationPurse,
getLocalAmountMath,
invitationMath,
invitationBrand,
Copy link
Contributor

Choose a reason for hiding this comment

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

It doesn't look like brand was added to makeOfferAndFindInvitationAmount.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch!

Copy link
Member

@dtribble dtribble left a comment

Choose a reason for hiding this comment

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

WIP 21/50 reviewed

packages/cosmic-swingset/lib/ag-solo/vats/bootstrap.js Outdated Show resolved Hide resolved
@@ -166,7 +166,7 @@ test('lib-wallet issuer and purse methods', async t => {
const moolaPurse = wallet.getPurse('fun money');
t.deepEqual(
await moolaPurse.getCurrentAmount(),
moolaBundle.amountMath.getEmpty(),
amountMath.makeEmpty(moolaBundle.brand, MathKind.NAT),
Copy link
Member

Choose a reason for hiding this comment

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

Minor: This code would be easier to manage if the brands were pulled out into their own variables?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that's out of scope for this PR, and also it's a test so refactoring is probably lower priority.

@katelynsills katelynsills force-pushed the 2602-remove-old-amount-math branch from 0c49ca9 to fa884ba Compare April 21, 2021 21:47
@katelynsills katelynsills merged commit 4887515 into master Apr 22, 2021
@katelynsills katelynsills deleted the 2602-remove-old-amount-math branch April 22, 2021 17:51
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.

4 participants