diff --git a/packages/deployment/upgrade-test/upgrade-test-scripts/agoric-upgrade-11/auctioneer-upgrade-driver.sh b/packages/deployment/upgrade-test/upgrade-test-scripts/agoric-upgrade-11/auctioneer-upgrade-driver.sh deleted file mode 100755 index 237e7e3ee9e9..000000000000 --- a/packages/deployment/upgrade-test/upgrade-test-scripts/agoric-upgrade-11/auctioneer-upgrade-driver.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash - -. ./upgrade-test-scripts/env_setup.sh - -set -euo pipefail -# set -x - -here='upgrade-test-scripts/agoric-upgrade-11' - -bundle_auctioneer_filepath='/tmp/bundle-auctioneer.json' -bundle_vault_filepath='/tmp/bundle-vaultFactory.json' - -alias bundle-source="yarn run --silent bundle-source" -# TODO: for now, we're bundling vaultFactory outside the container. but before we finish: -# bundle-source --cache-json /tmp packages/inter-protocol/src/vaultFactory/vaultFactory.js vaultFactory -VAULT_HASH=`jq -r .endoZipBase64Sha512 ${bundle_vault_filepath}` - -echo checking that hashes match ${here}/gov-switch-auctioneer.js -echo ${VAULT_HASH} -grep ${VAULT_HASH} ${here}/gov-switch-auctioneer.js || exit 1 - -bundle-source --cache-json /tmp packages/inter-protocol/src/auction/auctioneer.js auctioneer -AUCTIONEER_HASH=`jq -r .endoZipBase64Sha512 ${bundle_auctioneer_filepath}` -grep ${AUCTIONEER_HASH} ${here}/gov-switch-auctioneer.js || exit 1 - -# TODO: make sure this consistently works -agd tx swingset install-bundle @${bundle_vault_filepath} \ - --from gov1 --keyring-backend=test --gas=auto \ - --chain-id=agoriclocal -b block --yes -agoric follow -lF :bundles - -agd tx swingset install-bundle @${bundle_auctioneer_filepath} \ - --from gov1 --keyring-backend=test --gas=auto \ - --chain-id=agoriclocal -b block --yes -agoric follow -lF :bundles - -agd --chain-id=agoriclocal \ - tx gov submit-proposal swingset-core-eval \ - ${here}/gov-switch-auctioneer-permit.json ${here}/gov-switch-auctioneer.js \ - --title="Auctioneer Upgrade" --description="auctioneer upgrade test" \ - --deposit=10000000ubld \ - --gas=auto --gas-adjustment=1.2 \ - --yes -o json --from=validator --keyring-backend=test -b block - -agd --chain-id=agoriclocal query gov proposals --output json | \ - jq -c '.proposals[] | [.proposal_id,.voting_end_time,.status]'; - -voteLatestProposalAndWait - -# then tes some stuff??? -# 3129800000uist \ No newline at end of file diff --git a/packages/deployment/upgrade-test/upgrade-test-scripts/agoric-upgrade-11/gov-switch-auctioneer-permit.json b/packages/deployment/upgrade-test/upgrade-test-scripts/agoric-upgrade-11/gov-switch-auctioneer-permit.json deleted file mode 100644 index e9b698f66664..000000000000 --- a/packages/deployment/upgrade-test/upgrade-test-scripts/agoric-upgrade-11/gov-switch-auctioneer-permit.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "consume": { - "auctioneerKit": true, - "chainTimerService": true, - "priceAuthority": true, - "startGovernedUpgradable": true, - "vaultFactoryKit": true, - "zoe": true, - "chainStorage": true, - "board": true, - "reserveKit": true - }, - "produce": { - "auctioneerKit": true - }, - "instance": { - "produce": { - "auctioneer": true - }, - "consume": { - "reserve": true - } - }, - "issuer": { - "consume": { - "IST": true - } - } -} \ No newline at end of file diff --git a/packages/deployment/upgrade-test/upgrade-test-scripts/agoric-upgrade-11/gov-switch-auctioneer.js b/packages/deployment/upgrade-test/upgrade-test-scripts/agoric-upgrade-11/gov-switch-auctioneer.js deleted file mode 100644 index 78687643511d..000000000000 --- a/packages/deployment/upgrade-test/upgrade-test-scripts/agoric-upgrade-11/gov-switch-auctioneer.js +++ /dev/null @@ -1,147 +0,0 @@ -// @ts-nocheck -/* global E */ - -console.log('started switch-auctioneer script'); - -// TODO: set these bundle-ids to the revised code -const bundleIDs = { - vaultFactory: - 'b1-4755fb5c079fc2a17e6ea5a887d27787cd6d48df179e046466c4dbf4b9e78ac7dceee183a395de3d6a09c5f162415e12f42685269b84c64b58c5f65eab6b0de1', - auctioneer: - 'b1-e85289898e66e0423d7ec1c402ac2ced21573f93cf599d593a0533a1e2355ace624cc95c8c8c18c66d44a921511642e87837accd0e728427c269936b040bb886', -}; - -const STORAGE_PATH = 'auction'; - -const { fromEntries, keys, values } = Object; - -/** @type {(xs: X[], ys: Y[]) => [X, Y][]} */ -const zip = (xs, ys) => harden(xs.map((x, i) => [x, ys[+i]])); - -/** - * @type {>>( - * obj: T, - * ) => Promise<{ [K in keyof T]: Awaited }>} - */ -const allValues = async obj => { - const resolved = await Promise.all(values(obj)); - // @ts-expect-error cast - return harden(fromEntries(zip(keys(obj), resolved))); -}; - -/** @param {import('../../src/proposals/econ-behaviors').EconomyBootstrapPowers} permittedPowers */ -const switchAuctioneer = async permittedPowers => { - console.log('switchAuctioneer: extracting permitted powers...'); - // see gov-switch-auctioneer-permit.json - const { - consume: { - auctioneerKit: auctioneerKitP, - chainTimerService: timerService, - priceAuthority, - startGovernedUpgradable, - vaultFactoryKit, - zoe, - chainStorage, - board, - reserveKit, - }, - produce: { auctioneerKit }, - instance: { - produce: { auctioneer: auctionInstance }, - consume: { reserve: reserveInstance }, - }, - issuer: { - consume: { IST: stableIssuerP }, - }, - } = permittedPowers; - - /** install, start governed instance, publish results */ - const startNewAuctioneer = async () => { - console.log('startNewAuctioneer: installBundleID etc.'); - const { - // @ts-expect-error cast XXX missing from type - // auctioneerKit: { privateArgs }, // TODO, this doesn't work. Find a way to pass in valid private args - governedParamsOrig, - installation, - reservePublicFacet, - stableIssuer, - storageNode, - marshaller, - } = await allValues({ - auctioneerKit: auctioneerKitP, - installation: E(zoe).installBundleID(bundleIDs.auctioneer, 'auctioneer'), - reservePublicFacet: E(zoe).getPublicFacet(reserveInstance), - stableIssuer: stableIssuerP, - governedParamsOrig: E( - E.get(auctioneerKitP).publicFacet, - ).getGovernedParams(), - storageNode: E(chainStorage).makeChildNode(STORAGE_PATH), - marshaller: E(board).getReadonlyMarshaller(), - }); - - const privateArgs = { - storageNode, - marshaller, - }; - - const { Electorate: _, ...governedParams } = governedParamsOrig; - - const terms = { - priceAuthority, - reservePublicFacet, - timerService, - governedParams: governedParamsOrig, - }; - - console.log('startNewAuctioneer: startGovernedUpgradable'); - const kit = await E(startGovernedUpgradable)({ - label: 'auctioneer', - installation, - issuerKeywordRecord: { Bid: stableIssuer }, - terms, - governedParams, - privateArgs, - }); - - auctioneerKit.reset(); - auctioneerKit.resolve(kit); - // TODO: test that auctioneer in agoricNames.instance gets updated - auctionInstance.reset(); - auctionInstance.resolve(kit.instance); - - return kit; - }; - - const newAuctionKit = await startNewAuctioneer(); - - // TODO: shut down old auctioneer? - - // upgrade the vaultFactory - const upgradeVaultFactory = async () => { - console.log('upgradeVaultFactory...'); - const kit = await vaultFactoryKit; - // @ts-expect-error cast XXX privateArgs missing from type - const { privateArgs } = kit; - - /** @type {xxport('../../src/vaultFactory/vaultFactory').VaultFactoryContract['privateArgs']} */ - const newPrivateArgs = harden({ - ...privateArgs, - auctioneerInstance: newAuctionKit.instance, - }); - const upgradeResult = await E(kit.adminFacet).upgradeContract( - bundleIDs.vaultFactory, - newPrivateArgs, - ); - - const shortfallInvitation = await E( - E.get(reserveKit).creatorFacet, - ).makeShortfallReportingInvitation(); - - await E(kit.creatorFacet).updateShortfallReporter(shortfallInvitation); - - console.log('upgraded vaultVactory.', upgradeResult); - }; - await upgradeVaultFactory(); -}; - -switchAuctioneer; diff --git a/packages/deployment/upgrade-test/upgrade-test-scripts/agoric-upgrade-11/mint-ist.sh b/packages/deployment/upgrade-test/upgrade-test-scripts/agoric-upgrade-11/mint-ist.sh deleted file mode 100755 index b79c4ee62d91..000000000000 --- a/packages/deployment/upgrade-test/upgrade-test-scripts/agoric-upgrade-11/mint-ist.sh +++ /dev/null @@ -1,6 +0,0 @@ -agd tx bank send validator $GOV1ADDR 20123000000ibc/BA313C4A19DFBF943586C0387E6B11286F9E416B4DD27574E6909CABE0E342FA --keyring-backend=test --chain-id=agoriclocal --yes -bblock -agops vaults open --giveCollateral 5000 --wantMinted 20000 > /tmp/offer.json -agops perf satisfaction --executeOffer /tmp/offer.json --from gov1 --keyring-backend=test - - -# ibc/BA313C4A19DFBF943586C0387E6B11286F9E416B4DD27574E6909CABE0E342FA \ No newline at end of file