From b86174a4b6847b6eed0651e93c3066a0181d01a1 Mon Sep 17 00:00:00 2001 From: Lukas Date: Fri, 13 Dec 2024 09:40:15 +0100 Subject: [PATCH] test: borrow some so gas snapshots are more meaningful --- snapshots/Pool.Operations.json | 2 +- tests/gas/Pool.Operations.gas.t.sol | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/snapshots/Pool.Operations.json b/snapshots/Pool.Operations.json index b3d696f9..834b5f33 100644 --- a/snapshots/Pool.Operations.json +++ b/snapshots/Pool.Operations.json @@ -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" } \ No newline at end of file diff --git a/tests/gas/Pool.Operations.gas.t.sol b/tests/gas/Pool.Operations.gas.t.sol index b950ab12..8318c0f1 100644 --- a/tests/gas/Pool.Operations.gas.t.sol +++ b/tests/gas/Pool.Operations.gas.t.sol @@ -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'); @@ -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' + ); } }