Skip to content

Commit

Permalink
fix(test): snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
massun-onibakuchi committed Jun 4, 2024
1 parent dc1ee57 commit f4babdc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions .gas-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ GrimReaperHuffTest:testFuzz_Liquidate(uint256,address) (runs: 257, μ: 390297, ~
GrimReaperHuffTest:testLiquidate() (gas: 390429)
GrimReaperHuffTest:testOnlyOwner(address) (runs: 257, μ: 20250, ~: 20250)
GrimReaperHuffTest:testRecoverERC20() (gas: 330913)
GrimReaperHuffTest:testRevertIfLiquidationFail() (gas: 8937393460516728344)
GrimReaperHuffTest:testRevertIfLiquidationFail() (gas: 8937393460516728353)
GrimReaperSolTest:testFuzz_Liquidate(uint256,address) (runs: 257, μ: 390936, ~: 391328)
GrimReaperSolTest:testLiquidate() (gas: 391254)
GrimReaperSolTest:testOnlyOwner(address) (runs: 257, μ: 21195, ~: 21195)
GrimReaperSolTest:testRecoverERC20() (gas: 331758)
GrimReaperSolTest:testRevertIfLiquidationFail() (gas: 52886)
GrimReaperSolTest:testRevertIfLiquidationFail() (gas: 52904)
OptimizedGrimReaperSolTest:testFuzz_Liquidate(uint256,address) (runs: 257, μ: 390378, ~: 390584)
OptimizedGrimReaperSolTest:testLiquidate() (gas: 390511)
OptimizedGrimReaperSolTest:testOnlyOwner(address) (runs: 257, μ: 20421, ~: 20421)
OptimizedGrimReaperSolTest:testRecoverERC20() (gas: 330891)
OptimizedGrimReaperSolTest:testRevertIfLiquidationFail() (gas: 51866)
OptimizedGrimReaperSolTest:testRevertIfLiquidationFail() (gas: 51884)
OptimizedGrimReaperSolV2Test:testFuzz_Liquidate(uint256,address) (runs: 257, μ: 390496, ~: 390701)
OptimizedGrimReaperSolV2Test:testLiquidate() (gas: 390628)
OptimizedGrimReaperSolV2Test:testOnlyOwner(address) (runs: 257, μ: 20531, ~: 20531)
OptimizedGrimReaperSolV2Test:testRecoverERC20() (gas: 330891)
OptimizedGrimReaperSolV2Test:testRevertIfLiquidationFail() (gas: 52012)
OptimizedGrimReaperSolV2Test:testRevertIfLiquidationFail() (gas: 52030)
6 changes: 3 additions & 3 deletions test/GrimReaper.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ abstract contract GrimReaperBaseTest is Test {
(bool s,) = address(reaper).call(abi.encodeCall(reaper.execute, (_col, _debt, _user, _debtToCover)));
uint256 _after = gasleft();
console2.log("Gas used: ", (_before - _after));
require(s, "ExpectRevert: liquidation failed");
require(s, "liquidation failed");
}

function testRevertIfLiquidationFail() public {
pool.setLiquidation(false);
vm.expectRevert("ExpectRevert: liquidation failed");
vm.expectRevert("liquidation failed");
this._callLiquidate(owner, address(collateral), address(debt), address(0xcafe), 1000);
}

Expand Down Expand Up @@ -129,7 +129,7 @@ contract OptimizedGrimReaperSolTest is GrimReaperBaseTest {
(bool success,) = address(reaper).call(payload);
uint256 _after = gasleft();
console2.log("Gas used: ", (_before - _after));
require(success, "ExpectRevert: liquidation failed");
require(success, "liquidation failed");
}

function getLiquidationPayload(address _col, address _debt, address _user, uint256 _debtToCover)
Expand Down

0 comments on commit f4babdc

Please sign in to comment.