Skip to content

Commit

Permalink
test: borrow some so gas snapshots are more meaningful
Browse files Browse the repository at this point in the history
  • Loading branch information
sakulstra committed Dec 13, 2024
1 parent 794aaf1 commit b86174a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion snapshots/Pool.Operations.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"repay: partial repay": "189971",
"supply: collateralDisabled": "146829",
"supply: collateralEnabled": "146829",
"supply: first supply->collateralEnabled": "188344",
"supply: first supply->collateralEnabled": "176387",
"withdraw: full withdraw": "165303",
"withdraw: partial withdraw": "181992"
}
9 changes: 8 additions & 1 deletion tests/gas/Pool.Operations.gas.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ contract PoolOperations_gas_Tests is Testhelpers {
address liquidator = makeAddr('liquidator');

function test_supply() external {
// borrow some, so hf checks are not skipped
_supplyOnReserve(supplier, 1 ether, tokenList.weth);
_borrowArbitraryAmount(supplier, 1e5, tokenList.wbtc);

_supplyOnReserve(supplier, 100e6, tokenList.usdx);
vm.snapshotGasLastCall('Pool.Operations', 'supply: first supply->collateralEnabled');

Expand Down Expand Up @@ -150,6 +154,9 @@ contract PoolOperations_gas_Tests is Testhelpers {
type(uint256).max,
false
);
vm.snapshotGasLastCall('Pool.Operations', 'liquidationCall: deficit on liquidated asset + other asset');
vm.snapshotGasLastCall(
'Pool.Operations',
'liquidationCall: deficit on liquidated asset + other asset'
);
}
}

0 comments on commit b86174a

Please sign in to comment.