Skip to content

Commit

Permalink
fix: ironically, use upcoming API before it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
erights committed Feb 23, 2022
1 parent 6c6d8f6 commit 4b71145
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/ERTP/src/purse.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Far } from '@endo/marshal';
import { makeNotifierKit } from '@agoric/notifier';
import { defineKind } from '@agoric/swingset-vat/src/storeModule.js';
import { AmountMath } from './amountMath.js';
Expand Down Expand Up @@ -40,7 +39,7 @@ export const makePurseMaker = (allegedName, assetKind, brand, purseMethods) => {
state.currentBalance = newPurseBalance;
state.balanceUpdater.updateState(newPurseBalance);
};
const purse = Far(purseName, {
return {
deposit: (srcPayment, optAmountShape = undefined) => {
// Note COMMIT POINT within deposit.
return purseMethods.deposit(
Expand All @@ -61,10 +60,11 @@ export const makePurseMaker = (allegedName, assetKind, brand, purseMethods) => {
getCurrentAmountNotifier: () => state.balanceNotifier,
getAllegedBrand: () => brand,
getDepositFacet: () => state.depositFacet,
});
// Close the cycle
};
},
// Close the cycle
(state, purse) => {
state.depositFacet = makeDepositFacet(purse);
return purse;
},
);
harden(makePurse);
Expand Down

0 comments on commit 4b71145

Please sign in to comment.