Skip to content

Commit

Permalink
refactor(Auction!): make Auction use zcf.atomicRearrange() (#7904)
Browse files Browse the repository at this point in the history
refs: #6678
refs: #7900

## Description

update Auction to use `zcf.atomicRearrange()`.

This change must not be pushed to the chain before #7900.

### Security Considerations

None

### Scaling Considerations

None

### Documentation Considerations

None

### Testing Considerations

None

### Release considerations

This requires a change to Zoe (#7900). Since the Auction gets upgraded separately from Zoe, this is staged as a separate PR. Once #7900 is on chain, this update can be made, even if it's in the same release cycle, as long as Zoe is upgraded first. This change is independent of changes to other contracts.
  • Loading branch information
mergify[bot] authored Sep 4, 2024
2 parents 8787ee6 + 8f95618 commit c27a7e6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
7 changes: 2 additions & 5 deletions packages/inter-protocol/src/auction/auctionBook.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { M, prepareExoClassKit } from '@agoric/vat-data';

import { assertAllDefined, makeTracer } from '@agoric/internal';
import {
atomicRearrange,
ceilMultiplyBy,
makeRatioFromAmounts,
makeRecorderTopic,
Expand Down Expand Up @@ -311,8 +310,7 @@ export const prepareAuctionBook = (baggage, zcf, makeRecorderKit) => {
seat.exit('unable to satisfy want');
}

atomicRearrange(
zcf,
zcf.atomicRearrange(
harden([
[collateralSeat, seat, { Collateral: collateralTarget }],
[seat, bidHoldingSeat, { Bid: proceedsTarget }],
Expand Down Expand Up @@ -569,8 +567,7 @@ export const prepareAuctionBook = (baggage, zcf, makeRecorderKit) => {
state.startProceedsGoal = nextProceedsGoal;
}

atomicRearrange(
zcf,
zcf.atomicRearrange(
harden([[sourceSeat, collateralSeat, { Collateral: assetAmount }]]),
);

Expand Down
6 changes: 2 additions & 4 deletions packages/inter-protocol/src/auction/auctioneer.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { mustMatch } from '@agoric/store';
import { appendToStoredArray } from '@agoric/store/src/stores/store-utils.js';
import { M, provideDurableMapStore } from '@agoric/vat-data';
import {
atomicRearrange,
ceilDivideBy,
ceilMultiplyBy,
defineERecorderKit,
Expand Down Expand Up @@ -490,8 +489,7 @@ export const start = async (zcf, privateArgs, baggage) => {
// send it all to the one
const liqSeat = depositsForBrand[0].seat;

atomicRearrange(
zcf,
zcf.atomicRearrange(
harden([
[collateralSeat, liqSeat, collateralSeat.getCurrentAllocation()],
[bidHoldingSeat, liqSeat, bidHoldingSeat.getCurrentAllocation()],
Expand All @@ -514,7 +512,7 @@ export const start = async (zcf, privateArgs, baggage) => {
reserveSeat,
brand,
);
atomicRearrange(zcf, harden(transfers));
zcf.atomicRearrange(harden(transfers));

for (const { seat } of depositsForBrand) {
seat.exit();
Expand Down

0 comments on commit c27a7e6

Please sign in to comment.