Skip to content

Commit

Permalink
fix(types): durable wrapping non-durable
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Apr 26, 2024
1 parent fe8f619 commit d52b5fd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/pegasus/src/contract.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-check
import { prepareVowTools } from '@agoric/vat-data/vow.js';
import { makeDurableZone } from '@agoric/zone/durable.js';
import { makePegasus } from './pegasus.js';
Expand All @@ -8,8 +9,8 @@ import '../exported.js';

/**
* @type {ContractStartFn<import('./pegasus.js').Pegasus, never, {}, {
* board: ERef<BoardDepositFacet>,
* namesByAddress: ERef<import('@agoric/vats').NameHub>
* board: Remote<BoardDepositFacet>,
* namesByAddress: Remote<import('@agoric/vats').NameHub>
* }>}
*/
export const start = (zcf, privateArgs, baggage) => {
Expand All @@ -23,10 +24,12 @@ export const start = (zcf, privateArgs, baggage) => {
// start requires that the object passed in must be durable. Given that we
// haven't made pegasus durable yet, we'll wrap its non-durable methods within
// an exo object to workaround this requirement.
// @ts-expect-error makePegasus returns a remotable object
const publicFacet = zone.exo('PublicFacet', undefined, {
...makePegasus({ zcf, board, namesByAddress, when }),
});

// @ts-expect-error XXX durable wrapping non-durable
return harden({
publicFacet,
});
Expand Down

0 comments on commit d52b5fd

Please sign in to comment.