Skip to content

Commit

Permalink
fix ens tests
Browse files Browse the repository at this point in the history
  • Loading branch information
avkos committed Mar 28, 2024
1 parent 196ae0d commit 4c17800
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 41 deletions.
14 changes: 2 additions & 12 deletions packages/web3-eth-ens/test/integration/ens.events.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ along with web3.js. If not, see <http://www.gnu.org/licenses/>.
/* 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';
Expand Down Expand Up @@ -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(),
Expand Down Expand Up @@ -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 () => {
Expand Down
14 changes: 2 additions & 12 deletions packages/web3-eth-ens/test/integration/ens.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ along with web3.js. If not, see <http://www.gnu.org/licenses/>.
*/

/* 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';
Expand Down Expand Up @@ -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(),
Expand Down Expand Up @@ -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 () => {
Expand Down
18 changes: 2 additions & 16 deletions packages/web3-eth-ens/test/integration/resolver.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@ You should have received a copy of the GNU Lesser General Public License
along with web3.js. If not, see <http://www.gnu.org/licenses/>.
*/

/* 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';
Expand Down Expand Up @@ -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;
Expand All @@ -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(),
Expand Down Expand Up @@ -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 () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/web3-eth-ens/test/integration/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ along with web3.js. If not, see <http://www.gnu.org/licenses/>.
// eslint-disable-next-line @typescript-eslint/no-require-imports
require('../config/setup');

const jestTimeout = 15000;
const jestTimeout = 30000;

jest.setTimeout(jestTimeout);

1 comment on commit 4c17800

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: 4c17800 Previous: 6c075db Ratio
processingTx 9629 ops/sec (±4.63%) 9301 ops/sec (±4.81%) 0.97
processingContractDeploy 38884 ops/sec (±6.05%) 39129 ops/sec (±7.62%) 1.01
processingContractMethodSend 20736 ops/sec (±4.07%) 19443 ops/sec (±5.19%) 0.94
processingContractMethodCall 41168 ops/sec (±6.13%) 38971 ops/sec (±6.34%) 0.95
abiEncode 46240 ops/sec (±6.24%) 44252 ops/sec (±6.92%) 0.96
abiDecode 31456 ops/sec (±6.82%) 30419 ops/sec (±8.89%) 0.97
sign 1658 ops/sec (±1.05%) 1656 ops/sec (±4.08%) 1.00
verify 382 ops/sec (±0.51%) 373 ops/sec (±0.78%) 0.98

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.