@@ -183,7 +183,7 @@ describe("PublicLiquidityPool", function () {
183183 await usdc . connect ( lp ) . approve ( liquidityPool , amount ) ;
184184 await expect ( liquidityPool . connect ( lp ) [ ERC4626Deposit ] ( amount , lp ) )
185185 . to . emit ( liquidityPool , ERC4626DepositEvent ) . withArgs ( lp , lp , amount , amount ) ;
186- expect ( await liquidityPool . totalDeposited ( ) ) . to . eq ( 0 ) ;
186+ expect ( await liquidityPool . totalDeposited ( ) ) . to . eq ( amount ) ;
187187 expect ( await liquidityPool . totalAssets ( ) ) . to . eq ( amount ) ;
188188 expect ( await liquidityPool . totalSupply ( ) ) . to . eq ( amount ) ;
189189 expect ( await liquidityPool . balance ( usdc ) ) . to . eq ( amount ) ;
@@ -223,7 +223,7 @@ describe("PublicLiquidityPool", function () {
223223 expect ( await usdc . balanceOf ( user2 ) ) . to . eq ( 0n ) ;
224224 await expect ( liquidityPool . connect ( user ) [ ERC4626Deposit ] ( amount3 , user ) )
225225 . to . emit ( liquidityPool , ERC4626DepositEvent ) . withArgs ( user , user , amount3 , amount3 ) ;
226- expect ( await liquidityPool . totalDeposited ( ) ) . to . eq ( 0 ) ;
226+ expect ( await liquidityPool . totalDeposited ( ) ) . to . eq ( amount + amount2 + amount3 ) ;
227227 expect ( await liquidityPool . totalAssets ( ) ) . to . eq ( amount + amount2 + amount3 ) ;
228228 expect ( await liquidityPool . totalSupply ( ) ) . to . eq ( amount + amount2 + amount3 ) ;
229229 expect ( await liquidityPool . balance ( usdc ) ) . to . eq ( amount + amount2 + amount3 ) ;
@@ -241,7 +241,7 @@ describe("PublicLiquidityPool", function () {
241241 await usdc . connect ( lp ) . approve ( liquidityPool , amount ) ;
242242 await expect ( liquidityPool . connect ( lp ) . mint ( amount , lp ) )
243243 . to . emit ( liquidityPool , ERC4626DepositEvent ) . withArgs ( lp , lp , amount , amount ) ;
244- expect ( await liquidityPool . totalDeposited ( ) ) . to . eq ( 0 ) ;
244+ expect ( await liquidityPool . totalDeposited ( ) ) . to . eq ( amount ) ;
245245 expect ( await liquidityPool . totalAssets ( ) ) . to . eq ( amount ) ;
246246 expect ( await liquidityPool . totalSupply ( ) ) . to . eq ( amount ) ;
247247 expect ( await liquidityPool . balance ( usdc ) ) . to . eq ( amount ) ;
@@ -286,7 +286,7 @@ describe("PublicLiquidityPool", function () {
286286 permitSig . s ,
287287 ) ;
288288 await expect ( tx ) . to . emit ( liquidityPool , ERC4626DepositEvent ) . withArgs ( lp , user , amount , amount ) ;
289- expect ( await liquidityPool . totalDeposited ( ) ) . to . eq ( 0 ) ;
289+ expect ( await liquidityPool . totalDeposited ( ) ) . to . eq ( amount ) ;
290290 expect ( await liquidityPool . totalAssets ( ) ) . to . eq ( amount ) ;
291291 expect ( await liquidityPool . totalSupply ( ) ) . to . eq ( amount ) ;
292292 expect ( await liquidityPool . balance ( usdc ) ) . to . eq ( amount ) ;
@@ -348,7 +348,7 @@ describe("PublicLiquidityPool", function () {
348348 expect ( await usdc . balanceOf ( liquidityPool ) ) . to . eq ( amountLiquidity - amountToReceive ) ;
349349 expect ( await usdc . balanceOf ( mockTarget ) ) . to . eq ( amountToReceive ) ;
350350 expect ( await usdc . allowance ( liquidityPool , mockTarget ) ) . to . eq ( 0 ) ;
351- expect ( await liquidityPool . totalDeposited ( ) ) . to . eq ( 0 ) ;
351+ expect ( await liquidityPool . totalDeposited ( ) ) . to . eq ( amountLiquidity + fee ) ;
352352 expect ( await liquidityPool . totalAssets ( ) ) . to . eq ( amountLiquidity + fee - protocolFee ) ;
353353 expect ( await liquidityPool . protocolFee ( ) ) . to . eq ( protocolFee ) ;
354354 expect ( await liquidityPool . totalSupply ( ) ) . to . eq ( amountLiquidity ) ;
@@ -412,7 +412,7 @@ describe("PublicLiquidityPool", function () {
412412 expect ( await usdc . allowance ( liquidityPool , mockTarget ) ) . to . eq ( 0 ) ;
413413 expect ( await eurc . balanceOf ( liquidityPool ) ) . to . eq ( 0 ) ;
414414 expect ( await eurc . balanceOf ( mockTarget ) ) . to . eq ( fillAmount ) ;
415- expect ( await liquidityPool . totalDeposited ( ) ) . to . eq ( 0 ) ;
415+ expect ( await liquidityPool . totalDeposited ( ) ) . to . eq ( amountLiquidity + fee ) ;
416416 expect ( await liquidityPool . totalAssets ( ) ) . to . eq ( amountLiquidity + fee - protocolFee ) ;
417417 expect ( await liquidityPool . protocolFee ( ) ) . to . eq ( protocolFee ) ;
418418 expect ( await liquidityPool . totalSupply ( ) ) . to . eq ( amountLiquidity ) ;
@@ -476,7 +476,7 @@ describe("PublicLiquidityPool", function () {
476476 expect ( await usdc . balanceOf ( liquidityPool ) ) . to . eq ( amountLiquidity - amountToReceive ) ;
477477 expect ( await usdc . balanceOf ( mockBorrowSwap ) ) . to . eq ( amountToReceive ) ;
478478 expect ( await usdc . allowance ( liquidityPool , mockTarget ) ) . to . eq ( 0 ) ;
479- expect ( await liquidityPool . totalDeposited ( ) ) . to . eq ( 0 ) ;
479+ expect ( await liquidityPool . totalDeposited ( ) ) . to . eq ( amountLiquidity + fee ) ;
480480 expect ( await liquidityPool . totalAssets ( ) ) . to . eq ( amountLiquidity + fee - protocolFee ) ;
481481 expect ( await liquidityPool . protocolFee ( ) ) . to . eq ( protocolFee ) ;
482482 expect ( await liquidityPool . totalSupply ( ) ) . to . eq ( amountLiquidity ) ;
@@ -596,7 +596,7 @@ describe("PublicLiquidityPool", function () {
596596 expect ( await usdc . balanceOf ( liquidityPool ) ) . to . eq ( amountLiquidity - amountToReceive ) ;
597597 expect ( await usdc . balanceOf ( mockBorrowSwap ) ) . to . eq ( amountToReceive ) ;
598598 expect ( await usdc . allowance ( liquidityPool , mockTarget ) ) . to . eq ( 0 ) ;
599- expect ( await liquidityPool . totalDeposited ( ) ) . to . eq ( 0 ) ;
599+ expect ( await liquidityPool . totalDeposited ( ) ) . to . eq ( amountLiquidity + fee ) ;
600600 expect ( await liquidityPool . totalAssets ( ) ) . to . eq ( amountLiquidity + fee - protocolFee ) ;
601601 expect ( await liquidityPool . protocolFee ( ) ) . to . eq ( protocolFee ) ;
602602 expect ( await liquidityPool . totalSupply ( ) ) . to . eq ( amountLiquidity ) ;
@@ -704,7 +704,7 @@ describe("PublicLiquidityPool", function () {
704704 await usdc . connect ( usdcOwner ) . approve ( liquidityPool , amountLiquidity ) ;
705705 await expect ( liquidityPool . connect ( usdcOwner ) [ ERC4626Deposit ] ( amountLiquidity , usdcOwner ) )
706706 . to . emit ( liquidityPool , ERC4626DepositEvent ) . withArgs ( usdcOwner , usdcOwner , amountLiquidity , amountLiquidity ) ;
707- expect ( await liquidityPool . totalDeposited ( ) ) . to . eq ( 0 ) ;
707+ expect ( await liquidityPool . totalDeposited ( ) ) . to . eq ( amountLiquidity + amountLiquidity ) ;
708708 expect ( await liquidityPool . totalAssets ( ) ) . to . eq ( amountLiquidity + amountLiquidity ) ;
709709 expect ( await liquidityPool . totalSupply ( ) ) . to . eq ( amountLiquidity + amountLiquidity ) ;
710710 expect ( await liquidityPool . balance ( usdc ) ) . to . eq ( amountLiquidity + amountLiquidity ) ;
@@ -830,7 +830,7 @@ describe("PublicLiquidityPool", function () {
830830 expect ( await usdc . balanceOf ( mockTarget ) ) . to . eq ( amountToReceive ) ;
831831 expect ( await usdc . balanceOf ( user ) ) . to . eq ( 0 ) ;
832832 expect ( await usdc . balanceOf ( user2 ) ) . to . eq ( 0 ) ;
833- expect ( await liquidityPool . totalDeposited ( ) ) . to . eq ( 0 ) ;
833+ expect ( await liquidityPool . totalDeposited ( ) ) . to . eq ( totalLiquidity + fee ) ;
834834 expect ( await liquidityPool . totalAssets ( ) ) . to . eq ( totalLiquidity + fee - protocolFee ) ;
835835 expect ( await liquidityPool . protocolFee ( ) ) . to . eq ( protocolFee ) ;
836836 expect ( await liquidityPool . totalSupply ( ) ) . to . eq ( totalLiquidity ) ;
@@ -851,7 +851,7 @@ describe("PublicLiquidityPool", function () {
851851 expect ( await usdc . balanceOf ( mockTarget ) ) . to . eq ( amountToReceive ) ;
852852 expect ( await usdc . balanceOf ( user ) ) . to . eq ( 2008n * USDC_DEC ) ;
853853 expect ( await usdc . balanceOf ( user2 ) ) . to . eq ( 1004n * USDC_DEC ) ;
854- expect ( await liquidityPool . totalDeposited ( ) ) . to . eq ( 0 ) ;
854+ expect ( await liquidityPool . totalDeposited ( ) ) . to . eq ( 1008n * USDC_DEC ) ;
855855 expect ( await liquidityPool . totalAssets ( ) ) . to . eq ( 1004n * USDC_DEC ) ;
856856 expect ( await liquidityPool . protocolFee ( ) ) . to . eq ( protocolFee ) ;
857857 expect ( await liquidityPool . totalSupply ( ) ) . to . eq ( 1000n * USDC_DEC ) ;
@@ -868,7 +868,7 @@ describe("PublicLiquidityPool", function () {
868868 expect ( await usdc . balanceOf ( mockTarget ) ) . to . eq ( amountToReceive ) ;
869869 expect ( await usdc . balanceOf ( user ) ) . to . eq ( 2008n * USDC_DEC ) ;
870870 expect ( await usdc . balanceOf ( user2 ) ) . to . eq ( 502n * USDC_DEC ) ;
871- expect ( await liquidityPool . totalDeposited ( ) ) . to . eq ( 0 ) ;
871+ expect ( await liquidityPool . totalDeposited ( ) ) . to . eq ( 1510n * USDC_DEC ) ;
872872 expect ( await liquidityPool . totalAssets ( ) ) . to . eq ( 1506n * USDC_DEC ) ;
873873 expect ( await liquidityPool . protocolFee ( ) ) . to . eq ( protocolFee ) ;
874874 expect ( await liquidityPool . totalSupply ( ) ) . to . eq ( 1500n * USDC_DEC ) ;
@@ -1660,7 +1660,7 @@ describe("PublicLiquidityPool", function () {
16601660 expect ( await usdc . balanceOf ( liquidityPool ) ) . to . eq ( amountLiquidity - amountToReceive ) ;
16611661 expect ( await usdc . balanceOf ( mockTarget ) ) . to . eq ( amountToReceive ) ;
16621662 expect ( await usdc . allowance ( liquidityPool , mockTarget ) ) . to . eq ( 0 ) ;
1663- expect ( await liquidityPool . totalDeposited ( ) ) . to . eq ( 0 ) ;
1663+ expect ( await liquidityPool . totalDeposited ( ) ) . to . eq ( amountLiquidity + fee ) ;
16641664 expect ( await liquidityPool . totalAssets ( ) ) . to . eq ( amountLiquidity + fee - protocolFee ) ;
16651665 expect ( await liquidityPool . protocolFee ( ) ) . to . eq ( protocolFee ) ;
16661666 expect ( await liquidityPool . totalSupply ( ) ) . to . eq ( amountLiquidity ) ;
@@ -1712,7 +1712,7 @@ describe("PublicLiquidityPool", function () {
17121712 expect ( await usdc . balanceOf ( liquidityPool ) ) . to . eq ( amountLiquidity - amountToReceive ) ;
17131713 expect ( await usdc . balanceOf ( mockTarget ) ) . to . eq ( amountToReceive ) ;
17141714 expect ( await usdc . allowance ( liquidityPool , mockTarget ) ) . to . eq ( 0 ) ;
1715- expect ( await liquidityPool . totalDeposited ( ) ) . to . eq ( 0 ) ;
1715+ expect ( await liquidityPool . totalDeposited ( ) ) . to . eq ( amountLiquidity + fee ) ;
17161716 expect ( await liquidityPool . totalAssets ( ) ) . to . eq ( amountLiquidity + fee - protocolFee ) ;
17171717 expect ( await liquidityPool . protocolFee ( ) ) . to . eq ( protocolFee ) ;
17181718 expect ( await liquidityPool . totalSupply ( ) ) . to . eq ( amountLiquidity ) ;
@@ -1764,7 +1764,7 @@ describe("PublicLiquidityPool", function () {
17641764 expect ( await usdc . balanceOf ( liquidityPool ) ) . to . eq ( amountLiquidity - amountToReceive ) ;
17651765 expect ( await usdc . balanceOf ( mockTarget ) ) . to . eq ( amountToReceive ) ;
17661766 expect ( await usdc . allowance ( liquidityPool , mockTarget ) ) . to . eq ( 0 ) ;
1767- expect ( await liquidityPool . totalDeposited ( ) ) . to . eq ( 0 ) ;
1767+ expect ( await liquidityPool . totalDeposited ( ) ) . to . eq ( amountLiquidity + fee ) ;
17681768 expect ( await liquidityPool . totalAssets ( ) ) . to . eq ( amountLiquidity + fee - protocolFee ) ;
17691769 expect ( await liquidityPool . protocolFee ( ) ) . to . eq ( protocolFee ) ;
17701770 expect ( await liquidityPool . totalSupply ( ) ) . to . eq ( amountLiquidity ) ;
0 commit comments