From fc7e6b9909dc7b9d6dfa80b90145f435a7c81b1a Mon Sep 17 00:00:00 2001 From: Ikenna Omekam Date: Wed, 18 Dec 2024 11:06:30 -0500 Subject: [PATCH 1/7] test(psm): start adding a3p testing for psm upgrades --- .../proposals/p:upgrade-19/.gitignore | 1 + .../proposals/p:upgrade-19/package.json | 1 + .../proposals/p:upgrade-19/psm.test.js | 88 +++++++++++++++++++ .../proposals/p:upgrade-19/test.sh | 12 +-- 4 files changed, 97 insertions(+), 5 deletions(-) create mode 100644 a3p-integration/proposals/p:upgrade-19/psm.test.js diff --git a/a3p-integration/proposals/p:upgrade-19/.gitignore b/a3p-integration/proposals/p:upgrade-19/.gitignore index 57c4873daf7..5c8ebecc364 100644 --- a/a3p-integration/proposals/p:upgrade-19/.gitignore +++ b/a3p-integration/proposals/p:upgrade-19/.gitignore @@ -6,3 +6,4 @@ upgradeProvisionPool/ upgradeAgoricNames/ publishTestInfo/ upgrade-mintHolder/ +upgradePSM/ diff --git a/a3p-integration/proposals/p:upgrade-19/package.json b/a3p-integration/proposals/p:upgrade-19/package.json index bdd9490ec35..f0d567f0eea 100644 --- a/a3p-integration/proposals/p:upgrade-19/package.json +++ b/a3p-integration/proposals/p:upgrade-19/package.json @@ -5,6 +5,7 @@ "testing/replace-feeDistributor-short.js replaceFeeDistributor", "testing/add-USD-LEMONS.js addUsdLemons", "vats/upgrade-provisionPool.js upgradeProvisionPool", + "vats/upgrade-psm.js upgradePSM", "vats/upgrade-paRegistry.js", "vats/upgrade-board.js", "testing/test-upgraded-board.js testUpgradedBoard", diff --git a/a3p-integration/proposals/p:upgrade-19/psm.test.js b/a3p-integration/proposals/p:upgrade-19/psm.test.js new file mode 100644 index 00000000000..ce7bc9cbea8 --- /dev/null +++ b/a3p-integration/proposals/p:upgrade-19/psm.test.js @@ -0,0 +1,88 @@ +/* eslint-env node */ +/** + * @file The goal of this file is to make sure v28-provisionPool and v14-bank can be successfully + * upgraded. These vats are related because of the issues below; + * - https://github.com/Agoric/agoric-sdk/issues/8722 + * - https://github.com/Agoric/agoric-sdk/issues/8724 + * + * The test scenario is as follows; + * 1. Upgrade provisionPool. This upgrade overrides provisionWalletBridgerManager with a durable one + * 2. Add a new account and successfully provision it + * - Observe new account's address under `published.wallet.${address}` + * 3. Send some USDC_axl to provisionPoolAddress and observe its IST balances increases accordingly + * 4. Introduce a new asset to the chain and start a PSM instance for the new asset + * 4a. Deposit some of that asset to provisionPoolAddress + * 4b. Observe provisionPoolAddress' IST balance increase by the amount deposited in step 4a + * 5. Perform a null upgrade for provisionPool. This upgrade does NOT override provisionWalletBridgerManager + * - The goal here is to allow testing the bridgeHandler from the first upgrade is in fact durable + * 6. Auto provision + * 6a. Introduce a new account + * 6b. Fund it with IST and ATOM to be able to open a vault + * 6c. Try to open a vault WITHOUT provisioning the newly introduced account + * 6d. Observe the new account's address under `published.wallet` + * 7. Same as step 2. Checks manual provision works after null upgrade + */ + +import '@endo/init'; +import test from 'ava'; +import { + addUser, + evalBundles, + agd as agdAmbient, + agoric, + getISTBalance, + getDetailsMatchingVats, + GOV1ADDR, + openVault, + ATOM_DENOM, +} from '@agoric/synthetic-chain'; +import { + makeVstorageKit, + waitUntilAccountFunded, + waitUntilContractDeployed, +} from '@agoric/client-utils'; +import { NonNullish } from '@agoric/internal'; +import { + bankSend, + checkUserProvisioned, + introduceAndProvision, + provision, +} from './test-lib/provision-helpers.js'; + +const ADD_PSM_DIR = 'addUsdLemons'; +const DEPOSIT_USD_LEMONS_DIR = 'depositUSD-LEMONS'; +const UPGRADE_PSM_DIR = 'upgradePSM'; +const NULL_UPGRADE_PP_DIR = 'nullUpgradePP'; + +const USDC_DENOM = NonNullish(process.env.USDC_DENOM); + +const ambientAuthority = { + query: agdAmbient.query, + follow: agoric.follow, + setTimeout, + log: console.log, +}; + +test.before(async t => { + const vstorageKit = await makeVstorageKit( + { fetch }, + { rpcAddrs: ['http://localhost:26657'], chainName: 'agoriclocal' }, + ); + + t.context = { + vstorageKit, + }; +}); + +test.serial('upgrade provisionPool', async t => { + await evalBundles(UPGRADE_PSM_DIR); + + // const vatDetailsAfter = await getDetailsMatchingVats('provisionPool'); + // const { incarnation } = vatDetailsAfter.find(vat => + // vat.vatName.endsWith('provisionPool'), + // ); + + // t.log(vatDetailsAfter); + // t.is(incarnation, 1, 'incorrect incarnation'); + t.pass(); +}); diff --git a/a3p-integration/proposals/p:upgrade-19/test.sh b/a3p-integration/proposals/p:upgrade-19/test.sh index f42147483ef..818c50e7886 100644 --- a/a3p-integration/proposals/p:upgrade-19/test.sh +++ b/a3p-integration/proposals/p:upgrade-19/test.sh @@ -1,7 +1,9 @@ #!/bin/bash -yarn ava replaceFeeDistributor.test.js -yarn ava upgradedBoard.test.js -yarn ava mintHolder.test.js -yarn ava provisionPool.test.js -yarn ava agoricNames.test.js +# yarn ava replaceFeeDistributor.test.js +# yarn ava upgradedBoard.test.js +# yarn ava mintHolder.test.js +# yarn ava provisionPool.test.js +# yarn ava agoricNames.test.js + +yarn ava psm.test.js From a78340415d7d118eab1746e5e465db48d0015529 Mon Sep 17 00:00:00 2001 From: Ikenna Omekam Date: Wed, 18 Dec 2024 11:07:12 -0500 Subject: [PATCH 2/7] feat(psm): add upgrade proposal --- packages/builders/scripts/vats/upgrade-psm.js | 21 +++++ .../src/proposals/upgrade-psm-proposal.js | 80 +++++++++++++++++++ 2 files changed, 101 insertions(+) create mode 100644 packages/builders/scripts/vats/upgrade-psm.js create mode 100644 packages/vats/src/proposals/upgrade-psm-proposal.js diff --git a/packages/builders/scripts/vats/upgrade-psm.js b/packages/builders/scripts/vats/upgrade-psm.js new file mode 100644 index 00000000000..6f222922d48 --- /dev/null +++ b/packages/builders/scripts/vats/upgrade-psm.js @@ -0,0 +1,21 @@ +import { makeHelpers } from '@agoric/deploy-script-support'; + +/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */ +export const defaultProposalBuilder = async ({ publishRef, install }) => + harden({ + sourceSpec: '@agoric/vats/src/proposals/upgrade-psm-proposal.js', + getManifestCall: [ + 'getManifestForUpgradingPSM', + { + psmRef: publishRef( + install('@agoric/inter-protocol/src/psm/psm.js'), + ), + }, + ], + }); + +/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */ +export default async (homeP, endowments) => { + const { writeCoreProposal } = await makeHelpers(homeP, endowments); + await writeCoreProposal('upgrade-psm', defaultProposalBuilder); +}; diff --git a/packages/vats/src/proposals/upgrade-psm-proposal.js b/packages/vats/src/proposals/upgrade-psm-proposal.js new file mode 100644 index 00000000000..ab5d5a0bcc7 --- /dev/null +++ b/packages/vats/src/proposals/upgrade-psm-proposal.js @@ -0,0 +1,80 @@ +import { E } from '@endo/far'; +import { deeplyFulfilled } from '@endo/marshal'; +import { makeTracer } from '@agoric/internal'; + +const trace = makeTracer('UpgradePSM'); + +/** + * @param {BootstrapPowers & { + * consume: { + * economicCommitteeCreatorFacet: any; + * psmKit: any; + * }; + * }} powers + * @param {object} options + * @param {{ + * psmRef: VatSourceRef; + * }} options.options + */ +export const upgradePSMProposal = async ( + { + consume: { + psmKit: psmKitP, + economicCommitteeCreatorFacet: electorateCreatorFacet, + instancePrivateArgs: instancePrivateArgsP, + }, + }, + options, +) => { + const { psmRef } = options.options; + + trace(`PSM BUNDLE ID: `, psmRef); + + const [ + psmKitMap, + instancePrivateArgs, + ] = await Promise.all([ + psmKitP, + instancePrivateArgsP, + ]); + + for (const { psm, psmAdminFacet, label } of psmKitMap.values()) { + const [originalPrivateArgs, poserInvitation] = await Promise.all([ + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore Local tsc sees this as an error but typedoc does not + deeplyFulfilled(instancePrivateArgs.get(psm)), + E(electorateCreatorFacet).getPoserInvitation(), + ]); + + const newPrivateArgs = harden({ + ...originalPrivateArgs, + initialPoserInvitation: poserInvitation, + }); + + const upgradeResult = await E(psmAdminFacet).upgradeContract( + psmRef.bundleID, + newPrivateArgs, + ); + + trace(`PSM ${label} upgraded: `, upgradeResult); + } + + trace('Done.'); +}; + +export const getManifestForUpgradingPSM = ( + _powers, + { psmRef }, +) => ({ + manifest: { + [upgradePSMProposal.name]: { + consume: { + psmKit: true, + economicCommitteeCreatorFacet: true, + instancePrivateArgs: true, + }, + produce: {}, + }, + }, + options: { psmRef }, +}); From 94a534bc2f3499da2811db6d1785f92ef0e116db Mon Sep 17 00:00:00 2001 From: Ikenna Omekam Date: Fri, 20 Dec 2024 01:26:03 -0500 Subject: [PATCH 3/7] test(psm): finalize a3p tests --- .../proposals/p:upgrade-19/psm.test.js | 118 ++++++++---------- .../swap-anchor-for-minted-seat-permit.json | 8 ++ .../swap-anchor-for-minted-seat.js | 54 ++++++++ 3 files changed, 117 insertions(+), 63 deletions(-) create mode 100644 a3p-integration/proposals/p:upgrade-19/swapAnchorForMintedSeat/swap-anchor-for-minted-seat-permit.json create mode 100644 a3p-integration/proposals/p:upgrade-19/swapAnchorForMintedSeat/swap-anchor-for-minted-seat.js diff --git a/a3p-integration/proposals/p:upgrade-19/psm.test.js b/a3p-integration/proposals/p:upgrade-19/psm.test.js index ce7bc9cbea8..06d0f79070b 100644 --- a/a3p-integration/proposals/p:upgrade-19/psm.test.js +++ b/a3p-integration/proposals/p:upgrade-19/psm.test.js @@ -1,67 +1,21 @@ /* eslint-env node */ /** - * @file The goal of this file is to make sure v28-provisionPool and v14-bank can be successfully - * upgraded. These vats are related because of the issues below; - * - https://github.com/Agoric/agoric-sdk/issues/8722 - * - https://github.com/Agoric/agoric-sdk/issues/8724 + * @file The goal of this file is to make sure v36-reserve upgraded. * * The test scenario is as follows; - * 1. Upgrade provisionPool. This upgrade overrides provisionWalletBridgerManager with a durable one - * 2. Add a new account and successfully provision it - * - Observe new account's address under `published.wallet.${address}` - * 3. Send some USDC_axl to provisionPoolAddress and observe its IST balances increases accordingly - * 4. Introduce a new asset to the chain and start a PSM instance for the new asset - * 4a. Deposit some of that asset to provisionPoolAddress - * 4b. Observe provisionPoolAddress' IST balance increase by the amount deposited in step 4a - * 5. Perform a null upgrade for provisionPool. This upgrade does NOT override provisionWalletBridgerManager - * - The goal here is to allow testing the bridgeHandler from the first upgrade is in fact durable - * 6. Auto provision - * 6a. Introduce a new account - * 6b. Fund it with IST and ATOM to be able to open a vault - * 6c. Try to open a vault WITHOUT provisioning the newly introduced account - * 6d. Observe the new account's address under `published.wallet` - * 7. Same as step 2. Checks manual provision works after null upgrade + * 1. Simulate trade of IST and USDC + * 2. Upgrade all PSMs + * 3. Verify metrics are the same after the upgrade + * 4. Verity trading is still possible after the upgrade */ import '@endo/init'; import test from 'ava'; -import { - addUser, - evalBundles, - agd as agdAmbient, - agoric, - getISTBalance, - getDetailsMatchingVats, - GOV1ADDR, - openVault, - ATOM_DENOM, -} from '@agoric/synthetic-chain'; -import { - makeVstorageKit, - waitUntilAccountFunded, - waitUntilContractDeployed, -} from '@agoric/client-utils'; -import { NonNullish } from '@agoric/internal'; -import { - bankSend, - checkUserProvisioned, - introduceAndProvision, - provision, -} from './test-lib/provision-helpers.js'; - -const ADD_PSM_DIR = 'addUsdLemons'; -const DEPOSIT_USD_LEMONS_DIR = 'depositUSD-LEMONS'; -const UPGRADE_PSM_DIR = 'upgradePSM'; -const NULL_UPGRADE_PP_DIR = 'nullUpgradePP'; - -const USDC_DENOM = NonNullish(process.env.USDC_DENOM); +import { evalBundles } from '@agoric/synthetic-chain'; +import { makeVstorageKit } from '@agoric/client-utils'; -const ambientAuthority = { - query: agdAmbient.query, - follow: agoric.follow, - setTimeout, - log: console.log, -}; +const UPGRADE_PSM_DIR = 'upgradePSM'; +const SWAP_ANCHOR = 'swapAnchorForMintedSeat'; test.before(async t => { const vstorageKit = await makeVstorageKit( @@ -74,15 +28,53 @@ test.before(async t => { }; }); -test.serial('upgrade provisionPool', async t => { +test.serial('similate trade of IST and USDC', async t => { + // @ts-expect-error casting + const { vstorageKit } = t.context; + + await evalBundles(SWAP_ANCHOR); + + const metrics = await vstorageKit.readLatestHead( + 'published.psm.IST.USDC.metrics', + ); + + t.is(metrics.anchorPoolBalance.value, 500000n); + t.is(metrics.feePoolBalance.value, 0n); + t.is(metrics.mintedPoolBalance.value, 500000n); + t.is(metrics.totalAnchorProvided.value, 0n); + t.is(metrics.totalMintedProvided.value, 500000n); +}); + +test.serial('upgrade PSMs', async t => { + // @ts-expect-error casting + const { vstorageKit } = t.context; + await evalBundles(UPGRADE_PSM_DIR); - // const vatDetailsAfter = await getDetailsMatchingVats('provisionPool'); - // const { incarnation } = vatDetailsAfter.find(vat => - // vat.vatName.endsWith('provisionPool'), - // ); + const metrics = await vstorageKit.readLatestHead( + 'published.psm.IST.USDC.metrics', + ); + + t.is(metrics.anchorPoolBalance.value, 500000n); + t.is(metrics.feePoolBalance.value, 0n); + t.is(metrics.mintedPoolBalance.value, 500000n); + t.is(metrics.totalAnchorProvided.value, 0n); + t.is(metrics.totalMintedProvided.value, 500000n); +}); + +test.serial('verify trading after upgrade', async t => { + // @ts-expect-error casting + const { vstorageKit } = t.context; + + await evalBundles(SWAP_ANCHOR); + + const metrics = await vstorageKit.readLatestHead( + 'published.psm.IST.USDC.metrics', + ); - // t.log(vatDetailsAfter); - // t.is(incarnation, 1, 'incorrect incarnation'); - t.pass(); + t.is(metrics.anchorPoolBalance.value, 1000000n); + t.is(metrics.feePoolBalance.value, 0n); + t.is(metrics.mintedPoolBalance.value, 1000000n); + t.is(metrics.totalAnchorProvided.value, 0n); + t.is(metrics.totalMintedProvided.value, 1000000n); }); diff --git a/a3p-integration/proposals/p:upgrade-19/swapAnchorForMintedSeat/swap-anchor-for-minted-seat-permit.json b/a3p-integration/proposals/p:upgrade-19/swapAnchorForMintedSeat/swap-anchor-for-minted-seat-permit.json new file mode 100644 index 00000000000..067c22846cd --- /dev/null +++ b/a3p-integration/proposals/p:upgrade-19/swapAnchorForMintedSeat/swap-anchor-for-minted-seat-permit.json @@ -0,0 +1,8 @@ +{ + "consume": { + "contractKits": true, + "zoe": true, + "agoricNames": true, + "psmKit": true + } +} diff --git a/a3p-integration/proposals/p:upgrade-19/swapAnchorForMintedSeat/swap-anchor-for-minted-seat.js b/a3p-integration/proposals/p:upgrade-19/swapAnchorForMintedSeat/swap-anchor-for-minted-seat.js new file mode 100644 index 00000000000..0194ea75a9e --- /dev/null +++ b/a3p-integration/proposals/p:upgrade-19/swapAnchorForMintedSeat/swap-anchor-for-minted-seat.js @@ -0,0 +1,54 @@ +// @ts-nocheck +/* eslint-disable no-undef */ + +const swapAnchorForMintedSeat = async powers => { + const { + consume: { zoe, contractKits: contractKitsP, psmKit: psmKitP, agoricNames }, + } = powers; + + const [contractKits, psmKit, usdcIssuer, usdcBrand] = await Promise.all([ + contractKitsP, + psmKitP, + E(agoricNames).lookup('issuer', 'USDC'), + E(agoricNames).lookup('brand', 'USDC'), + ]); + + console.log('[CONTRACT_KITS]', contractKits); + console.log('[ISSUER]', usdcIssuer); + + let govCreatorFacet; + for (const { psmGovernorCreatorFacet, label } of psmKit.values()) { + if (label === 'psm-IST-USDC') { + govCreatorFacet = psmGovernorCreatorFacet; + console.log('psm-IST-USDC found', label); + } + } + + const psmPublicFacet = await E(govCreatorFacet).getPublicFacet(); + + let usdcMint; + for (const { publicFacet, creatorFacet: mint } of contractKits.values()) { + if (publicFacet === usdcIssuer) { + usdcMint = mint; + console.log('USDC found', mint); + break; + } + } + + console.log('Minting USDC'); + const amt = harden({ brand: usdcBrand, value: 500000n }); + const payment = await E(usdcMint).mintPayment(amt); + + const seat = E(zoe).offer( + E(psmPublicFacet).makeWantMintedInvitation(), + harden({ + give: { In: amt }, + }), + harden({ In: payment }), + ); + + console.log(await E(seat).getPayouts()); + console.log('Done.'); +}; + +swapAnchorForMintedSeat; From 0d03ec12814214d8d4eaffe4d38ad5008cfdd839 Mon Sep 17 00:00:00 2001 From: Ikenna Omekam Date: Fri, 20 Dec 2024 01:28:46 -0500 Subject: [PATCH 4/7] feat(psm): add to upgrade list --- golang/cosmos/app/upgrade.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/golang/cosmos/app/upgrade.go b/golang/cosmos/app/upgrade.go index 89857e26166..f2f6d839995 100644 --- a/golang/cosmos/app/upgrade.go +++ b/golang/cosmos/app/upgrade.go @@ -262,6 +262,9 @@ func unreleasedUpgradeHandler(app *GaiaApp, targetUpgrade string) func(sdk.Conte // vm.CoreProposalStepForModules( // "@agoric/builders/scripts/vats/upgrade-asset-reserve.js", // ), + // vm.CoreProposalStepForModules( + // "@agoric/builders/scripts/vats/upgrade-psm.js", + // ), // ) } From 8a63438408a34d5b04d03c419103b4f978e667cf Mon Sep 17 00:00:00 2001 From: Ikenna Omekam Date: Fri, 20 Dec 2024 01:29:51 -0500 Subject: [PATCH 5/7] test(psm): uncomment tests --- a3p-integration/proposals/p:upgrade-19/test.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/a3p-integration/proposals/p:upgrade-19/test.sh b/a3p-integration/proposals/p:upgrade-19/test.sh index 7ce5cb25b55..e46513ad311 100644 --- a/a3p-integration/proposals/p:upgrade-19/test.sh +++ b/a3p-integration/proposals/p:upgrade-19/test.sh @@ -1,13 +1,13 @@ #!/bin/bash -# yarn ava replaceFeeDistributor.test.js -# yarn ava upgradedBoard.test.js -# yarn ava mintHolder.test.js -# yarn ava provisionPool.test.js +yarn ava replaceFeeDistributor.test.js +yarn ava upgradedBoard.test.js +yarn ava mintHolder.test.js +yarn ava provisionPool.test.js -# yarn ava agoricNames.test.js +yarn ava agoricNames.test.js -# yarn ava assetReserve.test.js +yarn ava assetReserve.test.js yarn ava psm.test.js -# yarn ava registry.test.js +yarn ava registry.test.js From cf431ffba4cab8f632eab09a50485335040bdc4e Mon Sep 17 00:00:00 2001 From: Ikenna Omekam Date: Fri, 20 Dec 2024 01:33:32 -0500 Subject: [PATCH 6/7] fix(psm): lint --- packages/builders/scripts/vats/upgrade-psm.js | 4 +--- .../vats/src/proposals/upgrade-psm-proposal.js | 18 ++++++------------ 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/packages/builders/scripts/vats/upgrade-psm.js b/packages/builders/scripts/vats/upgrade-psm.js index 6f222922d48..678f4a5449b 100644 --- a/packages/builders/scripts/vats/upgrade-psm.js +++ b/packages/builders/scripts/vats/upgrade-psm.js @@ -7,9 +7,7 @@ export const defaultProposalBuilder = async ({ publishRef, install }) => getManifestCall: [ 'getManifestForUpgradingPSM', { - psmRef: publishRef( - install('@agoric/inter-protocol/src/psm/psm.js'), - ), + psmRef: publishRef(install('@agoric/inter-protocol/src/psm/psm.js')), }, ], }); diff --git a/packages/vats/src/proposals/upgrade-psm-proposal.js b/packages/vats/src/proposals/upgrade-psm-proposal.js index ab5d5a0bcc7..1151077c61a 100644 --- a/packages/vats/src/proposals/upgrade-psm-proposal.js +++ b/packages/vats/src/proposals/upgrade-psm-proposal.js @@ -12,8 +12,8 @@ const trace = makeTracer('UpgradePSM'); * }; * }} powers * @param {object} options - * @param {{ - * psmRef: VatSourceRef; + * @param {{ + * psmRef: VatSourceRef; * }} options.options */ export const upgradePSMProposal = async ( @@ -30,10 +30,7 @@ export const upgradePSMProposal = async ( trace(`PSM BUNDLE ID: `, psmRef); - const [ - psmKitMap, - instancePrivateArgs, - ] = await Promise.all([ + const [psmKitMap, instancePrivateArgs] = await Promise.all([ psmKitP, instancePrivateArgsP, ]); @@ -50,22 +47,19 @@ export const upgradePSMProposal = async ( ...originalPrivateArgs, initialPoserInvitation: poserInvitation, }); - + const upgradeResult = await E(psmAdminFacet).upgradeContract( psmRef.bundleID, newPrivateArgs, ); - + trace(`PSM ${label} upgraded: `, upgradeResult); } trace('Done.'); }; -export const getManifestForUpgradingPSM = ( - _powers, - { psmRef }, -) => ({ +export const getManifestForUpgradingPSM = (_powers, { psmRef }) => ({ manifest: { [upgradePSMProposal.name]: { consume: { From 03c583b71853ce6c7ccd93efb5d667d223450f5e Mon Sep 17 00:00:00 2001 From: Ikenna Omekam Date: Fri, 20 Dec 2024 20:36:07 -0500 Subject: [PATCH 7/7] fix(reserve): PR feedback --- a3p-integration/proposals/p:upgrade-19/psm.test.js | 7 ++++--- .../swap-anchor-for-minted-seat.js | 9 +++++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/a3p-integration/proposals/p:upgrade-19/psm.test.js b/a3p-integration/proposals/p:upgrade-19/psm.test.js index 06d0f79070b..90ff2060d98 100644 --- a/a3p-integration/proposals/p:upgrade-19/psm.test.js +++ b/a3p-integration/proposals/p:upgrade-19/psm.test.js @@ -1,12 +1,13 @@ /* eslint-env node */ /** - * @file The goal of this file is to make sure v36-reserve upgraded. + * @file The goal of this file is to make sure all the PSM contacts are upgrade. Each set of vats are different + * per chain, but for mainnet, we expect this to be: V37-V42, V73, V76 * * The test scenario is as follows; * 1. Simulate trade of IST and USDC * 2. Upgrade all PSMs * 3. Verify metrics are the same after the upgrade - * 4. Verity trading is still possible after the upgrade + * 4. Verify trading is still possible after the upgrade */ import '@endo/init'; @@ -28,7 +29,7 @@ test.before(async t => { }; }); -test.serial('similate trade of IST and USDC', async t => { +test.serial('simulate trade of IST and USDC', async t => { // @ts-expect-error casting const { vstorageKit } = t.context; diff --git a/a3p-integration/proposals/p:upgrade-19/swapAnchorForMintedSeat/swap-anchor-for-minted-seat.js b/a3p-integration/proposals/p:upgrade-19/swapAnchorForMintedSeat/swap-anchor-for-minted-seat.js index 0194ea75a9e..1f26f84cce2 100644 --- a/a3p-integration/proposals/p:upgrade-19/swapAnchorForMintedSeat/swap-anchor-for-minted-seat.js +++ b/a3p-integration/proposals/p:upgrade-19/swapAnchorForMintedSeat/swap-anchor-for-minted-seat.js @@ -13,8 +13,8 @@ const swapAnchorForMintedSeat = async powers => { E(agoricNames).lookup('brand', 'USDC'), ]); - console.log('[CONTRACT_KITS]', contractKits); - console.log('[ISSUER]', usdcIssuer); + console.log('CONTRACT_KITS', contractKits); + console.log('ISSUER', usdcIssuer); let govCreatorFacet; for (const { psmGovernorCreatorFacet, label } of psmKit.values()) { @@ -36,6 +36,8 @@ const swapAnchorForMintedSeat = async powers => { } console.log('Minting USDC'); + assert(usdcMint, 'USDC mint not found'); + const amt = harden({ brand: usdcBrand, value: 500000n }); const payment = await E(usdcMint).mintPayment(amt); @@ -48,6 +50,9 @@ const swapAnchorForMintedSeat = async powers => { ); console.log(await E(seat).getPayouts()); + + // We'll check for success in the tests that run this proposal by validating the metric values in + // vstorage console.log('Done.'); };