From 2697dc89c9e21d8d4f703e123aa606b77d48ede5 Mon Sep 17 00:00:00 2001 From: sunbreak1211 <129470872+sunbreak1211@users.noreply.github.com> Date: Thu, 5 Sep 2024 07:16:27 -0300 Subject: [PATCH] Remove duplicate variable in tests (#28) --- test/FlapperUniV2.t.sol | 4 +--- test/FlapperUniV2SwapOnly.t.sol | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/test/FlapperUniV2.t.sol b/test/FlapperUniV2.t.sol index 276f73b..49c8723 100644 --- a/test/FlapperUniV2.t.sol +++ b/test/FlapperUniV2.t.sol @@ -98,7 +98,6 @@ contract FlapperUniV2Test is DssTest { address PAUSE_PROXY; VatLike vat; VowLike vow; - SpotterLike spotter; address constant LOG = 0xdA0Ab1e0017DEbCd72Be8599041a2aa3bA7e740F; @@ -120,7 +119,6 @@ contract FlapperUniV2Test is DssTest { PAUSE_PROXY = ChainlogLike(LOG).getAddress("MCD_PAUSE_PROXY"); vat = VatLike(ChainlogLike(LOG).getAddress("MCD_VAT")); vow = VowLike(ChainlogLike(LOG).getAddress("MCD_VOW")); - spotter = SpotterLike(ChainlogLike(LOG).getAddress("MCD_SPOT")); splitter = new SplitterMock(DAI_JOIN); vm.startPrank(PAUSE_PROXY); @@ -212,7 +210,7 @@ contract FlapperUniV2Test is DssTest { } function refAmountOut(uint256 amountIn, address pip) internal view returns (uint256) { - return amountIn * WAD / (uint256(MockMedianizer(pip).read()) * RAY / spotter.par()); + return amountIn * WAD / (uint256(MockMedianizer(pip).read()) * RAY / SpotterLike(SPOT).par()); } function uniV2GemForDai(uint256 amountIn, address gem) internal view returns (uint256 amountOut) { diff --git a/test/FlapperUniV2SwapOnly.t.sol b/test/FlapperUniV2SwapOnly.t.sol index e277163..e94a25e 100644 --- a/test/FlapperUniV2SwapOnly.t.sol +++ b/test/FlapperUniV2SwapOnly.t.sol @@ -96,7 +96,6 @@ contract FlapperUniV2SwapOnlyTest is DssTest { address PAUSE_PROXY; VatLike vat; VowLike vow; - SpotterLike spotter; address constant LOG = 0xdA0Ab1e0017DEbCd72Be8599041a2aa3bA7e740F; @@ -118,7 +117,6 @@ contract FlapperUniV2SwapOnlyTest is DssTest { PAUSE_PROXY = ChainlogLike(LOG).getAddress("MCD_PAUSE_PROXY"); vat = VatLike(ChainlogLike(LOG).getAddress("MCD_VAT")); vow = VowLike(ChainlogLike(LOG).getAddress("MCD_VOW")); - spotter = SpotterLike(ChainlogLike(LOG).getAddress("MCD_SPOT")); splitter = new SplitterMock(DAI_JOIN); vm.startPrank(PAUSE_PROXY); @@ -206,7 +204,7 @@ contract FlapperUniV2SwapOnlyTest is DssTest { } function refAmountOut(uint256 amountIn, address pip) internal view returns (uint256) { - return amountIn * WAD / (uint256(MockMedianizer(pip).read()) * RAY / spotter.par()); + return amountIn * WAD / (uint256(MockMedianizer(pip).read()) * RAY / SpotterLike(SPOT).par()); } function uniV2GemForDai(uint256 amountIn, address gem) internal view returns (uint256 amountOut) {