diff --git a/packages/notifier/src/storesub.js b/packages/notifier/src/storesub.js index 41f76ad5ce03..7e2c80fa2f8b 100644 --- a/packages/notifier/src/storesub.js +++ b/packages/notifier/src/storesub.js @@ -3,9 +3,6 @@ import { E } from '@endo/eventual-send'; import { Far, makeMarshal } from '@endo/marshal'; import { observeIteration } from './asyncIterableAdaptor.js'; -/** @template T @typedef {import('@endo/marshal').CapData} CapData */ -/** @template T @typedef {import('@endo/eventual-send').EOnly} EOnly */ - /** * Begin iterating the source, publishing serialized iteration values. If the * publish operation rejects, the iteration will be terminated. @@ -15,11 +12,11 @@ import { observeIteration } from './asyncIterableAdaptor.js'; * data out-of-band. * * @template T - * @param {ERef>} subscription + * @param {Subscription} subscription * @param {ERef} [storageNode] * @param {ERef>} [marshaller] */ -export const makeStoredSubscription = async ( +export const makeStoredSubscription = ( subscription, storageNode, marshaller = makeMarshal(undefined, undefined, { @@ -67,13 +64,13 @@ export const makeStoredSubscription = async ( }).catch(fail); } - /** @type {EOnly>} */ + /** @type {StoredSubscription} */ const storesub = Far('StoredSubscription', { getStoreKey: () => storageNode && E(storageNode).getStoreKey(), getUnserializer: () => unserializer, - getSharableSubscriptionInternals: () => - E(subscription).getSharableSubscriptionInternals(), - [Symbol.asyncIterator]: E(subscription)[Symbol.asyncIterator], + getSharableSubscriptionInternals: + subscription.getSharableSubscriptionInternals, + [Symbol.asyncIterator]: subscription[Symbol.asyncIterator], }); return storesub; }; diff --git a/packages/notifier/test/test-stored-subscription.js b/packages/notifier/test/test-stored-subscription.js index da4170a5bf9d..af20be24a080 100644 --- a/packages/notifier/test/test-stored-subscription.js +++ b/packages/notifier/test/test-stored-subscription.js @@ -16,14 +16,16 @@ const makeFakeStorage = (path, publication) => { storeName: 'swingset', storeSubkey: `swingset/data:${fullPath}`, }); - /** @type {Storage} */ - return Far('fakeStorage', { + /** @type {StorageNode} */ + const storage = Far('fakeStorage', { getStoreKey: () => storeKey, setValue: value => { assert.typeof(value, 'string'); publication.updateState(value); }, + getChildNode: () => storage, }); + return storage; }; test('stored subscription', async t => { diff --git a/packages/run-protocol/src/vpool-xyk-amm/types.js b/packages/run-protocol/src/vpool-xyk-amm/types.js index 7a1911507c96..5088202d83b6 100644 --- a/packages/run-protocol/src/vpool-xyk-amm/types.js +++ b/packages/run-protocol/src/vpool-xyk-amm/types.js @@ -82,7 +82,7 @@ * @property {() => PriceAuthority} getToCentralPriceAuthority * @property {() => PriceAuthority} getFromCentralPriceAuthority * @property {() => VirtualPool} getVPool - * @property {() => Subscription} getMetrics + * @property {() => StoredSubscription} getMetrics */ /** @@ -136,7 +136,7 @@ * Prices and notifications about changing prices. * @property {() => Brand[]} getAllPoolBrands * @property {() => Allocation} getProtocolPoolBalance - * @property {() => EOnly>} getMetrics + * @property {() => StoredSubscription} getMetrics * @property {(brand: Brand) => Subscription} getPoolMetrics */