Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit 4c17800

Browse files
committed
fix ens tests
1 parent 196ae0d commit 4c17800

File tree

4 files changed

+7
-41
lines changed

4 files changed

+7
-41
lines changed

packages/web3-eth-ens/test/integration/ens.events.test.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ along with web3.js. If not, see <http://www.gnu.org/licenses/>.
1818
/* eslint-disable @typescript-eslint/no-unused-vars */
1919
import { Contract, PayableTxOptions } from 'web3-eth-contract';
2020
import { sha3 } from 'web3-utils';
21-
import { getBlock } from 'web3-eth';
2221

23-
import { Address, Bytes, DEFAULT_RETURN_FORMAT } from 'web3-types';
22+
import { Address, Bytes } from 'web3-types';
2423
// eslint-disable-next-line import/no-extraneous-dependencies
2524
import { IpcProvider } from 'web3-providers-ipc';
2625
import { ENS } from '../../src';
@@ -75,7 +74,7 @@ describeIf(isSocket)('ens events', () => {
7574
const acc2 = await createTempAccount();
7675
accountOne = acc2.address;
7776

78-
sendOptions = { from: defaultAccount, gas: '10000000' };
77+
sendOptions = { from: defaultAccount, type: '0x1' };
7978

8079
const Registry = new Contract(ENSRegistryAbi, undefined, {
8180
provider: getSystemTestProvider(),
@@ -120,15 +119,6 @@ describeIf(isSocket)('ens events', () => {
120119
else provider = new ENS.providers.HttpProvider(clientUrl);
121120

122121
ens = new ENS(registry.options.address, provider);
123-
124-
const block = await getBlock(ens, 'latest', false, DEFAULT_RETURN_FORMAT);
125-
const gas = block.gasLimit.toString();
126-
127-
// Increase gas for contract calls
128-
sendOptions = {
129-
...sendOptions,
130-
gas,
131-
};
132122
});
133123

134124
afterAll(async () => {

packages/web3-eth-ens/test/integration/ens.test.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@ along with web3.js. If not, see <http://www.gnu.org/licenses/>.
1616
*/
1717

1818
/* eslint-disable @typescript-eslint/no-unused-vars */
19-
import { getBlock } from 'web3-eth';
2019
import { Contract, PayableTxOptions } from 'web3-eth-contract';
21-
import { Address, Bytes, DEFAULT_RETURN_FORMAT } from 'web3-types';
20+
import { Address, Bytes } from 'web3-types';
2221
import { sha3, toChecksumAddress } from 'web3-utils';
2322
// eslint-disable-next-line import/no-extraneous-dependencies
2423
import { IpcProvider } from 'web3-providers-ipc';
@@ -76,7 +75,7 @@ describe('ens', () => {
7675
const acc2 = await createTempAccount();
7776
accountOne = acc2.address;
7877

79-
sendOptions = { from: defaultAccount, gas: '10000000' };
78+
sendOptions = { from: defaultAccount, type: '0x1' };
8079

8180
const Registry = new Contract(ENSRegistryAbi, undefined, {
8281
provider: getSystemTestProvider(),
@@ -121,15 +120,6 @@ describe('ens', () => {
121120
else provider = new ENS.providers.HttpProvider(clientUrl);
122121

123122
ens = new ENS(registry.options.address, provider);
124-
125-
const block = await getBlock(ens, 'latest', false, DEFAULT_RETURN_FORMAT);
126-
const gas = block.gasLimit.toString();
127-
128-
// Increase gas for contract calls
129-
sendOptions = {
130-
...sendOptions,
131-
gas,
132-
};
133123
});
134124

135125
afterAll(async () => {

packages/web3-eth-ens/test/integration/resolver.test.ts

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,10 @@ You should have received a copy of the GNU Lesser General Public License
1515
along with web3.js. If not, see <http://www.gnu.org/licenses/>.
1616
*/
1717

18-
/* eslint-disable @typescript-eslint/no-unused-vars */
19-
import Web3Eth from 'web3-eth';
2018
import { Contract, PayableTxOptions } from 'web3-eth-contract';
2119
import { sha3 } from 'web3-utils';
2220

23-
import { Address, Bytes, DEFAULT_RETURN_FORMAT } from 'web3-types';
21+
import { Address, Bytes } from 'web3-types';
2422
// eslint-disable-next-line import/no-extraneous-dependencies
2523
import { IpcProvider } from 'web3-providers-ipc';
2624
import { ENS } from '../../src';
@@ -59,8 +57,6 @@ describe('ens', () => {
5957
const node = namehash('resolver');
6058
const label = sha3('resolver') as string;
6159

62-
let web3Eth: Web3Eth;
63-
6460
let ens: ENS;
6561
let defaultAccount: string;
6662
let accountOne: string;
@@ -78,7 +74,7 @@ describe('ens', () => {
7874
const acc2 = await createTempAccount();
7975
accountOne = acc2.address;
8076

81-
sendOptions = { from: defaultAccount, gas: '10000000' };
77+
sendOptions = { from: defaultAccount, type: '0x1' };
8278

8379
const Registry = new Contract(ENSRegistryAbi, undefined, {
8480
provider: getSystemTestProvider(),
@@ -123,16 +119,6 @@ describe('ens', () => {
123119
else provider = new ENS.providers.HttpProvider(clientUrl);
124120

125121
ens = new ENS(registry.options.address, provider);
126-
127-
web3Eth = new Web3Eth(provider);
128-
const block = await web3Eth.getBlock('latest', false, DEFAULT_RETURN_FORMAT);
129-
const gas = block.gasLimit.toString();
130-
131-
// Increase gas for contract calls
132-
sendOptions = {
133-
...sendOptions,
134-
gas,
135-
};
136122
});
137123

138124
afterAll(async () => {

packages/web3-eth-ens/test/integration/setup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ along with web3.js. If not, see <http://www.gnu.org/licenses/>.
1919
// eslint-disable-next-line @typescript-eslint/no-require-imports
2020
require('../config/setup');
2121

22-
const jestTimeout = 15000;
22+
const jestTimeout = 30000;
2323

2424
jest.setTimeout(jestTimeout);

0 commit comments

Comments
 (0)