-
Notifications
You must be signed in to change notification settings - Fork 207
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: a test framework for verifying upgrade of Zoe and ZCF
It starts from the currently installed version of Zoe and ZCF. First it verifies that reallocation via staging and via the helper work and that the version internal to ZCF is not present. It then upgrades Zoe and ZCF as necessary to introduce the new behavior. Finally, it re-runs the initial verification to show that the ZCF internal version works. This currently fails on the first step since it runs in a state in which the new Zoe/ZCF code has already replaced the old.
- Loading branch information
1 parent
6f740a4
commit 1e6d52e
Showing
10 changed files
with
510 additions
and
47 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
...es/deployment/upgrade-test/upgrade-test-scripts/agoric-upgrade-11/Zcf-upgrade-bundle.json
Large diffs are not rendered by default.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
...es/deployment/upgrade-test/upgrade-test-scripts/agoric-upgrade-11/Zoe-upgrade-bundle.json
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { makeHelpers } from '@agoric/deploy-script-support'; | ||
|
||
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').ProposalBuilder} */ | ||
export const defaultProposalBuilder = async () => | ||
harden({ | ||
sourceSpec: '../src/proposals/zcf-proposal.js', | ||
getManifestCall: [ | ||
'getManifestForZoe', | ||
{ | ||
zcfRef: { | ||
bundleID: | ||
'b1-8674abc9a8de561c4a33fb475b87be75708cd901c37931fd5ac1f40d3ee99937a459a6ca7b4a8b7907512626caf98c125f22c15384826e37dfc899dc0bf2a63a', | ||
}, | ||
zoeRef: { | ||
bundleID: | ||
'b1-68963663488ee6d178293b559b9d902cea1857dddac257f08540cb9748647d0218a991ce02cf9f61e1e49cca3979b20473103a7fee509cf808de43e323afab54', | ||
}, | ||
}, | ||
], | ||
}); | ||
|
||
export default async (homeP, endowments) => { | ||
const { writeCoreProposal } = await makeHelpers(homeP, endowments); | ||
await writeCoreProposal('replace-zcf', defaultProposalBuilder); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { E } from '@endo/far'; | ||
|
||
/** | ||
* @param { BootstrapPowers & { | ||
* consume: { | ||
* vatAdminSvc: VatAdminSve, | ||
* vatStore: MapStore<string, CreateVatResults>, | ||
* } | ||
* }} powers | ||
* | ||
* @param {object} options | ||
* @param {{zoeRef: VatSourceRef, zcfRef: VatSourceRef}} options.options | ||
*/ | ||
export const upgradeZcf = async ( | ||
{ consume: { vatAdminSvc, vatStore } }, | ||
options, | ||
) => { | ||
const { zoeRef, zcfRef } = options.options; | ||
|
||
const zoeBundleCap = await E(vatAdminSvc).getBundleCap(zoeRef.bundleID); | ||
|
||
const { adminNode, root: zoeRoot } = await E(vatStore).get('zoe'); | ||
|
||
await E(adminNode).upgrade(zoeBundleCap, {}); | ||
|
||
const zoeConfigFacet = await E(zoeRoot).getZoeConfigFacet(); | ||
await E(zoeConfigFacet).updateZcfBundleId(zcfRef.bundleID); | ||
}; | ||
|
||
export const getManifestForZoe = (_powers, { zoeRef, zcfRef }) => ({ | ||
manifest: { | ||
[upgradeZcf.name]: { | ||
consume: { | ||
vatAdminSvc: 'vatAdminSvc', | ||
vatStore: 'vatStore', | ||
}, | ||
produce: {}, | ||
}, | ||
}, | ||
options: { | ||
zoeRef, | ||
zcfRef, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.