From 709b4fa04c18fbc4fb936c84162f115e84341656 Mon Sep 17 00:00:00 2001 From: luu-alex Date: Wed, 10 Jan 2024 14:23:18 -0500 Subject: [PATCH 01/17] release process --- CHANGELOG.md | 41 ++++++++++++++++--------- packages/web3-eth-abi/CHANGELOG.md | 4 ++- packages/web3-eth-abi/package.json | 10 +++--- packages/web3-eth-accounts/package.json | 10 +++--- packages/web3-eth-contract/CHANGELOG.md | 4 ++- packages/web3-eth-contract/package.json | 12 ++++---- packages/web3-eth/CHANGELOG.md | 4 ++- packages/web3-eth/package.json | 18 +++++------ packages/web3-utils/CHANGELOG.md | 4 ++- packages/web3-utils/package.json | 4 +-- packages/web3-validator/CHANGELOG.md | 4 ++- packages/web3-validator/package.json | 6 ++-- packages/web3/CHANGELOG.md | 5 ++- packages/web3/package.json | 14 ++++----- packages/web3/src/version.ts | 2 +- 15 files changed, 84 insertions(+), 58 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b059877dff..84176cbefbd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2289,37 +2289,50 @@ If there are any bugs, improvements, optimizations or any new feature proposal f - Fix unnecessary array copy when pack encoding (#6553) -## [Unreleased] +## [4.4.0] ### Added -#### web3 - - #### web3-eth - Catch `TransactionPollingTimeoutError` was added to send transaction events (#6623) -#### web3-utils - -- `SocketProvider` now contains public function `getPendingRequestQueueSize`, `getSentRequestsQueueSize` and `clearQueues` (#6479) -- Added `safeDisconnect` as a `SocketProvider` method to disconnect only when request queue size and send request queue size is 0 (#6479) -- Add `isContractInitOptions` method (#6555) - ### Changed -#### web3-core +#### web3-eth-abi +- Use `AbiError` instead of `Error` for errors at web3-eth-abi (#6641). #### web3-eth-contract +- Allow the `deploy` function to accept parameters, even when no ABI was provided to the `Contract`(#6635) + +#### web3 + +- Dependencies updated ### Fixed -#### web3-rpc-methods +#### web3-eth-abi -- Fix web3-types import #6590 (#6589) +- Fixed an issue with detecting Uint8Array (#6486) + +#### web3-eth-accounts + +- Send Transaction config used to be ignored if the passed `common` did not have a `copy()` and the `chainId` was not provided (#6663) +- Fixed an issue with detecting Uint8Array (#6486) + +#### web3-eth-contract + +- Fix and error that happen when trying to get past events by calling `contract.getPastEvents` or `contract.events.allEvents()`, if there is no matching events. (#6647) +- Fixed: The Contract is not using the context wallet passed if context was passed at constructor. (#6661) #### web3-utils -- Fix unnecessary array copy when pack encoding (#6553) +- Fixed an issue with detecting Uint8Array (#6486) + +#### web3-validator + +- Fixed an issue with detecting Uint8Array (#6486) + +## [Unreleased] \ No newline at end of file diff --git a/packages/web3-eth-abi/CHANGELOG.md b/packages/web3-eth-abi/CHANGELOG.md index 486ca6ab34b..6fa52af5287 100644 --- a/packages/web3-eth-abi/CHANGELOG.md +++ b/packages/web3-eth-abi/CHANGELOG.md @@ -154,7 +154,7 @@ Documentation: - Bug fix of `ERR_UNSUPPORTED_DIR_IMPORT` in ABI (#6535) -## [Unreleased] +## [4.2.0] ### Changed @@ -163,3 +163,5 @@ Documentation: ### Fixed - Fixed an issue with detecting Uint8Array (#6486) + +## [Unreleased] diff --git a/packages/web3-eth-abi/package.json b/packages/web3-eth-abi/package.json index c517e8a918e..47802dc53c1 100644 --- a/packages/web3-eth-abi/package.json +++ b/packages/web3-eth-abi/package.json @@ -1,6 +1,6 @@ { "name": "web3-eth-abi", - "version": "4.1.4", + "version": "4.2.0", "description": "Web3 module encode and decode EVM in/output.", "main": "./lib/commonjs/index.js", "module": "./lib/esm/index.js", @@ -43,10 +43,10 @@ }, "dependencies": { "abitype": "0.7.1", - "web3-errors": "^1.1.3", - "web3-types": "^1.3.0", - "web3-utils": "^4.0.7", - "web3-validator": "^2.0.3" + "web3-errors": "^1.1.4", + "web3-types": "^1.3.1", + "web3-utils": "^4.1.1", + "web3-validator": "^2.0.4" }, "devDependencies": { "@humeris/espresso-shot": "^4.0.0", diff --git a/packages/web3-eth-accounts/package.json b/packages/web3-eth-accounts/package.json index 640e2eae36c..1906d06b599 100644 --- a/packages/web3-eth-accounts/package.json +++ b/packages/web3-eth-accounts/package.json @@ -1,6 +1,6 @@ { "name": "web3-eth-accounts", - "version": "4.1.0", + "version": "4.1.1", "description": "Package for managing Ethereum accounts and signing", "main": "./lib/commonjs/index.js", "module": "./lib/esm/index.js", @@ -61,9 +61,9 @@ "@ethereumjs/rlp": "^4.0.1", "crc-32": "^1.2.2", "ethereum-cryptography": "^2.0.0", - "web3-errors": "^1.1.3", - "web3-types": "^1.3.0", - "web3-utils": "^4.0.7", - "web3-validator": "^2.0.3" + "web3-errors": "^1.1.4", + "web3-types": "^1.3.1", + "web3-utils": "^4.1.1", + "web3-validator": "^2.0.4" } } diff --git a/packages/web3-eth-contract/CHANGELOG.md b/packages/web3-eth-contract/CHANGELOG.md index 583674ff7dd..38436bdb830 100644 --- a/packages/web3-eth-contract/CHANGELOG.md +++ b/packages/web3-eth-contract/CHANGELOG.md @@ -353,7 +353,7 @@ Documentation: - By default, contracts will fill `data` instead of `input` within method calls (#6622) -## [Unreleased] +## [4.2.0] ### Changed @@ -363,3 +363,5 @@ Documentation: - Fix and error that happen when trying to get past events by calling `contract.getPastEvents` or `contract.events.allEvents()`, if there is no matching events. (#6647) - Fixed: The Contract is not using the context wallet passed if context was passed at constructor. (#6661) + +## [Unreleased] diff --git a/packages/web3-eth-contract/package.json b/packages/web3-eth-contract/package.json index 13a239bb7cb..a587cbd8679 100644 --- a/packages/web3-eth-contract/package.json +++ b/packages/web3-eth-contract/package.json @@ -1,6 +1,6 @@ { "name": "web3-eth-contract", - "version": "4.1.4", + "version": "4.2.0", "description": "Web3 module to interact with Ethereum smart contracts.", "main": "./lib/commonjs/index.js", "module": "./lib/esm/index.js", @@ -47,11 +47,11 @@ "dependencies": { "web3-core": "^4.3.2", "web3-errors": "^1.1.4", - "web3-eth": "^4.3.1", - "web3-eth-abi": "^4.1.4", + "web3-eth": "^4.4.0", + "web3-eth-abi": "^4.2.0", "web3-types": "^1.3.1", - "web3-utils": "^4.1.0", - "web3-validator": "^2.0.3" + "web3-utils": "^4.1.1", + "web3-validator": "^2.0.4" }, "devDependencies": { "@humeris/espresso-shot": "^4.0.0", @@ -67,7 +67,7 @@ "prettier": "^2.7.1", "ts-jest": "^29.1.1", "typescript": "^4.7.4", - "web3-eth-accounts": "^4.1.0", + "web3-eth-accounts": "^4.1.1", "web3-providers-ws": "^4.0.7" } } diff --git a/packages/web3-eth/CHANGELOG.md b/packages/web3-eth/CHANGELOG.md index 8724ecb756a..021eb321d59 100644 --- a/packages/web3-eth/CHANGELOG.md +++ b/packages/web3-eth/CHANGELOG.md @@ -213,8 +213,10 @@ Documentation: - Dependencies updated -## [Unreleased] +## [4.4.0] ### Added - Catch `TransactionPollingTimeoutError` was added to send transaction events (#6623) + +## [Unreleased] diff --git a/packages/web3-eth/package.json b/packages/web3-eth/package.json index b680c724e91..b4d0b8fdf15 100644 --- a/packages/web3-eth/package.json +++ b/packages/web3-eth/package.json @@ -1,6 +1,6 @@ { "name": "web3-eth", - "version": "4.3.1", + "version": "4.4.0", "description": "Web3 module to interact with the Ethereum blockchain and smart contracts.", "main": "./lib/commonjs/index.js", "module": "./lib/esm/index.js", @@ -63,15 +63,15 @@ }, "dependencies": { "setimmediate": "^1.0.5", - "web3-core": "^4.3.0", - "web3-errors": "^1.1.3", - "web3-eth-abi": "^4.1.4", - "web3-eth-accounts": "^4.1.0", + "web3-core": "^4.3.2", + "web3-errors": "^1.1.4", + "web3-eth-abi": "^4.2.0", + "web3-eth-accounts": "^4.1.1", "web3-net": "^4.0.7", "web3-providers-ws": "^4.0.7", - "web3-rpc-methods": "^1.1.3", - "web3-types": "^1.3.0", - "web3-utils": "^4.0.7", - "web3-validator": "^2.0.3" + "web3-rpc-methods": "^1.1.4", + "web3-types": "^1.3.1", + "web3-utils": "^4.1.1", + "web3-validator": "^2.0.4" } } diff --git a/packages/web3-utils/CHANGELOG.md b/packages/web3-utils/CHANGELOG.md index 30c854f6e09..d63c09119cc 100644 --- a/packages/web3-utils/CHANGELOG.md +++ b/packages/web3-utils/CHANGELOG.md @@ -181,8 +181,10 @@ Documentation: - Fix unnecessary array copy when pack encoding (#6553) -## [Unreleased] +## [4.1.1] ### Fixed - Fixed an issue with detecting Uint8Array (#6486) + +## [Unreleased] \ No newline at end of file diff --git a/packages/web3-utils/package.json b/packages/web3-utils/package.json index 6f433525e20..8eacfae6e20 100644 --- a/packages/web3-utils/package.json +++ b/packages/web3-utils/package.json @@ -1,7 +1,7 @@ { "name": "web3-utils", "sideEffects": false, - "version": "4.1.0", + "version": "4.1.1", "description": "Collection of utility functions used in web3.js.", "main": "./lib/commonjs/index.js", "module": "./lib/esm/index.js", @@ -66,6 +66,6 @@ "ethereum-cryptography": "^2.0.0", "web3-errors": "^1.1.4", "web3-types": "^1.3.1", - "web3-validator": "^2.0.3" + "web3-validator": "^2.0.4" } } diff --git a/packages/web3-validator/CHANGELOG.md b/packages/web3-validator/CHANGELOG.md index 9d8ac2e190b..46e3a9a15f0 100644 --- a/packages/web3-validator/CHANGELOG.md +++ b/packages/web3-validator/CHANGELOG.md @@ -156,8 +156,10 @@ Documentation: - Validator will now properly handle all valid numeric type sizes: intN / uintN where 8 < = N < = 256 and N % 8 == 0 (#6434) - Will now throw SchemaFormatError when unsupported format is passed to `convertToZod` method (#6434) -## [Unreleased] +## [2.0.4] ### Fixed - Fixed an issue with detecting Uint8Array (#6486) + +## [Unreleased] \ No newline at end of file diff --git a/packages/web3-validator/package.json b/packages/web3-validator/package.json index 59d26b19451..9c2466249ac 100644 --- a/packages/web3-validator/package.json +++ b/packages/web3-validator/package.json @@ -1,6 +1,6 @@ { "name": "web3-validator", - "version": "2.0.3", + "version": "2.0.4", "description": "JSON-Schema compatible validator for web3", "main": "./lib/commonjs/index.js", "module": "./lib/esm/index.js", @@ -47,8 +47,8 @@ "dependencies": { "ethereum-cryptography": "^2.0.0", "util": "^0.12.5", - "web3-errors": "^1.1.3", - "web3-types": "^1.3.0", + "web3-errors": "^1.1.4", + "web3-types": "^1.3.1", "zod": "^3.21.4" }, "devDependencies": { diff --git a/packages/web3/CHANGELOG.md b/packages/web3/CHANGELOG.md index b0bf8840826..5d0b4323625 100644 --- a/packages/web3/CHANGELOG.md +++ b/packages/web3/CHANGELOG.md @@ -183,5 +183,8 @@ Documentation: - Dependencies updated -## [Unreleased] +## [4.4.0] +- Dependencies updated ( details are in root changelog ) + +## [Unreleased] \ No newline at end of file diff --git a/packages/web3/package.json b/packages/web3/package.json index 67ada4517bf..2517aa26418 100644 --- a/packages/web3/package.json +++ b/packages/web3/package.json @@ -1,6 +1,6 @@ { "name": "web3", - "version": "4.3.0", + "version": "4.4.0", "description": "Ethereum JavaScript API", "main": "./lib/commonjs/index.js", "module": "./lib/esm/index.js", @@ -88,10 +88,10 @@ "dependencies": { "web3-core": "^4.3.2", "web3-errors": "^1.1.4", - "web3-eth": "^4.3.1", - "web3-eth-abi": "^4.1.4", - "web3-eth-accounts": "^4.1.0", - "web3-eth-contract": "^4.1.4", + "web3-eth": "^4.4.0", + "web3-eth-abi": "^4.2.0", + "web3-eth-accounts": "^4.1.1", + "web3-eth-contract": "^4.2.0", "web3-eth-ens": "^4.0.8", "web3-eth-iban": "^4.0.7", "web3-eth-personal": "^4.0.8", @@ -100,7 +100,7 @@ "web3-providers-ws": "^4.0.7", "web3-rpc-methods": "^1.1.4", "web3-types": "^1.3.1", - "web3-utils": "^4.1.0", - "web3-validator": "^2.0.3" + "web3-utils": "^4.1.1", + "web3-validator": "^2.0.4" } } diff --git a/packages/web3/src/version.ts b/packages/web3/src/version.ts index b90de9000b7..fde2e8e160c 100644 --- a/packages/web3/src/version.ts +++ b/packages/web3/src/version.ts @@ -1 +1 @@ -/* eslint-disable header/header */ export const Web3PkgInfo = { version: '4.3.0' }; +/* eslint-disable header/header */ export const Web3PkgInfo = { version: '4.4.0' }; From 41f2e8a3d6c0edb3982ba1af315de03cd26995c3 Mon Sep 17 00:00:00 2001 From: luu-alex Date: Wed, 10 Jan 2024 14:30:03 -0500 Subject: [PATCH 02/17] update changelog --- packages/web3-eth-accounts/CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/web3-eth-accounts/CHANGELOG.md b/packages/web3-eth-accounts/CHANGELOG.md index 11bddfffab1..05682b29954 100644 --- a/packages/web3-eth-accounts/CHANGELOG.md +++ b/packages/web3-eth-accounts/CHANGELOG.md @@ -149,9 +149,12 @@ Documentation: - Fixed `recover` function, `v` will be normalized to value 0,1 (#6344) -## [Unreleased] +## [4.1.1] ### Fixed - Send Transaction config used to be ignored if the passed `common` did not have a `copy()` and the `chainId` was not provided (#6663) - Fixed an issue with detecting Uint8Array (#6486) + +## [Unreleased] + From e3355c1a2a7966d12491f2c38b608b64121be500 Mon Sep 17 00:00:00 2001 From: luu-alex Date: Mon, 15 Jan 2024 13:26:20 -0500 Subject: [PATCH 03/17] debug --- packages/web3/test/e2e/sepolia/get_storage_at.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/web3/test/e2e/sepolia/get_storage_at.test.ts b/packages/web3/test/e2e/sepolia/get_storage_at.test.ts index 7702da89ffb..c28a4ab4192 100644 --- a/packages/web3/test/e2e/sepolia/get_storage_at.test.ts +++ b/packages/web3/test/e2e/sepolia/get_storage_at.test.ts @@ -78,6 +78,7 @@ describe(`${getSystemTestBackend()} tests - getStorageAt`, () => { result === '0x0000000000000000000000000000000000000000000000000000000000000000', ).toBeTruthy(); } else { + console.log(block); // eslint-disable-next-line jest/no-conditional-expect expect(result).toBe( `0x000000000000000000000000${getE2ETestAccountAddress() From a7984f9484663307d46d8bed15b9e3bd6de9277a Mon Sep 17 00:00:00 2001 From: luu-alex Date: Mon, 15 Jan 2024 13:29:06 -0500 Subject: [PATCH 04/17] add eslint --- packages/web3/test/e2e/sepolia/get_storage_at.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/web3/test/e2e/sepolia/get_storage_at.test.ts b/packages/web3/test/e2e/sepolia/get_storage_at.test.ts index c28a4ab4192..3ba6e86bd19 100644 --- a/packages/web3/test/e2e/sepolia/get_storage_at.test.ts +++ b/packages/web3/test/e2e/sepolia/get_storage_at.test.ts @@ -78,6 +78,7 @@ describe(`${getSystemTestBackend()} tests - getStorageAt`, () => { result === '0x0000000000000000000000000000000000000000000000000000000000000000', ).toBeTruthy(); } else { + // eslint-disable-next-line console.log(block); // eslint-disable-next-line jest/no-conditional-expect expect(result).toBe( From 07e893f45a2282dee3c242a5448af847d2038eb1 Mon Sep 17 00:00:00 2001 From: luu-alex Date: Mon, 15 Jan 2024 14:36:03 -0500 Subject: [PATCH 05/17] update tests --- .github/workflows/e2e_network_tests.yml | 2 +- packages/web3/test/e2e/sepolia/call.test.ts | 5 +---- packages/web3/test/e2e/sepolia/get_storage_at.test.ts | 8 +------- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/.github/workflows/e2e_network_tests.yml b/.github/workflows/e2e_network_tests.yml index c54148d6d25..490c538e366 100644 --- a/.github/workflows/e2e_network_tests.yml +++ b/.github/workflows/e2e_network_tests.yml @@ -14,7 +14,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 cache: yarn - run: yarn - run: tar -czf /tmp/web3-16.js.tar.gz --exclude="./.git" ./ diff --git a/packages/web3/test/e2e/sepolia/call.test.ts b/packages/web3/test/e2e/sepolia/call.test.ts index 33a3f7db398..9ce1333b8d4 100644 --- a/packages/web3/test/e2e/sepolia/call.test.ts +++ b/packages/web3/test/e2e/sepolia/call.test.ts @@ -24,7 +24,6 @@ import { import { toAllVariants } from '../../shared_fixtures/utils'; import { getSystemE2ETestProvider, - getE2ETestAccountAddress, getE2ETestContractAddress, } from '../e2e_utils'; @@ -89,9 +88,7 @@ describe(`${getSystemTestBackend()} tests - call`, () => { format: Object.values(FMT_BYTES), }), )('should call getOwner method from deployed contract', async ({ format }) => { - const expectedResult = `0x000000000000000000000000${getE2ETestAccountAddress() - .substring(2) - .toLowerCase()}`; + const expectedResult = "0x000000000000000000000000a127c5e6a7e3600ac34a9a9928e52521677e7211" const result = await web3.eth.call( { to: getE2ETestContractAddress(), diff --git a/packages/web3/test/e2e/sepolia/get_storage_at.test.ts b/packages/web3/test/e2e/sepolia/get_storage_at.test.ts index 3ba6e86bd19..43f73e8a263 100644 --- a/packages/web3/test/e2e/sepolia/get_storage_at.test.ts +++ b/packages/web3/test/e2e/sepolia/get_storage_at.test.ts @@ -17,7 +17,6 @@ along with web3.js. If not, see . import Web3, { Numbers } from '../../../src'; import { getSystemE2ETestProvider, - getE2ETestAccountAddress, getE2ETestContractAddress, } from '../e2e_utils'; import { @@ -78,13 +77,8 @@ describe(`${getSystemTestBackend()} tests - getStorageAt`, () => { result === '0x0000000000000000000000000000000000000000000000000000000000000000', ).toBeTruthy(); } else { - // eslint-disable-next-line - console.log(block); // eslint-disable-next-line jest/no-conditional-expect - expect(result).toBe( - `0x000000000000000000000000${getE2ETestAccountAddress() - .substring(2) - .toLowerCase()}`, + expect(result).toBe("0x000000000000000000000000a127c5e6a7e3600ac34a9a9928e52521677e7211" ); } }); From 6cd5cb2924672a540f807d250a03c60b06381f46 Mon Sep 17 00:00:00 2001 From: luu-alex Date: Mon, 15 Jan 2024 14:52:19 -0500 Subject: [PATCH 06/17] update node ver --- .github/workflows/e2e_network_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e_network_tests.yml b/.github/workflows/e2e_network_tests.yml index 490c538e366..c54148d6d25 100644 --- a/.github/workflows/e2e_network_tests.yml +++ b/.github/workflows/e2e_network_tests.yml @@ -14,7 +14,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 18 + node-version: 16 cache: yarn - run: yarn - run: tar -czf /tmp/web3-16.js.tar.gz --exclude="./.git" ./ From 274ed142fa1f0a2dfad506440ee42a28b7f05c13 Mon Sep 17 00:00:00 2001 From: luu-alex Date: Tue, 16 Jan 2024 14:12:17 -0500 Subject: [PATCH 07/17] debug --- packages/web3-eth-abi/src/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/web3-eth-abi/src/utils.ts b/packages/web3-eth-abi/src/utils.ts index 79c15b78d78..0f819449d64 100644 --- a/packages/web3-eth-abi/src/utils.ts +++ b/packages/web3-eth-abi/src/utils.ts @@ -166,7 +166,7 @@ export const formatParam = (type: string, _param: unknown): unknown => { const param = typeof _param === 'object' && !Array.isArray(_param) ? { ..._param } : _param; // Format BN to string - if (param instanceof BigInt || typeof param === 'bigint') { + if (param instanceof BigInt) { return param.toString(10); } From 2fd9ca8fbbb5060e8de68c6f61eb5893ed4af7f9 Mon Sep 17 00:00:00 2001 From: luu-alex Date: Tue, 16 Jan 2024 14:31:33 -0500 Subject: [PATCH 08/17] update balance --- packages/web3/test/e2e/get_balance.test.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/web3/test/e2e/get_balance.test.ts b/packages/web3/test/e2e/get_balance.test.ts index f1f658faa8c..5b8264ef791 100644 --- a/packages/web3/test/e2e/get_balance.test.ts +++ b/packages/web3/test/e2e/get_balance.test.ts @@ -58,7 +58,6 @@ describe(`${getSystemTestBackend()} tests - getBalance`, () => { 'pending', 'safe', 'finalized', - 'blockHash', 'blockNumber', ], format: [FMT_NUMBER.BIGINT, FMT_NUMBER.HEX, FMT_NUMBER.STR], @@ -85,7 +84,7 @@ describe(`${getSystemTestBackend()} tests - getBalance`, () => { expect(result).toBe(expectedBalance); break; case 'NUMBER_BIGINT': - // eslint-disable-next-line jest/no-conditional-expect + // eslint-dgit cisable-next-line jest/no-conditional-expect expect(result).toBe(BigInt(expectedBalance)); break; default: From 7eba4f6dba61abccd6df2a9f641943e6ae51d75d Mon Sep 17 00:00:00 2001 From: luu-alex Date: Tue, 16 Jan 2024 14:34:52 -0500 Subject: [PATCH 09/17] update --- packages/web3/test/e2e/get_balance.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/web3/test/e2e/get_balance.test.ts b/packages/web3/test/e2e/get_balance.test.ts index 5b8264ef791..a2746d66773 100644 --- a/packages/web3/test/e2e/get_balance.test.ts +++ b/packages/web3/test/e2e/get_balance.test.ts @@ -84,7 +84,7 @@ describe(`${getSystemTestBackend()} tests - getBalance`, () => { expect(result).toBe(expectedBalance); break; case 'NUMBER_BIGINT': - // eslint-dgit cisable-next-line jest/no-conditional-expect + // eslint-disable-next-line jest/no-conditional-expect expect(result).toBe(BigInt(expectedBalance)); break; default: From 81cec381c14da3bf81395dc6850e419734a6420f Mon Sep 17 00:00:00 2001 From: luu-alex Date: Tue, 16 Jan 2024 14:54:37 -0500 Subject: [PATCH 10/17] update address --- packages/web3/test/e2e/get_balance.test.ts | 6 ++++-- packages/web3/test/e2e/get_transaction_count.test.ts | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/web3/test/e2e/get_balance.test.ts b/packages/web3/test/e2e/get_balance.test.ts index a2746d66773..96bcecb55db 100644 --- a/packages/web3/test/e2e/get_balance.test.ts +++ b/packages/web3/test/e2e/get_balance.test.ts @@ -58,12 +58,14 @@ describe(`${getSystemTestBackend()} tests - getBalance`, () => { 'pending', 'safe', 'finalized', + 'blockHash', 'blockNumber', ], format: [FMT_NUMBER.BIGINT, FMT_NUMBER.HEX, FMT_NUMBER.STR], }), )('getBalance', async ({ block, format }) => { - const result = await web3.eth.getBalance(getE2ETestAccountAddress(), blockData[block], { + const address = getSystemTestBackend() === 'sepolia' ? '0xa127C5E6a7E3600Ac34A9a9928E52521677e7211' : '0x98AF911164f9d4E0f5983ed114949c3Bfe3ADc9d' + const result = await web3.eth.getBalance(address, blockData[block], { number: format as FMT_NUMBER, bytes: FMT_BYTES.HEX, }); @@ -84,7 +86,7 @@ describe(`${getSystemTestBackend()} tests - getBalance`, () => { expect(result).toBe(expectedBalance); break; case 'NUMBER_BIGINT': - // eslint-disable-next-line jest/no-conditional-expect + // eslint-dgit cisable-next-line jest/no-conditional-expect expect(result).toBe(BigInt(expectedBalance)); break; default: diff --git a/packages/web3/test/e2e/get_transaction_count.test.ts b/packages/web3/test/e2e/get_transaction_count.test.ts index 62e3fad818c..8842b4c5a04 100644 --- a/packages/web3/test/e2e/get_transaction_count.test.ts +++ b/packages/web3/test/e2e/get_transaction_count.test.ts @@ -57,8 +57,9 @@ describe(`${getSystemTestBackend()} tests - getTransactionCount`, () => { ], }), )('getTransactionCount', async ({ block }) => { + const address = getSystemTestBackend() === 'sepolia' ? '0xa127C5E6a7E3600Ac34A9a9928E52521677e7211' : '0x98AF911164f9d4E0f5983ed114949c3Bfe3ADc9d' const result = await web3.eth.getTransactionCount( - getE2ETestAccountAddress(), + address, blockData[block], ); From 40338749a224a796f55299543dbafdb33fc827c1 Mon Sep 17 00:00:00 2001 From: luu-alex Date: Tue, 16 Jan 2024 14:59:08 -0500 Subject: [PATCH 11/17] fix lint --- packages/web3/test/e2e/get_balance.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/web3/test/e2e/get_balance.test.ts b/packages/web3/test/e2e/get_balance.test.ts index 96bcecb55db..6588f491946 100644 --- a/packages/web3/test/e2e/get_balance.test.ts +++ b/packages/web3/test/e2e/get_balance.test.ts @@ -86,7 +86,7 @@ describe(`${getSystemTestBackend()} tests - getBalance`, () => { expect(result).toBe(expectedBalance); break; case 'NUMBER_BIGINT': - // eslint-dgit cisable-next-line jest/no-conditional-expect + // eslint-disable-next-line jest/no-conditional-expect expect(result).toBe(BigInt(expectedBalance)); break; default: From 33e70f47e9668ff8a0a2959faf48322b78e1a246 Mon Sep 17 00:00:00 2001 From: luu-alex Date: Tue, 16 Jan 2024 15:06:18 -0500 Subject: [PATCH 12/17] fix test error --- packages/web3/test/e2e/get_balance.test.ts | 2 +- packages/web3/test/e2e/get_transaction_count.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/web3/test/e2e/get_balance.test.ts b/packages/web3/test/e2e/get_balance.test.ts index 6588f491946..efaa93f1730 100644 --- a/packages/web3/test/e2e/get_balance.test.ts +++ b/packages/web3/test/e2e/get_balance.test.ts @@ -18,7 +18,7 @@ import { isBigInt, isHexStrict, isString } from 'web3-validator'; import { toHex } from 'web3-utils'; import Web3, { FMT_BYTES, FMT_NUMBER } from '../../src'; -import { getSystemE2ETestProvider, getE2ETestAccountAddress } from './e2e_utils'; +import { getSystemE2ETestProvider } from './e2e_utils'; import { closeOpenConnection, getSystemTestBackend } from '../shared_fixtures/system_tests_utils'; import { toAllVariants } from '../shared_fixtures/utils'; import { sepoliaBlockData } from './fixtures/sepolia'; diff --git a/packages/web3/test/e2e/get_transaction_count.test.ts b/packages/web3/test/e2e/get_transaction_count.test.ts index 8842b4c5a04..c74c8ceb080 100644 --- a/packages/web3/test/e2e/get_transaction_count.test.ts +++ b/packages/web3/test/e2e/get_transaction_count.test.ts @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with web3.js. If not, see . */ import Web3 from '../../src'; -import { getSystemE2ETestProvider, getE2ETestAccountAddress } from './e2e_utils'; +import { getSystemE2ETestProvider } from './e2e_utils'; import { closeOpenConnection, getSystemTestBackend } from '../shared_fixtures/system_tests_utils'; import { toAllVariants } from '../shared_fixtures/utils'; import { sepoliaBlockData } from './fixtures/sepolia'; From 7f871ce32804d911d69e1531728abd1be344877c Mon Sep 17 00:00:00 2001 From: luu-alex Date: Tue, 16 Jan 2024 15:25:23 -0500 Subject: [PATCH 13/17] update addresses --- .github/workflows/e2e_network_tests.yml | 2 +- packages/web3-eth-abi/src/utils.ts | 2 +- packages/web3/test/e2e/get_balance.test.ts | 7 +++---- packages/web3/test/e2e/get_transaction_count.test.ts | 5 ++--- packages/web3/test/e2e/sepolia/get_storage_at.test.ts | 6 +++++- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/e2e_network_tests.yml b/.github/workflows/e2e_network_tests.yml index c54148d6d25..58adb0ee4bf 100644 --- a/.github/workflows/e2e_network_tests.yml +++ b/.github/workflows/e2e_network_tests.yml @@ -30,7 +30,7 @@ jobs: INFURA_SEPOLIA_HTTP: ${{ secrets.INFURA_SEPOLIA_HTTP }} INFURA_MAINNET_HTTP: ${{ secrets.INFURA_MAINNET_HTTP }} MODE: ${{ matrix.mode }} - TEST_ACCOUNT_ADDRESS: ${{ fromJSON('{"sepolia":"0x0000000000000000000000000000000000000000","mainnet":"0x0000000000000000000000000000000000000000"}')[matrix.network] }} + TEST_ACCOUNT_ADDRESS: ${{ fromJSON('{"sepolia":"0xa127C5E6a7E3600Ac34A9a9928E52521677e7211","mainnet":"0x98AF911164f9d4E0f5983ed114949c3Bfe3ADc9d"}')[matrix.network] }} ALLOWED_SEND_TRANSACTION: ${{ secrets.E2E_TESTS_ALLOWED_SEND_TRANSACTION }} TEST_ACCOUNT_PRIVATE_KEY: ${{ secrets.TEST_ACCOUNT_PRIVATE_KEY }} strategy: diff --git a/packages/web3-eth-abi/src/utils.ts b/packages/web3-eth-abi/src/utils.ts index 0f819449d64..79c15b78d78 100644 --- a/packages/web3-eth-abi/src/utils.ts +++ b/packages/web3-eth-abi/src/utils.ts @@ -166,7 +166,7 @@ export const formatParam = (type: string, _param: unknown): unknown => { const param = typeof _param === 'object' && !Array.isArray(_param) ? { ..._param } : _param; // Format BN to string - if (param instanceof BigInt) { + if (param instanceof BigInt || typeof param === 'bigint') { return param.toString(10); } diff --git a/packages/web3/test/e2e/get_balance.test.ts b/packages/web3/test/e2e/get_balance.test.ts index efaa93f1730..76d1a42ba41 100644 --- a/packages/web3/test/e2e/get_balance.test.ts +++ b/packages/web3/test/e2e/get_balance.test.ts @@ -18,7 +18,7 @@ import { isBigInt, isHexStrict, isString } from 'web3-validator'; import { toHex } from 'web3-utils'; import Web3, { FMT_BYTES, FMT_NUMBER } from '../../src'; -import { getSystemE2ETestProvider } from './e2e_utils'; +import { getSystemE2ETestProvider, getE2ETestAccountAddress } from './e2e_utils'; import { closeOpenConnection, getSystemTestBackend } from '../shared_fixtures/system_tests_utils'; import { toAllVariants } from '../shared_fixtures/utils'; import { sepoliaBlockData } from './fixtures/sepolia'; @@ -64,8 +64,7 @@ describe(`${getSystemTestBackend()} tests - getBalance`, () => { format: [FMT_NUMBER.BIGINT, FMT_NUMBER.HEX, FMT_NUMBER.STR], }), )('getBalance', async ({ block, format }) => { - const address = getSystemTestBackend() === 'sepolia' ? '0xa127C5E6a7E3600Ac34A9a9928E52521677e7211' : '0x98AF911164f9d4E0f5983ed114949c3Bfe3ADc9d' - const result = await web3.eth.getBalance(address, blockData[block], { + const result = await web3.eth.getBalance(getE2ETestAccountAddress(), blockData[block], { number: format as FMT_NUMBER, bytes: FMT_BYTES.HEX, }); @@ -86,7 +85,7 @@ describe(`${getSystemTestBackend()} tests - getBalance`, () => { expect(result).toBe(expectedBalance); break; case 'NUMBER_BIGINT': - // eslint-disable-next-line jest/no-conditional-expect + // eslint-dgit cisable-next-line jest/no-conditional-expect expect(result).toBe(BigInt(expectedBalance)); break; default: diff --git a/packages/web3/test/e2e/get_transaction_count.test.ts b/packages/web3/test/e2e/get_transaction_count.test.ts index c74c8ceb080..62e3fad818c 100644 --- a/packages/web3/test/e2e/get_transaction_count.test.ts +++ b/packages/web3/test/e2e/get_transaction_count.test.ts @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with web3.js. If not, see . */ import Web3 from '../../src'; -import { getSystemE2ETestProvider } from './e2e_utils'; +import { getSystemE2ETestProvider, getE2ETestAccountAddress } from './e2e_utils'; import { closeOpenConnection, getSystemTestBackend } from '../shared_fixtures/system_tests_utils'; import { toAllVariants } from '../shared_fixtures/utils'; import { sepoliaBlockData } from './fixtures/sepolia'; @@ -57,9 +57,8 @@ describe(`${getSystemTestBackend()} tests - getTransactionCount`, () => { ], }), )('getTransactionCount', async ({ block }) => { - const address = getSystemTestBackend() === 'sepolia' ? '0xa127C5E6a7E3600Ac34A9a9928E52521677e7211' : '0x98AF911164f9d4E0f5983ed114949c3Bfe3ADc9d' const result = await web3.eth.getTransactionCount( - address, + getE2ETestAccountAddress(), blockData[block], ); diff --git a/packages/web3/test/e2e/sepolia/get_storage_at.test.ts b/packages/web3/test/e2e/sepolia/get_storage_at.test.ts index 43f73e8a263..7702da89ffb 100644 --- a/packages/web3/test/e2e/sepolia/get_storage_at.test.ts +++ b/packages/web3/test/e2e/sepolia/get_storage_at.test.ts @@ -17,6 +17,7 @@ along with web3.js. If not, see . import Web3, { Numbers } from '../../../src'; import { getSystemE2ETestProvider, + getE2ETestAccountAddress, getE2ETestContractAddress, } from '../e2e_utils'; import { @@ -78,7 +79,10 @@ describe(`${getSystemTestBackend()} tests - getStorageAt`, () => { ).toBeTruthy(); } else { // eslint-disable-next-line jest/no-conditional-expect - expect(result).toBe("0x000000000000000000000000a127c5e6a7e3600ac34a9a9928e52521677e7211" + expect(result).toBe( + `0x000000000000000000000000${getE2ETestAccountAddress() + .substring(2) + .toLowerCase()}`, ); } }); From 88f76bad9613516808db27c11a56f724d9f27799 Mon Sep 17 00:00:00 2001 From: luu-alex Date: Tue, 16 Jan 2024 15:28:47 -0500 Subject: [PATCH 14/17] update lint --- packages/web3/test/e2e/get_balance.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/web3/test/e2e/get_balance.test.ts b/packages/web3/test/e2e/get_balance.test.ts index 76d1a42ba41..f1f658faa8c 100644 --- a/packages/web3/test/e2e/get_balance.test.ts +++ b/packages/web3/test/e2e/get_balance.test.ts @@ -85,7 +85,7 @@ describe(`${getSystemTestBackend()} tests - getBalance`, () => { expect(result).toBe(expectedBalance); break; case 'NUMBER_BIGINT': - // eslint-dgit cisable-next-line jest/no-conditional-expect + // eslint-disable-next-line jest/no-conditional-expect expect(result).toBe(BigInt(expectedBalance)); break; default: From bd88a426e37f205bd487c2acb97adbbf9c7a9342 Mon Sep 17 00:00:00 2001 From: luu-alex Date: Tue, 16 Jan 2024 15:48:14 -0500 Subject: [PATCH 15/17] update estimate_gas values --- packages/web3/test/e2e/estimate_gas.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/web3/test/e2e/estimate_gas.test.ts b/packages/web3/test/e2e/estimate_gas.test.ts index 872b31db6ac..c4bf1c522eb 100644 --- a/packages/web3/test/e2e/estimate_gas.test.ts +++ b/packages/web3/test/e2e/estimate_gas.test.ts @@ -27,13 +27,13 @@ describe(`${getSystemTestBackend()} tests - estimateGas`, () => { const provider = getSystemE2ETestProvider(); const blockData = getSystemTestBackend() === 'sepolia' ? sepoliaBlockData : mainnetBlockData; const simpleEthTransaction: Transaction = { - from: getE2ETestAccountAddress(), + from: '0x0000000000000000000000000000000000000000', to: '0x0000000000000000000000000000000000000000', value: '0x1', }; const expectedSimpleEthTransactionGas = 21000; const contractDeploymentTransaction: Transaction = { - from: getE2ETestAccountAddress(), + from: '0x0000000000000000000000000000000000000000', data: '0x60806040523480156200001157600080fd5b5060405162000a6a38038062000a6a8339818101604052810190620000379190620002a4565b80600090805190602001906200004f92919062000057565b505062000359565b828054620000659062000324565b90600052602060002090601f016020900481019282620000895760008555620000d5565b82601f10620000a457805160ff1916838001178555620000d5565b82800160010185558215620000d5579182015b82811115620000d4578251825591602001919060010190620000b7565b5b509050620000e49190620000e8565b5090565b5b8082111562000103576000816000905550600101620000e9565b5090565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b620001708262000125565b810181811067ffffffffffffffff8211171562000192576200019162000136565b5b80604052505050565b6000620001a762000107565b9050620001b5828262000165565b919050565b600067ffffffffffffffff821115620001d857620001d762000136565b5b620001e38262000125565b9050602081019050919050565b60005b8381101562000210578082015181840152602081019050620001f3565b8381111562000220576000848401525b50505050565b60006200023d6200023784620001ba565b6200019b565b9050828152602081018484840111156200025c576200025b62000120565b5b62000269848285620001f0565b509392505050565b600082601f8301126200028957620002886200011b565b5b81516200029b84826020860162000226565b91505092915050565b600060208284031215620002bd57620002bc62000111565b5b600082015167ffffffffffffffff811115620002de57620002dd62000116565b5b620002ec8482850162000271565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806200033d57607f821691505b602082108103620003535762000352620002f5565b5b50919050565b61070180620003696000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063a41368621461003b578063cfae32171461006c575b600080fd5b6100556004803603810190610050919061043f565b61008a565b60405161006392919061052b565b60405180910390f35b6100746101b0565b604051610081919061055b565b60405180910390f35b600060607f0d363f2fba46ab11b6db8da0125b0d5484787c44e265b48810735998bab12b756000846040516100c0929190610672565b60405180910390a182600090805190602001906100de929190610242565b507f7d7846723bda52976e0286c6efffee937ee9f76817a867ec70531ad29fb1fc0e600060405161010f91906106a9565b60405180910390a160016000808054610127906105ac565b80601f0160208091040260200160405190810160405280929190818152602001828054610153906105ac565b80156101a05780601f10610175576101008083540402835291602001916101a0565b820191906000526020600020905b81548152906001019060200180831161018357829003601f168201915b5050505050905091509150915091565b6060600080546101bf906105ac565b80601f01602080910402602001604051908101604052809291908181526020018280546101eb906105ac565b80156102385780601f1061020d57610100808354040283529160200191610238565b820191906000526020600020905b81548152906001019060200180831161021b57829003601f168201915b5050505050905090565b82805461024e906105ac565b90600052602060002090601f01602090048101928261027057600085556102b7565b82601f1061028957805160ff19168380011785556102b7565b828001600101855582156102b7579182015b828111156102b657825182559160200191906001019061029b565b5b5090506102c491906102c8565b5090565b5b808211156102e15760008160009055506001016102c9565b5090565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61034c82610303565b810181811067ffffffffffffffff8211171561036b5761036a610314565b5b80604052505050565b600061037e6102e5565b905061038a8282610343565b919050565b600067ffffffffffffffff8211156103aa576103a9610314565b5b6103b382610303565b9050602081019050919050565b82818337600083830152505050565b60006103e26103dd8461038f565b610374565b9050828152602081018484840111156103fe576103fd6102fe565b5b6104098482856103c0565b509392505050565b600082601f830112610426576104256102f9565b5b81356104368482602086016103cf565b91505092915050565b600060208284031215610455576104546102ef565b5b600082013567ffffffffffffffff811115610473576104726102f4565b5b61047f84828501610411565b91505092915050565b60008115159050919050565b61049d81610488565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b838110156104dd5780820151818401526020810190506104c2565b838111156104ec576000848401525b50505050565b60006104fd826104a3565b61050781856104ae565b93506105178185602086016104bf565b61052081610303565b840191505092915050565b60006040820190506105406000830185610494565b818103602083015261055281846104f2565b90509392505050565b6000602082019050818103600083015261057581846104f2565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806105c457607f821691505b6020821081036105d7576105d661057d565b5b50919050565b60008190508160005260206000209050919050565b600081546105ff816105ac565b61060981866104ae565b94506001821660008114610624576001811461063657610669565b60ff1983168652602086019350610669565b61063f856105dd565b60005b8381101561066157815481890152600182019150602081019050610642565b808801955050505b50505092915050565b6000604082019050818103600083015261068c81856105f2565b905081810360208301526106a081846104f2565b90509392505050565b600060208201905081810360008301526106c381846105f2565b90509291505056fea2646970667358221220fe0f28c9f8ef0a13a95934b974e7bc2ca6762b40a5b93ccd6ca2038f454bf52764736f6c634300080e003300000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000017736f6c79656e7420677265656e2069732070656f706c65000000000000000000', }; const expectedContractDeploymentTransactionGas = From 5dfffe8978fbf3b6389746fefae4b30cbd645d91 Mon Sep 17 00:00:00 2001 From: luu-alex Date: Tue, 16 Jan 2024 15:59:05 -0500 Subject: [PATCH 16/17] fix error --- packages/web3/test/e2e/estimate_gas.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/web3/test/e2e/estimate_gas.test.ts b/packages/web3/test/e2e/estimate_gas.test.ts index c4bf1c522eb..edccebcf063 100644 --- a/packages/web3/test/e2e/estimate_gas.test.ts +++ b/packages/web3/test/e2e/estimate_gas.test.ts @@ -17,7 +17,7 @@ along with web3.js. If not, see . import { toHex } from 'web3-utils'; import Web3, { FMT_BYTES, FMT_NUMBER, Transaction } from '../../src'; -import { getSystemE2ETestProvider, getE2ETestAccountAddress } from './e2e_utils'; +import { getSystemE2ETestProvider } from './e2e_utils'; import { closeOpenConnection, getSystemTestBackend } from '../shared_fixtures/system_tests_utils'; import { toAllVariants } from '../shared_fixtures/utils'; import { mainnetBlockData } from './fixtures/mainnet'; From ff51bd09717df37369658d383bea86e319778acb Mon Sep 17 00:00:00 2001 From: luu-alex Date: Tue, 16 Jan 2024 16:17:07 -0500 Subject: [PATCH 17/17] update address --- packages/web3/test/e2e/sepolia/call.test.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/web3/test/e2e/sepolia/call.test.ts b/packages/web3/test/e2e/sepolia/call.test.ts index 9ce1333b8d4..33a3f7db398 100644 --- a/packages/web3/test/e2e/sepolia/call.test.ts +++ b/packages/web3/test/e2e/sepolia/call.test.ts @@ -24,6 +24,7 @@ import { import { toAllVariants } from '../../shared_fixtures/utils'; import { getSystemE2ETestProvider, + getE2ETestAccountAddress, getE2ETestContractAddress, } from '../e2e_utils'; @@ -88,7 +89,9 @@ describe(`${getSystemTestBackend()} tests - call`, () => { format: Object.values(FMT_BYTES), }), )('should call getOwner method from deployed contract', async ({ format }) => { - const expectedResult = "0x000000000000000000000000a127c5e6a7e3600ac34a9a9928e52521677e7211" + const expectedResult = `0x000000000000000000000000${getE2ETestAccountAddress() + .substring(2) + .toLowerCase()}`; const result = await web3.eth.call( { to: getE2ETestContractAddress(),