Skip to content

Commit

Permalink
Fix: Use compareWithThreshold
Browse files Browse the repository at this point in the history
  • Loading branch information
xhad committed Mar 11, 2024
1 parent 8880d90 commit 1edae2e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions test/foundry/integration/ynLSD.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,10 @@ contract ynLSDAssetTest is IntegrationBaseTest {
// Obtain STETH
(bool success, ) = chainAddresses.lsd.STETH_ADDRESS.call{value: amount + 1}("");
require(success, "ETH transfer failed");
uint256 balance = asset.balanceOf(address(this));
assertEq(balance, amount, "Amount not received");
// Note, STETH returns aprx 9.987e17 SETH for 1 ether

uint256 previewDeposit = ynlsd.previewDeposit(asset, amount);
assertTrue(amount - previewDeposit < 1e18, "Preview deposit does not match expected value");
assertTrue(compareWithThreshold(amount, previewDeposit, 9.987e17), "Preview deposit does not match expected value");
}

function testConvertToETH() public {
Expand Down

0 comments on commit 1edae2e

Please sign in to comment.