Skip to content

Commit

Permalink
refactor(PSM!): make PSM use zcf.atomicRearrange()
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris-Hibbert committed Aug 22, 2024
1 parent b84a426 commit 09fdaf9
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/inter-protocol/src/psm/psm.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
import { StorageNodeShape } from '@agoric/internal';
import { M, prepareExo, provide } from '@agoric/vat-data';
import {
atomicRearrange,
atomicTransfer,
ceilMultiplyBy,
floorDivideBy,
Expand Down Expand Up @@ -273,8 +272,7 @@ export const start = async (zcf, privateArgs, baggage) => {
const maxAnchor = floorMultiplyBy(afterFee, anchorPerMinted);
AmountMath.isGTE(maxAnchor, wanted) ||
Fail`wanted ${wanted} is more than ${given} minus fees ${fee}`;
atomicRearrange(
zcf,
zcf.atomicRearrange(
harden([
[seat, stage, { In: afterFee }, { Minted: afterFee }],
[seat, feePool, { In: fee }, { Minted: fee }],
Expand Down Expand Up @@ -305,8 +303,7 @@ export const start = async (zcf, privateArgs, baggage) => {
Fail`wanted ${wanted} is more than ${given} minus fees ${fee}`;
mintMinted(asStable);
try {
atomicRearrange(
zcf,
zcf.atomicRearrange(
harden([
[seat, anchorPool, { In: given }, { Anchor: given }],
[stage, seat, { Minted: afterFee }, { Out: afterFee }],
Expand Down

0 comments on commit 09fdaf9

Please sign in to comment.