From 9871c6dda6ff56a80ecf6e1ccfd848fedd129feb Mon Sep 17 00:00:00 2001 From: Filipp Makarov Date: Thu, 21 Nov 2024 23:46:22 +0300 Subject: [PATCH] fixing --- test/base/TestBase.sol | 4 ++-- test/unit/concrete/TestTokenPaymaster.t.sol | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/base/TestBase.sol b/test/base/TestBase.sol index 891f0f7..24a04e2 100644 --- a/test/base/TestBase.sol +++ b/test/base/TestBase.sol @@ -486,10 +486,10 @@ abstract contract TestBase is CheatCodes, TestHelper, BaseEventsAndErrors { // Review we will also need to update premium numbers in below if there is premium: multiply by 1e6 / premium assertGt(gasPaidBySAInNativeTokens, BUNDLER.addr.balance - initialBundlerBalance); - // Ensure that max 4% difference between what is should have been charged and what was charged + // Ensure that max 2% difference between what is should have been charged and what was charged // this difference comes from difference of postop gas and estimated postop gas (paymaster.unaccountedGas) // and from estimation of real penalty which is not emitted by EP :( - assertApproxEqRel(totalGasFeePaid + maxPenalty - realPenalty, gasPaidBySAInNativeTokens, 0.04e18); + assertApproxEqRel(totalGasFeePaid + maxPenalty - realPenalty, gasPaidBySAInNativeTokens, 0.02e18); } function _toSingletonArray(address addr) internal pure returns (address[] memory) { diff --git a/test/unit/concrete/TestTokenPaymaster.t.sol b/test/unit/concrete/TestTokenPaymaster.t.sol index f589ae4..6fb8b08 100644 --- a/test/unit/concrete/TestTokenPaymaster.t.sol +++ b/test/unit/concrete/TestTokenPaymaster.t.sol @@ -402,7 +402,7 @@ contract TestTokenPaymaster is TestBase { vm.stopPrank(); vm.startPrank(PAYMASTER_OWNER.addr); - tokenPaymaster.setUnaccountedGas(50_000); + tokenPaymaster.setUnaccountedGas(22_000); vm.stopPrank(); // Warm up the ERC20 balance slot for paymaster by making some tokens held initially @@ -480,7 +480,7 @@ contract TestTokenPaymaster is TestBase { vm.stopPrank(); vm.startPrank(PAYMASTER_OWNER.addr); - tokenPaymaster.setUnaccountedGas(200_000); + tokenPaymaster.setUnaccountedGas(20_000); vm.stopPrank(); uint256 initialBundlerBalance = BUNDLER.addr.balance;