From ed73c5705ec4ab626636622b7706d7b1885ac773 Mon Sep 17 00:00:00 2001 From: Chris Hibbert Date: Mon, 23 May 2022 15:47:12 -0700 Subject: [PATCH] refactor: add notifier and subscription to state --- packages/run-protocol/src/vpool-xyk-amm/pool.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/run-protocol/src/vpool-xyk-amm/pool.js b/packages/run-protocol/src/vpool-xyk-amm/pool.js index b169a1f28a95..67f6d4cc9c64 100644 --- a/packages/run-protocol/src/vpool-xyk-amm/pool.js +++ b/packages/run-protocol/src/vpool-xyk-amm/pool.js @@ -42,6 +42,8 @@ export const publicPrices = prices => { * @typedef {{ * updater: IterationObserver, * notifier: Notifier, + * metricsPublication: IterationObserver, + * metricsSubscription: Subscription * poolSeat: ZCFSeat, * liqTokenSupply: bigint, * }} MutableState @@ -123,7 +125,9 @@ const helperBehavior = { facets.helper.updateMetrics(); return 'Added liquidity.'; }, - updateMetrics: ({ state, facets }) => { + /** @param {MethodContext} context */ + updateMetrics: context => { + const { state, facets } = context; const payload = harden({ Central: facets.pool.getCentralAmount(), Secondary: facets.pool.getSecondaryAmount(),