diff --git a/a3p-integration/proposals/a:upgrade-next/priceFeed-follower-auction.test.js b/a3p-integration/proposals/a:upgrade-next/priceFeed-follower-auction.test.js deleted file mode 100644 index 30ae903b0754..000000000000 --- a/a3p-integration/proposals/a:upgrade-next/priceFeed-follower-auction.test.js +++ /dev/null @@ -1,8 +0,0 @@ -import test from 'ava'; -import { getDetailsMatchingVats } from './vatDetails.js'; - -test('new auction vat', async t => { - const details = await getDetailsMatchingVats('auctioneer'); - // This query matches both the auction and its governor, so 2*2 - t.is(Object.keys(details).length, 4); -}); diff --git a/a3p-integration/proposals/a:upgrade-next/probeZcfBundleCap.test.js b/a3p-integration/proposals/a:upgrade-next/probeZcfBundleCap.test.js deleted file mode 100644 index ef27a73f6498..000000000000 --- a/a3p-integration/proposals/a:upgrade-next/probeZcfBundleCap.test.js +++ /dev/null @@ -1,27 +0,0 @@ -import test from 'ava'; - -import { - evalBundles, - getIncarnation, - getVatDetails, -} from '@agoric/synthetic-chain'; - -const SUBMISSION_DIR = 'probe-submission'; - -test('upgrade Zoe to verify ZcfBundleCap endures', async t => { - await null; - t.assert((await getIncarnation('zoe')) === 1, 'zoe incarnation must be one'); - - // Before the test, the Wallet Factory should be using the legacy ZCF - const detailsBefore = await getVatDetails('walletFactory'); - t.true(detailsBefore.incarnation >= 2, 'wf incarnation must be >= 2'); - - await evalBundles(SUBMISSION_DIR); - - const detailsAfter = await getVatDetails('walletFactory'); - t.is( - detailsAfter.incarnation, - detailsBefore.incarnation + 2, - 'wf incarnation must increase by 2', - ); -}); diff --git a/a3p-integration/proposals/a:upgrade-next/provisioning.test.js b/a3p-integration/proposals/a:upgrade-next/provisioning.test.js deleted file mode 100644 index e31ffbb89a86..000000000000 --- a/a3p-integration/proposals/a:upgrade-next/provisioning.test.js +++ /dev/null @@ -1,51 +0,0 @@ -// @ts-check - -import test from 'ava'; -import { readFile, writeFile } from 'node:fs/promises'; - -import { - getIncarnation, - getUser, - evalBundles, - waitForBlock, - agoric, -} from '@agoric/synthetic-chain'; - -const SUBMISSION_DIR = 'provisioning-test-submission'; - -/** - * @param {string} fileName base file name without .tjs extension - * @param {Record} replacements - */ -const replaceTemplateValuesInFile = async (fileName, replacements) => { - let script = await readFile(`${fileName}.tjs`, 'utf-8'); - for (const [template, value] of Object.entries(replacements)) { - script = script.replaceAll(`{{${template}}}`, value); - } - await writeFile(`${fileName}.js`, script); -}; - -test.serial(`provisioning vat was upgraded`, async t => { - const incarnation = await getIncarnation('provisioning'); - - t.is(incarnation, 1); -}); - -test.serial(`send invitation via namesByAddress`, async t => { - const addr = await getUser('gov1'); - - await replaceTemplateValuesInFile(`${SUBMISSION_DIR}/send-script`, { - ADDRESS: addr, - }); - - await evalBundles(SUBMISSION_DIR); - - await waitForBlock(2); // enough time for invitation to arrive? - const update = await agoric.follow('-lF', `:published.wallet.${addr}`); - t.is(update.updated, 'balance'); - t.notDeepEqual(update.currentAmount.value, []); - t.log('balance value', update.currentAmount.value); - t.log('balance brand', update.currentAmount.brand); - // XXX agoric follow returns brands as strings - t.regex(update.currentAmount.brand, /Invitation/); -}); diff --git a/a3p-integration/proposals/a:upgrade-next/upgradeVaults.test.js b/a3p-integration/proposals/a:upgrade-next/upgradeVaults.test.js deleted file mode 100644 index 1dc1c6622328..000000000000 --- a/a3p-integration/proposals/a:upgrade-next/upgradeVaults.test.js +++ /dev/null @@ -1,134 +0,0 @@ -import test from 'ava'; - -import { - agops, - ATOM_DENOM, - getISTBalance, - getVatDetails, - openVault, - USER1ADDR, -} from '@agoric/synthetic-chain'; - -import { - addOraclesForBrand, - bankSend, - BID_OFFER_ID, - checkForOracle, - createBid, - getLiveOffers, - getPriceQuote, - pushPrices, -} from './agd-tools.js'; -import { getDetailsMatchingVats } from './vatDetails.js'; - -const checkPriceFeedVatsUpdated = async t => { - const atomDetails = await getVatDetails('ATOM-USD_price_feed'); - // both the original and the new ATOM vault are incarnation 0 - t.is(atomDetails.incarnation, 0); - const stAtomDetails = await getVatDetails('stATOM'); - t.is(stAtomDetails.incarnation, 0); - const stOsmoDetails = await getVatDetails('stOSMO'); - t.is(stOsmoDetails.incarnation, 0); - const stTiaDetails = await getVatDetails('stTIA'); - t.is(stTiaDetails.incarnation, 0); - await Promise.all([ - checkForOracle(t, 'ATOM'), - checkForOracle(t, 'stATOM'), - checkForOracle(t, 'stTIA'), - checkForOracle(t, 'stOSMO'), - checkForOracle(t, 'stkATOM'), - ]); -}; - -const oraclesByBrand = new Map(); - -const tryPushPrices = async t => { - // There are no old prices for the other currencies. - const atomOutPre = await getPriceQuote('ATOM'); - t.is(atomOutPre, '+12010000'); - - t.log('adding oracle for each brand'); - await addOraclesForBrand('ATOM', oraclesByBrand); - await addOraclesForBrand('stATOM', oraclesByBrand); - await addOraclesForBrand('stTIA', oraclesByBrand); - await addOraclesForBrand('stOSMO', oraclesByBrand); - await addOraclesForBrand('stkATOM', oraclesByBrand); - - t.log('pushing new prices'); - await pushPrices(11.2, 'ATOM', oraclesByBrand); - await pushPrices(11.3, 'stTIA', oraclesByBrand); - await pushPrices(11.4, 'stATOM', oraclesByBrand); - await pushPrices(11.5, 'stOSMO', oraclesByBrand); - await pushPrices(11.6, 'stkATOM', oraclesByBrand); - - t.log('awaiting new quotes'); - const atomOut = await getPriceQuote('ATOM'); - t.is(atomOut, '+11200000'); - const tiaOut = await getPriceQuote('stTIA'); - t.is(tiaOut, '+11300000'); - const stAtomOut = await getPriceQuote('stATOM'); - t.is(stAtomOut, '+11400000'); - const osmoOut = await getPriceQuote('stOSMO'); - t.is(osmoOut, '+11500000'); - const stkAtomOut = await getPriceQuote('stkATOM'); - t.is(stkAtomOut, '+11600000'); -}; - -const createNewBid = async t => { - await createBid('20', USER1ADDR, BID_OFFER_ID); - const liveOffer = await getLiveOffers(USER1ADDR); - t.true(liveOffer[0].includes(BID_OFFER_ID)); -}; - -const openMarginalVault = async t => { - let user1IST = await getISTBalance(USER1ADDR); - await bankSend(USER1ADDR, `20000000${ATOM_DENOM}`); - const currentVaults = await agops.vaults('list', '--from', USER1ADDR); - - t.log('opening a vault'); - await openVault(USER1ADDR, 5, 10); - user1IST += 5; - const istBalanceAfterVaultOpen = await getISTBalance(USER1ADDR); - t.is(istBalanceAfterVaultOpen, user1IST); - - const activeVaultsAfter = await agops.vaults('list', '--from', USER1ADDR); - t.log(currentVaults, activeVaultsAfter); - t.true( - activeVaultsAfter.length > currentVaults.length, - `vaults count should increase, ${activeVaultsAfter.length}, ${currentVaults.length}`, - ); -}; - -const triggerAuction = async t => { - await pushPrices(5.2, 'ATOM', oraclesByBrand); - - const atomOut = await getPriceQuote('ATOM'); - t.is(atomOut, '+5200000'); -}; - -const makeNewAuctionVat = async t => { - const details = await getDetailsMatchingVats('auctioneer'); - // This query matches both the auction and its governor, so double the count - t.true(Object.keys(details).length > 2); -}; - -// test.serial() isn't guaranteed to run tests in order, so we run the intended tests here -test('liquidation post upgrade', async t => { - t.log('starting upgrade vaults test'); - await checkPriceFeedVatsUpdated(t); - - t.log('starting pushPrices'); - await tryPushPrices(t); - - t.log('create a new Bid for the auction'); - await createNewBid(t); - - t.log('open a marginal vault'); - await openMarginalVault(t); - - t.log('trigger Auction'); - await triggerAuction(t); - - t.log('make new auction'); - await makeNewAuctionVat(t); -}); diff --git a/packages/vats/src/proposals/upgrade-zoe-proposal.js b/packages/vats/src/proposals/upgrade-zoe-proposal.js index 6ae75e32088a..8d9e9210b9e2 100644 --- a/packages/vats/src/proposals/upgrade-zoe-proposal.js +++ b/packages/vats/src/proposals/upgrade-zoe-proposal.js @@ -11,7 +11,7 @@ import { E } from '@endo/far'; * }; * }} powers * @param {object} options - * @param {{ zoeRef: VatSourceRef; zcfRef: VatSourceRef }} options.options + * @param {{ zoeRef: VatSourceRef }} options.options */ export const upgradeZoe = async ( { consume: { vatAdminSvc, vatStore } },