Skip to content

Commit

Permalink
Fix: Use compareWithThreshold 2x
Browse files Browse the repository at this point in the history
  • Loading branch information
xhad committed Mar 11, 2024
1 parent 1edae2e commit 7205862
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 @@ -220,11 +220,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 ethAmount = ynlsd.convertToETH(asset, amount);
assertTrue(amount - ethAmount < 1e15, "ETH amount should be greater than zero");
assertTrue(compareWithThreshold(amount, ethAmount, 9.987e17), "convertToEth does not match expected value");
}
}

Expand Down

0 comments on commit 7205862

Please sign in to comment.