From 4c178000b5da143b6265e9f6498b876839844a15 Mon Sep 17 00:00:00 2001 From: Oleksii Kosynskyi Date: Thu, 28 Mar 2024 21:37:57 +0100 Subject: [PATCH] fix ens tests --- .../test/integration/ens.events.test.ts | 14 ++------------ .../web3-eth-ens/test/integration/ens.test.ts | 14 ++------------ .../test/integration/resolver.test.ts | 18 ++---------------- .../web3-eth-ens/test/integration/setup.js | 2 +- 4 files changed, 7 insertions(+), 41 deletions(-) diff --git a/packages/web3-eth-ens/test/integration/ens.events.test.ts b/packages/web3-eth-ens/test/integration/ens.events.test.ts index 8ad10d08bda..4e199597c24 100644 --- a/packages/web3-eth-ens/test/integration/ens.events.test.ts +++ b/packages/web3-eth-ens/test/integration/ens.events.test.ts @@ -18,9 +18,8 @@ along with web3.js. If not, see . /* eslint-disable @typescript-eslint/no-unused-vars */ import { Contract, PayableTxOptions } from 'web3-eth-contract'; import { sha3 } from 'web3-utils'; -import { getBlock } from 'web3-eth'; -import { Address, Bytes, DEFAULT_RETURN_FORMAT } from 'web3-types'; +import { Address, Bytes } from 'web3-types'; // eslint-disable-next-line import/no-extraneous-dependencies import { IpcProvider } from 'web3-providers-ipc'; import { ENS } from '../../src'; @@ -75,7 +74,7 @@ describeIf(isSocket)('ens events', () => { const acc2 = await createTempAccount(); accountOne = acc2.address; - sendOptions = { from: defaultAccount, gas: '10000000' }; + sendOptions = { from: defaultAccount, type: '0x1' }; const Registry = new Contract(ENSRegistryAbi, undefined, { provider: getSystemTestProvider(), @@ -120,15 +119,6 @@ describeIf(isSocket)('ens events', () => { else provider = new ENS.providers.HttpProvider(clientUrl); ens = new ENS(registry.options.address, provider); - - const block = await getBlock(ens, 'latest', false, DEFAULT_RETURN_FORMAT); - const gas = block.gasLimit.toString(); - - // Increase gas for contract calls - sendOptions = { - ...sendOptions, - gas, - }; }); afterAll(async () => { diff --git a/packages/web3-eth-ens/test/integration/ens.test.ts b/packages/web3-eth-ens/test/integration/ens.test.ts index 5683451b66f..bde73e72fc7 100644 --- a/packages/web3-eth-ens/test/integration/ens.test.ts +++ b/packages/web3-eth-ens/test/integration/ens.test.ts @@ -16,9 +16,8 @@ along with web3.js. If not, see . */ /* eslint-disable @typescript-eslint/no-unused-vars */ -import { getBlock } from 'web3-eth'; import { Contract, PayableTxOptions } from 'web3-eth-contract'; -import { Address, Bytes, DEFAULT_RETURN_FORMAT } from 'web3-types'; +import { Address, Bytes } from 'web3-types'; import { sha3, toChecksumAddress } from 'web3-utils'; // eslint-disable-next-line import/no-extraneous-dependencies import { IpcProvider } from 'web3-providers-ipc'; @@ -76,7 +75,7 @@ describe('ens', () => { const acc2 = await createTempAccount(); accountOne = acc2.address; - sendOptions = { from: defaultAccount, gas: '10000000' }; + sendOptions = { from: defaultAccount, type: '0x1' }; const Registry = new Contract(ENSRegistryAbi, undefined, { provider: getSystemTestProvider(), @@ -121,15 +120,6 @@ describe('ens', () => { else provider = new ENS.providers.HttpProvider(clientUrl); ens = new ENS(registry.options.address, provider); - - const block = await getBlock(ens, 'latest', false, DEFAULT_RETURN_FORMAT); - const gas = block.gasLimit.toString(); - - // Increase gas for contract calls - sendOptions = { - ...sendOptions, - gas, - }; }); afterAll(async () => { diff --git a/packages/web3-eth-ens/test/integration/resolver.test.ts b/packages/web3-eth-ens/test/integration/resolver.test.ts index 587ce2e7b29..f6b2e648991 100644 --- a/packages/web3-eth-ens/test/integration/resolver.test.ts +++ b/packages/web3-eth-ens/test/integration/resolver.test.ts @@ -15,12 +15,10 @@ You should have received a copy of the GNU Lesser General Public License along with web3.js. If not, see . */ -/* eslint-disable @typescript-eslint/no-unused-vars */ -import Web3Eth from 'web3-eth'; import { Contract, PayableTxOptions } from 'web3-eth-contract'; import { sha3 } from 'web3-utils'; -import { Address, Bytes, DEFAULT_RETURN_FORMAT } from 'web3-types'; +import { Address, Bytes } from 'web3-types'; // eslint-disable-next-line import/no-extraneous-dependencies import { IpcProvider } from 'web3-providers-ipc'; import { ENS } from '../../src'; @@ -59,8 +57,6 @@ describe('ens', () => { const node = namehash('resolver'); const label = sha3('resolver') as string; - let web3Eth: Web3Eth; - let ens: ENS; let defaultAccount: string; let accountOne: string; @@ -78,7 +74,7 @@ describe('ens', () => { const acc2 = await createTempAccount(); accountOne = acc2.address; - sendOptions = { from: defaultAccount, gas: '10000000' }; + sendOptions = { from: defaultAccount, type: '0x1' }; const Registry = new Contract(ENSRegistryAbi, undefined, { provider: getSystemTestProvider(), @@ -123,16 +119,6 @@ describe('ens', () => { else provider = new ENS.providers.HttpProvider(clientUrl); ens = new ENS(registry.options.address, provider); - - web3Eth = new Web3Eth(provider); - const block = await web3Eth.getBlock('latest', false, DEFAULT_RETURN_FORMAT); - const gas = block.gasLimit.toString(); - - // Increase gas for contract calls - sendOptions = { - ...sendOptions, - gas, - }; }); afterAll(async () => { diff --git a/packages/web3-eth-ens/test/integration/setup.js b/packages/web3-eth-ens/test/integration/setup.js index 5be1bccf7cc..59b1f904213 100644 --- a/packages/web3-eth-ens/test/integration/setup.js +++ b/packages/web3-eth-ens/test/integration/setup.js @@ -19,6 +19,6 @@ along with web3.js. If not, see . // eslint-disable-next-line @typescript-eslint/no-require-imports require('../config/setup'); -const jestTimeout = 15000; +const jestTimeout = 30000; jest.setTimeout(jestTimeout);