fix(zoe)!: makeZoeKit() now requires a zcfBundlecap #4528
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix(zoe)!: makeZoeKit() now requires a zcfBundlecap
Zoe needs access to the vatAdminSvc, to create a new ZCF vat to host each
contract. Previously, Zoe did E(vatAdminSvc).createVatByName('zcf'), and
assumed that vatAdminSvc had access to a vat source bundle by that name. Now,
whoever calls makeZoeKit() is obligated to provide Zoe with the right
bundlecap, and Zoe does E(vatAdminSvc).createVat(zcfBundlecap). This makes
things more explicit.
This changes the signature of
makeZoeKit()
in a non-backwards-compatibleway: the
zcfBundlecap
argument is now mandatory, and thus appears second,replacing the old optional fourth-position
zcfBundleName
.Swingset-based unit tests that use Zoe generally follow a pattern where
vat-zoe.js
holds themakeZoeKit()
call, andbootstrap.js
sends vat-zoea
buildZoe(vatAdminSvc)
message. Those need to change: bootstrap should useD(devices.bundle).getNamedBundleCap('zcf')
to get thezcfBundlecap
, andsend it through
buildZoe()
. vat-zoe should be changed to passzcfBundlecap
intomakeZoeKit()
.A similar pattern should be used in actual deployments.
Non-swingset-based zoe-using unit tests generally use
fakeVatAdmin.js
tobuild a mock
vatAdminSvc
. This commit changesfakeVatAdmin.js
to includean additional
zcfBundlecap
export, which is an empty marker object thatserves as a stand-in for the bundlecap. The fake
vatAdminSvc
can acceptthis fake
zcfBundlecap
, and will evaluate the ZCF code appropriately.Downstream module owners should grep their source code for
makeZoeKit
andfakeVatAdmin
to find the calls that need updating.refs #4487