Skip to content

Commit

Permalink
fix: instrument serialize
Browse files Browse the repository at this point in the history
  • Loading branch information
erights committed Jan 11, 2021
1 parent 92211b1 commit bb743c0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
11 changes: 5 additions & 6 deletions packages/marshal/src/marshal.js
Original file line number Diff line number Diff line change
Expand Up @@ -511,15 +511,14 @@ export function makeMarshal(
slotMap.set(val, slotIndex);
}

if (iface !== undefined) {
return harden({
[QCLASS]: 'slot',
iface,
index: slotIndex,
});
if (iface === undefined && passStyleOf(val) === REMOTE_STYLE) {
iface = `Alleged: remotable at slot ${slotIndex}`;
const err = new Error(`Serialize generates iface ${iface}`);
console.info(err);
}
return harden({
[QCLASS]: 'slot',
iface,
index: slotIndex,
});
}
Expand Down
4 changes: 3 additions & 1 deletion packages/zoe/src/contractFacet/contractFacet.js
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,9 @@ export function buildRootObject(powers, _params, testJigSetter = undefined) {
details`invitations must have a description string: ${description}`,
);

const invitationHandle = /** @type {InvitationHandle} */ (harden({}));
const invitationHandle = /** @type {InvitationHandle} */ (makeHandle(
'InvitationHandle',
));
invitationHandleToHandler.init(invitationHandle, offerHandler);
/** @type {Promise<Payment>} */
const invitationP = E(zoeInstanceAdmin).makeInvitation(
Expand Down
3 changes: 2 additions & 1 deletion packages/zoe/src/makeHandle.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { assert } from '@agoric/assert';
import { Remotable } from '@agoric/marshal';

/**
* Create an opaque handle object.
Expand All @@ -11,5 +12,5 @@ export const makeHandle = handleType => {
// This assert ensures that handleType is referenced.
assert.typeof(handleType, 'string', 'handleType must be a string');
// Return the intersection type (really just an empty object).
return /** @type {Handle<H>} */ (harden({}));
return /** @type {Handle<H>} */ (Remotable(`Alleged: ${handleType}`));
};
5 changes: 4 additions & 1 deletion packages/zoe/src/zoeService/zoe.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { makeIssuerKit, MathKind } from '@agoric/ertp';
import '../../exported';
import '../internal-types';

import { Remotable } from '@agoric/marshal';
import { makeIssuerTable } from '../issuerTable';
import { makeZoeSeatAdminKit } from './zoeSeat';
import zcfContractBundle from '../../bundles/bundle-contractFacet';
Expand Down Expand Up @@ -57,7 +58,9 @@ function makeZoe(vatAdminSvc, zcfBundleName = undefined) {
const install = async bundle => {
assert(bundle, `a bundle must be provided`);
/** @type {Installation} */
const installation = { getBundle: () => bundle };
const installation = Remotable('Alleged: Installation', undefined, {
getBundle: () => bundle,
});
harden(installation);
installations.add(installation);
return installation;
Expand Down

0 comments on commit bb743c0

Please sign in to comment.