makeWalletFactoryDriver and makeAgoricNamesRemotesFromFakeStorage use fromCapData to make remote presences for instances, brands, and such. But they don't do so in an identity-preserving way.
So code such as this doesn't work:
const current = watcherWallet.getCurrentWalletRecord();
const invitationPurse = current.purses.find(
p => p.brand === agoricNamesRemotes.brand.Invitation,
);
Description of the Design
Use a a slot <-> value translation table, indexed in both directions, as in marshalTables.js 80f5cb1
Probably in @agoric/client-support in or around vstorage-kit.js.
Security Considerations
There's a risk of "over-indexing"; that is: using a shared marshal context across parts of a test that represent different vats.
For those cases, we should be able to use srcMarshaller.toCapData(passable) to externalize the data and then destMarshaller.fromCapData(data) to internalize it on the other side.
What is the Problem Being Solved?
makeWalletFactoryDriver
andmakeAgoricNamesRemotesFromFakeStorage
usefromCapData
to make remote presences for instances, brands, and such. But they don't do so in an identity-preserving way.So code such as this doesn't work:
Description of the Design
Use a a slot <-> value translation table, indexed in both directions, as in marshalTables.js 80f5cb1
Probably in
@agoric/client-support
in or aroundvstorage-kit.js
.Security Considerations
There's a risk of "over-indexing"; that is: using a shared marshal context across parts of a test that represent different vats.
For those cases, we should be able to use
srcMarshaller.toCapData(passable)
to externalize the data and thendestMarshaller.fromCapData(data)
to internalize it on the other side.Scaling / Upgrade Considerations
n/a
Test Plan
Use of these tools in tests should validate them.