From ac5b1282113efdf3af3cb37e85dff33ff41ec637 Mon Sep 17 00:00:00 2001 From: Chris Hibbert Date: Thu, 8 Jun 2023 16:08:59 -0700 Subject: [PATCH] refactor(vaultFactory!): vaultFactory use zcf.atomicRearrange --- packages/inter-protocol/src/vaultFactory/liquidation.js | 3 +-- packages/inter-protocol/src/vaultFactory/vaultDirector.js | 3 +-- packages/inter-protocol/src/vaultFactory/vaultManager.js | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/inter-protocol/src/vaultFactory/liquidation.js b/packages/inter-protocol/src/vaultFactory/liquidation.js index 2c992d15086..cd378d2989c 100644 --- a/packages/inter-protocol/src/vaultFactory/liquidation.js +++ b/packages/inter-protocol/src/vaultFactory/liquidation.js @@ -5,7 +5,6 @@ import { makeTracer } from '@agoric/internal'; import { observeIteration, subscribeEach } from '@agoric/notifier'; import { makeScalarMapStore } from '@agoric/store'; import { TimeMath } from '@agoric/time'; -import { atomicRearrange } from '@agoric/zoe/src/contractSupport/index.js'; import { E } from '@endo/eventual-send'; import { AUCTION_START_DELAY, PRICE_LOCK_PERIOD } from '../auction/params.js'; @@ -302,7 +301,7 @@ export const getLiquidatableVaults = ( } if (transfers.length > 0) { - atomicRearrange(zcf, harden(transfers)); + zcf.atomicRearrange(harden(transfers)); } return { vaultData, totalDebt, totalCollateral, liqSeat }; diff --git a/packages/inter-protocol/src/vaultFactory/vaultDirector.js b/packages/inter-protocol/src/vaultFactory/vaultDirector.js index 3087402baf2..fdfa8d2f9d9 100644 --- a/packages/inter-protocol/src/vaultFactory/vaultDirector.js +++ b/packages/inter-protocol/src/vaultFactory/vaultDirector.js @@ -18,7 +18,6 @@ import { } from '@agoric/vat-data'; import { assertKeywordName } from '@agoric/zoe/src/cleanProposal.js'; import { - atomicRearrange, makeRecorderTopic, provideEmptySeat, SubscriberShape, @@ -231,7 +230,7 @@ const prepareVaultDirector = ( [mintSeat, mintReceiver, { Minted: kept }], ]; try { - atomicRearrange(zcf, harden(transfers)); + zcf.atomicRearrange(harden(transfers)); } catch (e) { console.error('mintAndTransfer failed to rearrange', e); // If the rearrange fails, burn the newly minted tokens. diff --git a/packages/inter-protocol/src/vaultFactory/vaultManager.js b/packages/inter-protocol/src/vaultFactory/vaultManager.js index f760a3ba9ec..20ffb29ab71 100644 --- a/packages/inter-protocol/src/vaultFactory/vaultManager.js +++ b/packages/inter-protocol/src/vaultFactory/vaultManager.js @@ -39,7 +39,6 @@ import { } from '@agoric/vat-data'; import { TransferPartShape } from '@agoric/zoe/src/contractSupport/atomicTransfer.js'; import { - atomicRearrange, ceilMultiplyBy, floorDivideBy, getAmountIn, @@ -757,7 +756,7 @@ export const prepareVaultManagerKit = ( amounts, ]), ); - atomicRearrange(zcf, harden(transfers)); + zcf.atomicRearrange(harden(transfers)); } const { prioritizedVaults } = collateralEphemera(