diff --git a/a3p-integration/proposals/a:upgrade-next/upgradeVaults.js b/a3p-integration/proposals/a:upgrade-next/upgradeVaults.js index 981daeba326..96cbd98bb1a 100644 --- a/a3p-integration/proposals/a:upgrade-next/upgradeVaults.js +++ b/a3p-integration/proposals/a:upgrade-next/upgradeVaults.js @@ -7,24 +7,35 @@ import { pushPrices, registerOraclesForBrand, } from './agd-tools.js'; +import { getDetailsMatchingVats } from './vatDetails.js'; -const BRANDNAMES = ['ATOM', 'stATOM', 'stTIA', 'stOSMO', 'stkATOM']; +const BRANDNAMES = ['ATOM', 'stATOM']; const oraclesByBrand = generateOracleMap('u16', BRANDNAMES); -// There are no old prices for the other currencies. const atomOutPre = await getPriceQuote('ATOM'); assert.equal(atomOutPre, '+12010000'); -console.log('adding oracle for each brand'); +console.log('UPGV: adding oracle for each brand'); await registerOraclesForBrand('ATOM', oraclesByBrand); await registerOraclesForBrand('stATOM', oraclesByBrand); -await registerOraclesForBrand('stTIA', oraclesByBrand); -await registerOraclesForBrand('stOSMO', oraclesByBrand); -await registerOraclesForBrand('stkATOM', oraclesByBrand); -console.log('pushing new prices'); +console.log('UPGV: 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); + +// price_feed and governor, old and new for two tokens +const priceFeedDetails = await getDetailsMatchingVats('price_feed'); +assert.equal(Object.keys(priceFeedDetails).length, 8); + +// Two old SPAs, and two new ones +const details = await getDetailsMatchingVats('scaledPriceAuthority'); +assert.equal(Object.keys(details).length, 4, Object.keys(details)); +console.log('UPGV 8 price feeds and 4 scaledPriceAuthorities found'); + +// We previously created price feeds for some tokens that aren't in A3P +const osmoDetails = await getDetailsMatchingVats('stOSMO'); +assert.equal(Object.keys(osmoDetails).length, 0); +const tiaDetails = await getDetailsMatchingVats('stTIA'); +assert.equal(Object.keys(tiaDetails).length, 0); +const stkAtomDetails = await getDetailsMatchingVats('stkATOM'); +assert.equal(Object.keys(stkAtomDetails).length, 0); diff --git a/a3p-integration/proposals/a:upgrade-next/upgradeVaults.test.js b/a3p-integration/proposals/a:upgrade-next/upgradeVaults.test.js index 1670cdd2e92..fba273f14f1 100644 --- a/a3p-integration/proposals/a:upgrade-next/upgradeVaults.test.js +++ b/a3p-integration/proposals/a:upgrade-next/upgradeVaults.test.js @@ -23,39 +23,21 @@ import { import { getDetailsMatchingVats } from './vatDetails.js'; const checkPriceFeedVatsUpdated = async t => { - const atomDetails = await getVatDetails('ATOM-USD_price_feed'); + 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'), - ]); + await Promise.all([checkForOracle(t, 'ATOM'), checkForOracle(t, 'stATOM')]); }; -const BRANDNAMES = ['ATOM', 'stATOM', 'stTIA', 'stOSMO', 'stkATOM']; +const BRANDNAMES = ['ATOM', 'stATOM']; const oraclesByBrand = generateOracleMap('u16', BRANDNAMES); const checkNewQuotes = async t => { 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 => { diff --git a/a3p-integration/proposals/a:upgrade-next/vatDetails.js b/a3p-integration/proposals/a:upgrade-next/vatDetails.js index ccf24608309..2cd4c2c949d 100644 --- a/a3p-integration/proposals/a:upgrade-next/vatDetails.js +++ b/a3p-integration/proposals/a:upgrade-next/vatDetails.js @@ -90,10 +90,11 @@ export const getDetailsMatchingVats = async vatName => { const infos = []; for (const vatID of vatIDs) { const vatInfo = kStore.lookupVat(vatID); + const name = vatInfo.options().name; const source = vatInfo.source(); // @ts-expect-error cast const { incarnation } = vatInfo.currentSpan(); - infos.push({ vatName, vatID, incarnation, ...source }); + infos.push({ vatName: name, vatID, incarnation, ...source }); } return infos; diff --git a/golang/cosmos/app/upgrade.go b/golang/cosmos/app/upgrade.go index ba078f19d9a..6ff4ff90916 100644 --- a/golang/cosmos/app/upgrade.go +++ b/golang/cosmos/app/upgrade.go @@ -93,7 +93,12 @@ func upgradePriceFeedCoreProposalSteps(upgradeName string) ([]vm.CoreProposalSte var inBrandNames []string switch { - case isThisUpgrade("UNRELEASED_A3P_INTEGRATION"), isThisUpgrade("UNRELEASED_main"): + case isThisUpgrade("UNRELEASED_A3P_INTEGRATION"): + inBrandNames = []string{ + "ATOM", + "stATOM", + } + case isThisUpgrade("UNRELEASED_main"): inBrandNames = []string{ "ATOM", "stATOM",