Skip to content

Commit

Permalink
fix: rm test case that wastes all gas
Browse files Browse the repository at this point in the history
  • Loading branch information
xenide committed Jul 8, 2024
1 parent 7548258 commit 12b0e73
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 37 deletions.
11 changes: 0 additions & 11 deletions test/mock/GasBuster.sol

This file was deleted.

26 changes: 0 additions & 26 deletions test/unit/ReservoirPriceOracle.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import { EnumerableSetLib } from "lib/solady/src/utils/EnumerableSetLib.sol";
import { Constants } from "src/libraries/Constants.sol";
import { MockFallbackOracle } from "test/mock/MockFallbackOracle.sol";
import { StubERC4626 } from "test/mock/StubERC4626.sol";
import { GasBuster } from "test/mock/GasBuster.sol";

contract ReservoirPriceOracleTest is BaseTest {
using Utils for *;
Expand Down Expand Up @@ -622,31 +621,6 @@ contract ReservoirPriceOracleTest is BaseTest {
assertEq(lPriceAB, 0); // composite price is not stored in the cache
}

function testUpdatePrice_RecipientOutOfGas() external {
// arrange
GasBuster lGasBuster = new GasBuster();

_writePriceCache(address(_tokenA), address(_tokenB), 5e18);
deal(address(_oracle), 1 ether);

skip(1);
_pair.sync();
skip(_oracle.twapPeriod() * 2);
_tokenA.mint(address(_pair), 2e18);
_pair.swap(2e18, true, address(this), "");

// act
_oracle.updatePrice(address(_tokenB), address(_tokenA), address(lGasBuster));

// assert
(uint256 lPrice,) = _oracle.priceCache(address(_tokenA), address(_tokenB));
assertEq(lPrice, 98_918_868_099_219_913_512);
(lPrice,) = _oracle.priceCache(address(_tokenB), address(_tokenA));
assertEq(lPrice, 0);
assertEq(address(lGasBuster).balance, 0);
assertEq(address(_oracle).balance, 1 ether);
}

function testSetRoute() public {
// arrange
address lToken0 = address(_tokenB);
Expand Down

0 comments on commit 12b0e73

Please sign in to comment.