diff --git a/packages/zoe/src/contractSupport/recorder.js b/packages/zoe/src/contractSupport/recorder.js index cbb6d58eeb6..da7c84aa0a8 100644 --- a/packages/zoe/src/contractSupport/recorder.js +++ b/packages/zoe/src/contractSupport/recorder.js @@ -23,7 +23,7 @@ import { E } from '@endo/eventual-send'; /** * @template T - * @typedef {{ getStorageNode(): StorageNode, getStoragePath(): Promise, write(value: T): Promise, writeFinal(value: T): Promise }} Recorder + * @typedef {{ getStorageNode(): Awaited>, getStoragePath(): Promise, write(value: T): Promise, writeFinal(value: T): Promise }} Recorder */ /** @@ -55,7 +55,7 @@ export const prepareRecorder = (baggage, marshaller) => { /** * @template T * @param {PublishKit['publisher']} publisher - * @param {StorageNode} storageNode + * @param {Awaited>} storageNode * @param {TypedMatcher} [valueShape] */ ( @@ -144,13 +144,19 @@ harden(prepareRecorder); export const defineRecorderKit = ({ makeRecorder, makeDurablePublishKit }) => { /** * @template T - * @param {StorageNode} storageNode + * @param {StorageNode | Awaited>} storageNode * @param {TypedMatcher} [valueShape] * @returns {RecorderKit} */ const makeRecorderKit = (storageNode, valueShape) => { const { subscriber, publisher } = makeDurablePublishKit(); - const recorder = makeRecorder(publisher, storageNode, valueShape); + const recorder = makeRecorder( + publisher, + /** @type { Awaited> } */ ( + storageNode + ), + valueShape, + ); return harden({ subscriber, recorder }); }; return makeRecorderKit; @@ -174,7 +180,12 @@ export const defineERecorderKit = ({ makeRecorder, makeDurablePublishKit }) => { const makeERecorderKit = (storageNodeP, valueShape) => { const { publisher, subscriber } = makeDurablePublishKit(); const recorderP = E.when(storageNodeP, storageNode => - makeRecorder(publisher, storageNode, valueShape), + makeRecorder( + publisher, + // @ts-expect-error Casting because it's remote + /** @type { import('@endo/far').FarRef } */ (storageNode), + valueShape, + ), ); return { subscriber, recorderP }; };