diff --git a/packages/inter-protocol/test/liquidationVisibility/snapshots/test-liquidationVisibility.js.md b/packages/inter-protocol/test/liquidationVisibility/snapshots/test-liquidationVisibility.js.md index d66565465dd..8394cbe6d06 100644 --- a/packages/inter-protocol/test/liquidationVisibility/snapshots/test-liquidationVisibility.js.md +++ b/packages/inter-protocol/test/liquidationVisibility/snapshots/test-liquidationVisibility.js.md @@ -11,107 +11,157 @@ Generated by [AVA](https://avajs.dev). > > See also board marshalling conventions (_to appear_). - [] + [ + [ + 'published.vaultFactory.managers.manager0.liquidations.3600.auctionResult', + { + collateralForReserve: { + brand: Object @Alleged: aEth brand {}, + value: 0n, + }, + collateralOffered: { + brand: Object @Alleged: aEth brand {}, + value: 700n, + }, + collateralRemaining: { + brand: Object @Alleged: aEth brand {}, + value: 0n, + }, + collateralSold: { + brand: Object @Alleged: aEth brand {}, + value: 700n, + }, + endTime: { + absValue: 3614n, + timerBrand: Object @Alleged: timerBrand {}, + }, + istTarget: { + brand: Object @Alleged: ZDEFAULT brand {}, + value: 5250n, + }, + mintedProceeds: { + brand: Object @Alleged: ZDEFAULT brand {}, + value: 3185n, + }, + shortfallToReserve: { + brand: Object @Alleged: ZDEFAULT brand {}, + value: 2065n, + }, + }, + ], + [ + 'published.vaultFactory.managers.manager0.liquidations.3600.vaults.postAuction', + [], + ], + [ + 'published.vaultFactory.managers.manager0.liquidations.3600.vaults.preAuction', + [ + [ + 'vault0', + { + collateralAmount: { + brand: Object @Alleged: aEth brand {}, + value: 700n, + }, + debtAmount: { + brand: Object @Alleged: ZDEFAULT brand {}, + value: 5250n, + }, + }, + ], + ], + ], + ] -## test liquidate vault with snapshot +## liq-result-scenario-3 -> Under "published", the "auction" node is delegated to the auctioneer contract. +> Scenario 3 Liquidation Visibility Snapshot > The example below illustrates the schema of the data published there. > > See also board marshalling conventions (_to appear_). [ [ - 'published.auction.book0', + 'published.vaultFactory.managers.manager0.liquidations.3600.auctionResult', { - collateralAvailable: { + collateralForReserve: { brand: Object @Alleged: aEth brand {}, - value: 0n, + value: 12n, }, - currentPriceLevel: null, - proceedsRaised: undefined, - remainingProceedsGoal: null, - startCollateral: { + collateralOffered: { brand: Object @Alleged: aEth brand {}, - value: 0n, + value: 63n, + }, + collateralRemaining: { + brand: Object @Alleged: aEth brand {}, + value: 5n, + }, + collateralSold: { + brand: Object @Alleged: aEth brand {}, + value: 8n, + }, + endTime: { + absValue: 3614n, + timerBrand: Object @Alleged: timerBrand {}, + }, + istTarget: { + brand: Object @Alleged: ZDEFAULT brand {}, + value: 258n, + }, + mintedProceeds: { + brand: Object @Alleged: ZDEFAULT brand {}, + value: 34n, + }, + shortfallToReserve: { + brand: Object @Alleged: ZDEFAULT brand {}, + value: 66n, }, - startPrice: null, - startProceedsGoal: null, }, ], [ - 'published.auction.governance', - { - current: { - AuctionStartDelay: { - type: 'relativeTime', - value: { - relValue: 10n, - timerBrand: Object @Alleged: timerBrand {}, + 'published.vaultFactory.managers.manager0.liquidations.3600.vaults.postAuction', + [ + [ + 'vault1', + { + Collateral: { + brand: Object @Alleged: aEth brand {}, + value: 43n, }, + phase: 'active', }, - ClockStep: { - type: 'relativeTime', - value: { - relValue: 2n, - timerBrand: Object @Alleged: timerBrand {}, + ], + ], + ], + [ + 'published.vaultFactory.managers.manager0.liquidations.3600.vaults.preAuction', + [ + [ + 'vault0', + { + collateralAmount: { + brand: Object @Alleged: aEth brand {}, + value: 15n, }, - }, - DiscountStep: { - type: 'nat', - value: 2000n, - }, - Electorate: { - type: 'invitation', - value: { - brand: Object @Alleged: Zoe Invitation brand {}, - value: [ - { - description: 'questionPoser', - handle: Object @Alleged: InvitationHandle {}, - installation: Object @Alleged: BundleInstallation {}, - instance: Object @Alleged: InstanceHandle {}, - }, - ], + debtAmount: { + brand: Object @Alleged: ZDEFAULT brand {}, + value: 100n, }, }, - LowestRate: { - type: 'nat', - value: 5500n, - }, - PriceLockPeriod: { - type: 'relativeTime', - value: { - relValue: 3n, - timerBrand: Object @Alleged: timerBrand {}, + ], + [ + 'vault1', + { + collateralAmount: { + brand: Object @Alleged: aEth brand {}, + value: 48n, }, - }, - StartFrequency: { - type: 'relativeTime', - value: { - relValue: 3600n, - timerBrand: Object @Alleged: timerBrand {}, + debtAmount: { + brand: Object @Alleged: ZDEFAULT brand {}, + value: 158n, }, }, - StartingRate: { - type: 'nat', - value: 10500n, - }, - }, - }, - ], - [ - 'published.auction.schedule', - { - activeStartTime: null, - nextDescendingStepTime: { - absValue: 7210n, - timerBrand: Object @Alleged: timerBrand {}, - }, - nextStartTime: { - absValue: 7210n, - timerBrand: Object @Alleged: timerBrand {}, - }, - }, + ], + ], ], ] diff --git a/packages/inter-protocol/test/liquidationVisibility/snapshots/test-liquidationVisibility.js.snap b/packages/inter-protocol/test/liquidationVisibility/snapshots/test-liquidationVisibility.js.snap index 386cc36aaea..514bb3fe779 100644 Binary files a/packages/inter-protocol/test/liquidationVisibility/snapshots/test-liquidationVisibility.js.snap and b/packages/inter-protocol/test/liquidationVisibility/snapshots/test-liquidationVisibility.js.snap differ diff --git a/packages/inter-protocol/test/liquidationVisibility/test-liquidationVisibility.js b/packages/inter-protocol/test/liquidationVisibility/test-liquidationVisibility.js index 532442152cd..0a6d709c47e 100644 --- a/packages/inter-protocol/test/liquidationVisibility/test-liquidationVisibility.js +++ b/packages/inter-protocol/test/liquidationVisibility/test-liquidationVisibility.js @@ -435,7 +435,7 @@ test('liq-result-scenario-2', async t => { // TODO: Snapshot here await documentStorageSchema(t, chainStorage, { note: 'Scenario 2 Liquidation Visibility Snapshot', - node: `vaultFactory.managers.manager0.liquidations.${now1.toString()}`, + node: `vaultFactory.managers.manager0.liquidations.${now1.absValue.toString()}`, }); }); @@ -456,7 +456,6 @@ test('liq-result-scenario-3', async t => { aeth.make(1n), manualTimer, ONE_WEEK, - 500n, { StartFrequency: ONE_HOUR }, ); @@ -583,7 +582,7 @@ test('liq-result-scenario-3', async t => { await assertStorageData({ t, storageRoot: chainStorage, - path: `vaultFactory.managers.manager0.liquidations.${time}.preAuction`, // time is the nominal start time + path: `vaultFactory.managers.manager0.liquidations.${time.absValue.toString()}.vaults.preAuction`, // time is the nominal start time expected: [ [ 'vault0', // Alice's vault @@ -595,8 +594,8 @@ test('liq-result-scenario-3', async t => { [ 'vault1', // Bob's vault { - collateral: bobCollateralAmount, - debt: await E(bobVault).getCurrentDebt(), + collateralAmount: bobCollateralAmount, + debtAmount: await E(bobVault).getCurrentDebt(), }, ], ], @@ -672,21 +671,12 @@ test('liq-result-scenario-3', async t => { await assertStorageData({ t, storageRoot: chainStorage, - path: `vaultFactory.managers.manager0.liquidations.${time}.postAuction`, // time is the nominal start time + path: `vaultFactory.managers.manager0.liquidations.${time.absValue.toString()}.vaults.postAuction`, // time is the nominal start time expected: [ - [ - 'vault0', // Alice got liquidated - { - collateral: aeth.makeEmpty(), - debt: run.makeEmpty(), - phase: Phase.LIQUIDATED, - }, - ], [ 'vault1', // Bob got reinstated { - collateral: recoveredBobCollateral, - debt: run.make(158n), + Collateral: recoveredBobCollateral, phase: Phase.ACTIVE, }, ], @@ -697,8 +687,10 @@ test('liq-result-scenario-3', async t => { await assertStorageData({ t, storageRoot: chainStorage, - path: `vaultFactory.managers.manager0.liquidations.${time}.auctionResult`, // now1 is the nominal start time + path: `vaultFactory.managers.manager0.liquidations.${time.absValue.toString()}.auctionResult`, // now1 is the nominal start time expected: { + collateralOffered: aeth.make(63n), + istTarget: run.make(258n), collateralForReserve: aeth.make(12n), shortfallToReserve: run.make(66n), mintedProceeds: run.make(34n), @@ -711,6 +703,6 @@ test('liq-result-scenario-3', async t => { // TODO: Snapshot here await documentStorageSchema(t, chainStorage, { note: 'Scenario 3 Liquidation Visibility Snapshot', - node: `vaultFactory.managers.manager0.liquidations.${time}`, + node: `vaultFactory.managers.manager0.liquidations.${time.absValue.toString()}`, }); });