Skip to content

Commit

Permalink
clean logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Filipp Makarov authored and Filipp Makarov committed Nov 26, 2024
1 parent a5f1c5b commit 1a26c3e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
8 changes: 1 addition & 7 deletions test/base/TestBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,6 @@ abstract contract TestBase is CheatCodes, TestHelper, BaseEventsAndErrors {
+ uint128(bytes16(userOp.paymasterAndData[_PAYMASTER_POSTOP_GAS_OFFSET:_PAYMASTER_DATA_OFFSET]));

uint256 penalty = (gasLimit - gasValue) * 10 * gasPrice / 100;
console2.log("penalty in tests", penalty);
return penalty;
}

Expand Down Expand Up @@ -477,11 +476,6 @@ abstract contract TestBase is CheatCodes, TestHelper, BaseEventsAndErrors {
// unless ofcourse there is same token transfer in calldata
assertEq(gasPaidBySAInERC20, gasCollectedInERC20ByPaymaster);

console2.log("gasPaidBySAInERC20", gasPaidBySAInERC20);
console2.log("gasCollectedInERC20ByPaymaster", gasCollectedInERC20ByPaymaster);
console2.log("maxPenalty", maxPenalty);
console2.log("totalGasFeePaid", totalGasFeePaid);

uint256 gasPaidBySAInNativeTokens = gasPaidBySAInERC20 * 1e18 / tokenPrice;

// Assert we never undercharge
Expand All @@ -490,7 +484,7 @@ abstract contract TestBase is CheatCodes, TestHelper, BaseEventsAndErrors {
// 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) * priceMarkup / _PRICE_MARKUP_DENOMINATOR, gasPaidBySAInNativeTokens, 0.02e18);
assertApproxEqRel((totalGasFeePaid + maxPenalty - realPenalty) * priceMarkup / _PRICE_MARKUP_DENOMINATOR, gasPaidBySAInNativeTokens, 0.02e18, "If this fails, check the test case inline comments");
}

function _toSingletonArray(address addr) internal pure returns (address[] memory) {
Expand Down
3 changes: 0 additions & 3 deletions test/unit/concrete/TestTokenPaymaster.Base.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ contract TestTokenPaymasterBase is TestBase {
// assertEq(block.number, 21744650);
setupPaymasterTestEnvironment();

console2.log("current block timestamp ", block.timestamp);

swapRouter = IV3SwapRouter(SWAP_ROUTER_ADDRESS); // uniswap swap router v2 on base
// Deploy the token paymaster
tokenPaymaster = new BiconomyTokenPaymaster(
Expand Down Expand Up @@ -148,7 +146,6 @@ contract TestTokenPaymasterBase is TestBase {
// deposit 100 USDC to the paymaster
deal(address(usdc), address(tokenPaymaster), 100e6);
uint256 initialTokenBalance = usdc.balanceOf(address(tokenPaymaster));
console2.log("initialTokenBalance", initialTokenBalance);
uint256 initialDepositOnEntryPoint = tokenPaymaster.getDeposit();

vm.startPrank(address(tokenPaymaster));
Expand Down

0 comments on commit 1a26c3e

Please sign in to comment.