From ac40e252df3dcca73fe53a597e75e166302fcc51 Mon Sep 17 00:00:00 2001 From: Bence Haromi Date: Fri, 5 Jul 2024 12:14:47 +0100 Subject: [PATCH] unneeded allowance approval --- core/tests/ts-integration/tests/erc20.test.ts | 9 --------- 1 file changed, 9 deletions(-) diff --git a/core/tests/ts-integration/tests/erc20.test.ts b/core/tests/ts-integration/tests/erc20.test.ts index a11b1f823ec3..b73582db4233 100644 --- a/core/tests/ts-integration/tests/erc20.test.ts +++ b/core/tests/ts-integration/tests/erc20.test.ts @@ -16,7 +16,6 @@ describe('ERC20 contract checks', () => { let alice: zksync.Wallet; let bob: zksync.Wallet; let tokenDetails: Token; - let baseTokenDetails: Token; let aliceErc20: zksync.Contract; beforeAll(async () => { @@ -25,7 +24,6 @@ describe('ERC20 contract checks', () => { bob = testMaster.newEmptyAccount(); tokenDetails = testMaster.environment().erc20Token; - baseTokenDetails = testMaster.environment().baseToken; aliceErc20 = new zksync.Contract(tokenDetails.l2Address, zksync.utils.IERC20, alice); }); @@ -210,17 +208,10 @@ describe('ERC20 contract checks', () => { test('Can perform a deposit with precalculated max value', async () => { console.log('nonce0', await alice.getNonce()); - - const maxAmountBase = await alice.getBalanceL1(baseTokenDetails.l1Address); - console.log('nonce1', await alice.getNonce()); - const maxAmount = await alice.getBalanceL1(tokenDetails.l1Address); console.log('nonce2', await alice.getNonce()); // Approving the needed allowance to ensure that the user has enough funds. - await (await alice.approveERC20(baseTokenDetails.l1Address, maxAmountBase)).wait(); - console.log('nonce3', await alice.getNonce()); - await (await alice.approveERC20(tokenDetails.l1Address, maxAmount)).wait(); console.log('nonce4', await alice.getNonce());