Skip to content

Commit

Permalink
fix(liquidationVisibility): lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorge-Lopes committed Jan 22, 2024
1 parent 637a282 commit 4089361
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions packages/inter-protocol/src/vaultFactory/vaultManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import {
} from '@agoric/zoe/src/contractSupport/index.js';
import { PriceQuoteShape, SeatShape } from '@agoric/zoe/src/typeGuards.js';
import { E } from '@endo/eventual-send';
import { TimestampShape } from '@agoric/time';
import { AuctionPFShape } from '../auction/auctioneer.js';
import {
checkDebtLimit,
Expand All @@ -64,7 +65,6 @@ import { calculateMinimumCollateralization, minimumPrice } from './math.js';
import { makePrioritizedVaults } from './prioritizedVaults.js';
import { Phase, prepareVault } from './vault.js';
import { calculateDistributionPlan } from './proceeds.js';
import { TimestampShape } from '@agoric/time';

const { details: X, Fail, quote: q } = assert;

Expand Down Expand Up @@ -707,9 +707,17 @@ export const prepareVaultManagerKit = (
const { preAuctionState, postAuctionState, auctionResultState } =
liquidationPayloads;

preAuctionRecorderKit.recorder.writeFinal(preAuctionState);
postAuctionRecorderKit.recorder.writeFinal(postAuctionState);
auctionResultRecorderKit.recorder.writeFinal(auctionResultState);
const preAuctionResult = E(preAuctionRecorderKit.recorder).write(
preAuctionState,
);
const postAuctionResult = E(postAuctionRecorderKit.recorder).write(
postAuctionState,
);
const auctionResultResult = E(
auctionResultRecorderKit.recorder,
).write(auctionResultState);

return { preAuctionResult, postAuctionResult, auctionResultResult };
},

/**
Expand Down Expand Up @@ -762,7 +770,8 @@ export const prepareVaultManagerKit = (
* @returns {Promise<PreAuctionState>}
*/
async getPreAuctionState(vaultData) {
let preAuctionState = [];
const preAuctionState = [];
await null;
for (const [key, value] of vaultData.entries()) {
const { idInManager } = await E(key).getVaultState();
const preAuctionVaultData = {
Expand All @@ -786,7 +795,8 @@ export const prepareVaultManagerKit = (
*/
async getPostAuctionState(postAuctionProceeds) {
const postAuctionState = [];
for (let i = 0; i < postAuctionProceeds.length; i++) {
await null;
for (let i = 0; i < postAuctionProceeds.length; i += 1) {
const { keyword, amount, vault } = postAuctionProceeds[i];

const { idInManager, phase } = await E(vault).getVaultState();
Expand Down Expand Up @@ -1292,7 +1302,7 @@ export const prepareVaultManagerKit = (
},
/**
* @param {ERef<AuctioneerPublicFacet>} auctionPF
* @param {{ absValue: BigInt }} timestamp
* @param {{ absValue: bigint }} timestamp
*/
async liquidateVaults(auctionPF, timestamp) {
const { state, facets } = this;
Expand Down Expand Up @@ -1422,7 +1432,7 @@ export const prepareVaultManagerKit = (
collateralRemaining: plan.collatRemaining,
};

for (let i = 0; i < plan.transfersToVault.length; i++) {
for (let i = 0; i < plan.transfersToVault.length; i += 1) {
const transfer = plan.transfersToVault[i];
const keyword = Object.keys(transfer[1])[0];
const amount = Object.values(transfer[1])[0];
Expand Down

0 comments on commit 4089361

Please sign in to comment.