From 13cb53669f2d597553f48e75cc4f48c2d418c80e Mon Sep 17 00:00:00 2001 From: shahafn Date: Wed, 31 Jan 2024 18:58:06 +0200 Subject: [PATCH] Making config public --- contracts/samples/TokenPaymaster.sol | 2 +- test/samples/TokenPaymaster.test.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/contracts/samples/TokenPaymaster.sol b/contracts/samples/TokenPaymaster.sol index 3eb9ff4f..1d4c50d6 100644 --- a/contracts/samples/TokenPaymaster.sol +++ b/contracts/samples/TokenPaymaster.sol @@ -50,7 +50,7 @@ contract TokenPaymaster is BasePaymaster, UniswapHelper, OracleHelper { /// @notice All 'price' variables are multiplied by this value to avoid rounding up uint256 private constant PRICE_DENOMINATOR = 1e26; - TokenPaymasterConfig private tokenPaymasterConfig; + TokenPaymasterConfig public tokenPaymasterConfig; /// @notice Initializes the TokenPaymaster contract with the given parameters. /// @param _token The ERC20 token used for transaction fee payments. diff --git a/test/samples/TokenPaymaster.test.ts b/test/samples/TokenPaymaster.test.ts index b20dceb3..4210b01c 100644 --- a/test/samples/TokenPaymaster.test.ts +++ b/test/samples/TokenPaymaster.test.ts @@ -159,11 +159,12 @@ describe('TokenPaymaster', function () { it('paymaster should reject if postOpGaSLimit is too low', async () => { const snapshot = await ethers.provider.send('evm_snapshot', []) + const config = await paymaster.tokenPaymasterConfig() let op = await fillUserOp({ sender: account.address, paymaster: paymasterAddress, paymasterVerificationGasLimit: 3e5, - paymasterPostOpGasLimit: 4000, // too low + paymasterPostOpGasLimit: config.refundPostopCost - 1, // too low callData }, entryPoint) op = signUserOp(op, accountOwner, entryPoint.address, chainId)