Skip to content

Commit 593e65c

Browse files
committed
refactor: use named fields in atomicRearrange
1 parent fd8d9ec commit 593e65c

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

contract/src/offer-up.contract.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { Far } from '@endo/far';
2323
import { M, getCopyBagEntries } from '@endo/patterns';
2424
import { AssetKind } from '@agoric/ertp/src/amountMath.js';
2525
import { AmountShape } from '@agoric/ertp/src/typeGuards.js';
26-
import { atomicRearrange } from '@agoric/zoe/src/contractSupport/atomicTransfer.js';
26+
import { atomicRearrange } from './platform-goals/zcfTools.js';
2727
import '@agoric/zoe/exported.js';
2828

2929
const { Fail, quote: q } = assert;
@@ -107,15 +107,11 @@ export const start = async zcf => {
107107
Fail`max ${q(maxItems)} items allowed: ${q(want.Items)}`;
108108

109109
const newItems = itemMint.mintGains(want);
110-
atomicRearrange(
111-
zcf,
112-
harden([
113-
// price from buyer to proceeds
114-
[buyerSeat, proceeds, { Price: tradePrice }],
115-
// new items to buyer
116-
[newItems, buyerSeat, want],
117-
]),
118-
);
110+
const charge = { Price: tradePrice };
111+
atomicRearrange(zcf, [
112+
{ fromSeat: buyerSeat, toSeat: proceeds, fromAmounts: charge },
113+
{ fromSeat: newItems, toSeat: buyerSeat, fromAmounts: want },
114+
]);
119115

120116
buyerSeat.exit(true);
121117
newItems.exit();

0 commit comments

Comments
 (0)