From 1edae2e60249099a2d99fef3b7406798807e1d11 Mon Sep 17 00:00:00 2001 From: xhad Date: Mon, 11 Mar 2024 15:50:53 -0400 Subject: [PATCH] Fix: Use compareWithThreshold --- test/foundry/integration/ynLSD.t.sol | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/foundry/integration/ynLSD.t.sol b/test/foundry/integration/ynLSD.t.sol index 716431359..8aaaecd62 100644 --- a/test/foundry/integration/ynLSD.t.sol +++ b/test/foundry/integration/ynLSD.t.sol @@ -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 {