Skip to content

Commit

Permalink
Add receipt balance change
Browse files Browse the repository at this point in the history
  • Loading branch information
ninokeldishvili committed Nov 27, 2024
1 parent a93b6d6 commit 2dfa68b
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,12 @@ contract ERC20PriceOracleReceiptVaultWithdrawTest is ERC20PriceOracleReceiptVaul
priceTwo = bound(priceTwo, 1e18, 100e18);
aliceDeposit = bound(aliceDeposit, 100e18, type(uint128).max);

// Start recording logs
vm.recordLogs();
ERC20PriceOracleReceiptVault vault = createVault(iVaultOracle, "Alice", "Alice");

ReceiptContract receipt = getReceipt();

// Set initial oracle price and deposit first half
setVaultOraclePrice(priceOne);
vm.startPrank(alice);
Expand All @@ -361,6 +365,10 @@ contract ERC20PriceOracleReceiptVaultWithdrawTest is ERC20PriceOracleReceiptVaul
uint256 expectedSharesOne = (aliceDeposit / 2).fixedPointMul(priceOne, Math.Rounding.Down);
assertEq(vault.balanceOf(alice), expectedSharesOne);

// Check receipt balance
uint256 receiptBalance = receipt.balanceOf(alice, priceOne);
assertEq(receiptBalance, expectedSharesOne);

// Set new oracle price and deposit second half
setVaultOraclePrice(priceTwo);
vm.startPrank(alice);
Expand Down

0 comments on commit 2dfa68b

Please sign in to comment.