Skip to content

Commit

Permalink
refactor: add notifier and subscription to state
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris-Hibbert committed May 23, 2022
1 parent 8e6d356 commit ed73c57
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/run-protocol/src/vpool-xyk-amm/pool.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ export const publicPrices = prices => {
* @typedef {{
* updater: IterationObserver<any>,
* notifier: Notifier<any>,
* metricsPublication: IterationObserver<PoolMetricsNotification>,
* metricsSubscription: Subscription<PoolMetricsNotification>
* poolSeat: ZCFSeat,
* liqTokenSupply: bigint,
* }} MutableState
Expand Down Expand Up @@ -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(),
Expand Down

0 comments on commit ed73c57

Please sign in to comment.