From 90db359d0e4986568e616895792b6bb197488043 Mon Sep 17 00:00:00 2001 From: Chris Hibbert Date: Wed, 26 Feb 2025 17:23:32 -0800 Subject: [PATCH] refactor: rename seats in liquidityPool --- packages/fast-usdc/src/exos/liquidity-pool.js | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/fast-usdc/src/exos/liquidity-pool.js b/packages/fast-usdc/src/exos/liquidity-pool.js index f71a6d6fdff..828a181dfe6 100644 --- a/packages/fast-usdc/src/exos/liquidity-pool.js +++ b/packages/fast-usdc/src/exos/liquidity-pool.js @@ -262,15 +262,15 @@ export const prepareLiquidityPoolKit = (zone, zcf, USDC, tools) => { }, depositHandler: { - /** @param {ZCFSeat} lp */ - async handle(lp) { + /** @param {ZCFSeat} lpSeat */ + async handle(lpSeat) { const { shareWorth, shareMint, poolSeat, encumberedBalance } = this.state; const { external } = this.facets; /** @type {USDCProposalShapes['deposit']} */ // @ts-expect-error ensured by proposalShape - const proposal = lp.getProposal(); + const proposal = lpSeat.getProposal(); checkPoolBalance( poolSeat.getCurrentAllocation(), shareWorth, @@ -279,23 +279,23 @@ export const prepareLiquidityPoolKit = (zone, zcf, USDC, tools) => { const post = depositCalc(shareWorth, proposal); // COMMIT POINT - const mint = shareMint.mintGains(post.payouts); + const sharePayoutSeat = shareMint.mintGains(post.payouts); try { this.state.shareWorth = post.shareWorth; zcf.atomicRearrange( harden([ - // zoe guarantees lp has proposal.give allocated - [lp, poolSeat, proposal.give], - // mintGains() above establishes that mint has post.payouts - [mint, lp, post.payouts], + // zoe guarantees lpSeat has proposal.give allocated + [lpSeat, poolSeat, proposal.give], + // mintGains() above establishes that sharePayoutSeat has post.payouts + [sharePayoutSeat, lpSeat, post.payouts], ]), ); } catch (cause) { // UNTIL #10684: ability to terminate an incarnation w/o terminating the contract throw new Error('🚨 cannot commit deposit', { cause }); } finally { - lp.exit(); - mint.exit(); + lpSeat.exit(); + sharePayoutSeat.exit(); } external.publishPoolMetrics(); },