From 64b48d8579b1fc6ae69ab6cf1a6931ef4f0b34d2 Mon Sep 17 00:00:00 2001 From: YashP16 Date: Fri, 19 Jan 2024 15:20:47 +0530 Subject: [PATCH] test(strategy): Update assertion in test_collectInterest() for all strategy tests --- test/strategy/CompoundStrategy.t.sol | 4 +--- test/strategy/StargateStrategy.t.sol | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/test/strategy/CompoundStrategy.t.sol b/test/strategy/CompoundStrategy.t.sol index 7edb558..c6c7bf0 100644 --- a/test/strategy/CompoundStrategy.t.sol +++ b/test/strategy/CompoundStrategy.t.sol @@ -257,9 +257,7 @@ contract CollectInterestTest is CompoundStrategyTest { strategy.collectInterest(ASSET); uint256 current_bal = IERC20(ASSET).balanceOf(yieldReceiver); - uint256 newInterestEarned = strategy.checkInterestEarned(ASSET); - - assertEq(newInterestEarned, 0); + assertApproxEqAbs(strategy.checkInterestEarned(ASSET), 0, 1); assertEq(current_bal, (initial_bal + harvestAmount)); } } diff --git a/test/strategy/StargateStrategy.t.sol b/test/strategy/StargateStrategy.t.sol index 13fd2d3..76c5b81 100644 --- a/test/strategy/StargateStrategy.t.sol +++ b/test/strategy/StargateStrategy.t.sol @@ -487,6 +487,7 @@ contract Test_CollectInterest is Test_Harvest { vm.recordLogs(); strategy.collectInterest(assetData[i].asset); + assertApproxEqAbs(strategy.checkInterestEarned(assetData[i].asset), 0, 1); VmSafe.Log[] memory logs = vm.getRecordedLogs(); @@ -505,7 +506,6 @@ contract Test_CollectInterest is Test_Harvest { /// @note precision Error from stargate assertApproxEqAbs(strategy.checkLPTokenBalance(assetData[i].asset), initialLPBal, 1); - assertEq(strategy.checkInterestEarned(assetData[i].asset), 0); } }