From 1724f3542ccfe3c17af9e14b93da72a2f65d959e Mon Sep 17 00:00:00 2001 From: Kris <605420+krzysu@users.noreply.github.com> Date: Mon, 11 Nov 2024 09:14:43 +0100 Subject: [PATCH 01/21] fix: correctly close ws connection in web3-eth-contract integration tests (#7338) --- lerna.json | 10 +- packages/web3-eth-contract/package.json | 4 +- .../integration/contract_accesslist.test.ts | 17 +- .../test/integration/contract_clone.test.ts | 13 +- .../integration/contract_defaults.test.ts | 22 +- .../contract_defaults_extra.test.ts | 145 ++++----- .../test/integration/contract_deploy.test.ts | 77 +++-- .../integration/contract_empty_string.test.ts | 13 +- .../test/integration/contract_erc20.test.ts | 43 ++- .../test/integration/contract_erc721.test.ts | 76 ++--- .../contract_estimateGas_without_0x.test.ts | 10 +- .../test/integration/contract_events.test.ts | 279 +++++++++--------- .../contract_filter_events.test.ts | 10 + .../test/integration/contract_methods.test.ts | 9 + .../contract_methods_errors.test.ts | 5 +- .../contract_negative_numbers.test.ts | 15 +- .../contract_simple_overloaded.test.ts | 12 +- .../local_account/contract_deploy.test.ts | 15 +- .../local_account/contract_erc20.test.ts | 10 +- .../local_account/contract_erc721.test.ts | 17 +- .../contract_overloaded_methods.test.ts | 10 +- scripts/system_tests_utils.ts | 22 +- 22 files changed, 487 insertions(+), 347 deletions(-) diff --git a/lerna.json b/lerna.json index b5104ac58aa..e45823a46f8 100644 --- a/lerna.json +++ b/lerna.json @@ -1,7 +1,7 @@ { - "lerna": "4.0.0", - "npmClient": "yarn", - "useWorkspaces": true, - "version": "independent", - "packages": ["packages/*", "tools/*"] + "lerna": "4.0.0", + "npmClient": "yarn", + "useWorkspaces": true, + "version": "independent", + "packages": ["packages/*", "tools/*"] } diff --git a/packages/web3-eth-contract/package.json b/packages/web3-eth-contract/package.json index 4d780091c80..30db5ffc723 100644 --- a/packages/web3-eth-contract/package.json +++ b/packages/web3-eth-contract/package.json @@ -35,11 +35,11 @@ "format": "prettier --write '**/*'", "test": "jest --config=./test/unit/jest.config.js", "test:coverage:unit": "jest --config=./test/unit/jest.config.js --coverage=true --coverage-reporters=text", - "test:coverage:integration": "jest --config=./test/integration/jest.config.js --runInBand --forceExit --coverage=true --coverage-reporters=text", + "test:coverage:integration": "jest --config=./test/integration/jest.config.js --runInBand --coverage=true --coverage-reporters=text", "test:ci": "jest --coverage=true --coverage-reporters=json --verbose", "test:watch": "npm test -- --watch", "test:unit": "jest --config=./test/unit/jest.config.js", - "test:integration": "jest --config=./test/integration/jest.config.js --runInBand --forceExit", + "test:integration": "jest --config=./test/integration/jest.config.js --runInBand", "test:e2e:electron": "npx cypress run --headless --browser electron --env grep='ignore',invert=true", "test:e2e:chrome": "npx cypress run --headless --browser chrome --env grep='ignore',invert=true", "test:e2e:firefox": "npx cypress run --headless --browser firefox --env grep='ignore',invert=true" diff --git a/packages/web3-eth-contract/test/integration/contract_accesslist.test.ts b/packages/web3-eth-contract/test/integration/contract_accesslist.test.ts index 3173f452c33..9c1aff2af36 100644 --- a/packages/web3-eth-contract/test/integration/contract_accesslist.test.ts +++ b/packages/web3-eth-contract/test/integration/contract_accesslist.test.ts @@ -23,16 +23,18 @@ import { describeIf, getSystemTestBackend, BACKEND, + closeOpenConnection, } from '../fixtures/system_test_utils'; describe('contract', () => { describeIf(getSystemTestBackend() === BACKEND.GETH)('createAccessList', () => { let contract: Contract; + let deployedContract: Contract; let deployOptions: Record; let sendOptions: Record; let acc: { address: string; privateKey: string }; - beforeEach(async () => { + beforeAll(async () => { contract = new Contract(GreeterAbi, undefined, { provider: getSystemTestProvider(), }); @@ -46,10 +48,16 @@ describe('contract', () => { sendOptions = { from: acc.address, gas: '1000000' }; }); - it('create access list for setter', async () => { - const deployedContract = await contract.deploy(deployOptions).send(sendOptions); + afterAll(async () => { + await closeOpenConnection(contract); + }); + + beforeEach(async () => { + deployedContract = await contract.deploy(deployOptions).send(sendOptions); deployedContract.defaultAccount = acc.address; + }); + it('create access list for setter', async () => { const receipt = await deployedContract.methods .setGreeting('New Greeting') .send({ gas: '1000000' }); @@ -75,9 +83,6 @@ describe('contract', () => { }); it('create access list for getter', async () => { - const deployedContract = await contract.deploy(deployOptions).send(sendOptions); - deployedContract.defaultAccount = acc.address; - const receipt = await deployedContract.methods .setGreeting('New Greeting') .send({ gas: '1000000' }); diff --git a/packages/web3-eth-contract/test/integration/contract_clone.test.ts b/packages/web3-eth-contract/test/integration/contract_clone.test.ts index 873ac0658ea..e27b0be402f 100644 --- a/packages/web3-eth-contract/test/integration/contract_clone.test.ts +++ b/packages/web3-eth-contract/test/integration/contract_clone.test.ts @@ -16,13 +16,18 @@ along with web3.js. If not, see . */ import { Contract } from '../../src'; import { GreeterBytecode, GreeterAbi } from '../shared_fixtures/build/Greeter'; -import { getSystemTestProvider, createTempAccount } from '../fixtures/system_test_utils'; +import { + getSystemTestProvider, + createTempAccount, + closeOpenConnection, +} from '../fixtures/system_test_utils'; describe('contract', () => { describe('clone', () => { let contract: Contract; let deployOptions: Record; let sendOptions: Record; + beforeAll(async () => { contract = new Contract(GreeterAbi, undefined, { provider: getSystemTestProvider(), @@ -34,7 +39,11 @@ describe('contract', () => { arguments: ['My Greeting'], }; - sendOptions = { from: acc.address, gas: '1000000' }; + sendOptions = { from: acc.address }; + }); + + afterAll(async () => { + await closeOpenConnection(contract); }); it('should clone the contract but with same address', async () => { diff --git a/packages/web3-eth-contract/test/integration/contract_defaults.test.ts b/packages/web3-eth-contract/test/integration/contract_defaults.test.ts index b481237c739..0f28e31269b 100644 --- a/packages/web3-eth-contract/test/integration/contract_defaults.test.ts +++ b/packages/web3-eth-contract/test/integration/contract_defaults.test.ts @@ -20,7 +20,11 @@ import { Web3Context } from 'web3-core'; import { Contract } from '../../src'; import { GreeterBytecode, GreeterAbi } from '../shared_fixtures/build/Greeter'; -import { getSystemTestProvider, createTempAccount } from '../fixtures/system_test_utils'; +import { + getSystemTestProvider, + createTempAccount, + closeOpenConnection, +} from '../fixtures/system_test_utils'; describe('contract', () => { describe('defaults', () => { @@ -43,6 +47,10 @@ describe('contract', () => { sendOptions = { from: acc.address, gas: '1000000' }; }); + afterEach(async () => { + await closeOpenConnection(contract); + }); + it('should use "defaultAccount" on "instance" level instead of "from"', async () => { const deployedContract = await contract.deploy(deployOptions).send(sendOptions); // eslint-disable-next-line prefer-destructuring @@ -63,23 +71,27 @@ describe('contract', () => { }); it('should set syncWithContext from init options', async () => { - contract = new Contract(GreeterAbi, { + const testContract = new Contract(GreeterAbi, { provider: getSystemTestProvider(), syncWithContext: true, }); - contract = await contract.deploy(deployOptions).send(sendOptions); + const deployedContract = await testContract.deploy(deployOptions).send(sendOptions); - expect(contract.syncWithContext).toBeTruthy(); + expect(deployedContract.syncWithContext).toBeTruthy(); + + await closeOpenConnection(testContract); }); - it('should subscribe to provided context upon instantiation', () => { + it('should subscribe to provided context upon instantiation', async () => { const web3Context = new Web3Context('http://127.0.0.1:8545'); const _contract = new Contract([], { syncWithContext: true }, web3Context); expect(_contract.defaultBlock).toBe('latest'); web3Context.defaultBlock = 'earliest'; expect(_contract.defaultBlock).toBe('earliest'); + + await closeOpenConnection(_contract); }); describe('defaultBlock', () => { diff --git a/packages/web3-eth-contract/test/integration/contract_defaults_extra.test.ts b/packages/web3-eth-contract/test/integration/contract_defaults_extra.test.ts index 206b10ee709..ce4f126a539 100644 --- a/packages/web3-eth-contract/test/integration/contract_defaults_extra.test.ts +++ b/packages/web3-eth-contract/test/integration/contract_defaults_extra.test.ts @@ -48,7 +48,11 @@ describe('contract defaults (extra)', () => { let sendOptions: Record; let acc: { address: string; privateKey: string }; - beforeEach(async () => { + beforeAll(async () => { + contract = new Contract(GreeterAbi, undefined, { + provider: getSystemTestProvider(), + }); + acc = await createTempAccount(); deployOptions = { @@ -59,27 +63,23 @@ describe('contract defaults (extra)', () => { sendOptions = { from: acc.address, gas: '1000000' }; }); - afterEach(async () => { + afterAll(async () => { await closeOpenConnection(contract); }); it('should use "defaultHardfork" on "instance" level', async () => { const hardfork = 'berlin'; - contract = new Contract(GreeterAbi, undefined, { - provider: getSystemTestProvider(), - }); - - contract = await contract.deploy(deployOptions).send(sendOptions); - contract.defaultHardfork = hardfork; + const deployedContract = await contract.deploy(deployOptions).send(sendOptions); + deployedContract.defaultHardfork = hardfork; - await contract.methods.setGreeting('New Greeting').send(sendOptions); - await contract.methods.greet().send(sendOptions); + await deployedContract.methods.setGreeting('New Greeting').send(sendOptions); + await deployedContract.methods.greet().send(sendOptions); - expect(contract.defaultHardfork).toBe(hardfork); + expect(deployedContract.defaultHardfork).toBe(hardfork); const callSpy = jest.spyOn(Web3Eth, 'call'); - await contract.methods.greet().call(); + await deployedContract.methods.greet().call(); expect(callSpy).toHaveBeenLastCalledWith( expect.objectContaining({ @@ -93,24 +93,20 @@ describe('contract defaults (extra)', () => { describe('defaultChain', () => { it('should use "defaultChain" on "instance" level', async () => { - contract = new Contract(GreeterAbi, undefined, { - provider: getSystemTestProvider(), - }); + const deployedContract = await contract.deploy(deployOptions).send(sendOptions); - contract = await contract.deploy(deployOptions).send(sendOptions); - - expect(contract.defaultChain).toBe('mainnet'); + expect(deployedContract.defaultChain).toBe('mainnet'); const defaultChain = 'ropsten'; - contract.defaultChain = defaultChain; + deployedContract.defaultChain = defaultChain; - expect(contract.defaultChain).toBe(defaultChain); + expect(deployedContract.defaultChain).toBe(defaultChain); - await contract.methods.setGreeting('New Greeting').send(sendOptions); + await deployedContract.methods.setGreeting('New Greeting').send(sendOptions); const callSpy = jest.spyOn(Web3Eth, 'call'); - await contract.methods.greet().call(); + await deployedContract.methods.greet().call(); expect(callSpy).toHaveBeenCalledWith( expect.objectContaining({ @@ -131,27 +127,12 @@ describe('contract defaults (extra)', () => { hardfork: 'london' as Hardfork, }; - beforeEach(async () => { - contract = new Contract(GreeterAbi, undefined, { - provider: getSystemTestProvider(), - }); - acc = await createTempAccount(); - - deployOptions = { - data: GreeterBytecode, - arguments: ['My Greeting'], - }; - - sendOptions = { from: acc.address, gas: '1000000' }; - - contract = await contract.deploy(deployOptions).send(sendOptions); - }); - it('should use "defaultCommon" on "instance" level', async () => { - contract.defaultCommon = common; + const deployedContract = await contract.deploy(deployOptions).send(sendOptions); + deployedContract.defaultCommon = common; const callSpy = jest.spyOn(Web3Eth, 'call'); - await contract.methods.greet().call(); + await deployedContract.methods.greet().call(); expect(callSpy).toHaveBeenCalledWith( expect.objectContaining({ @@ -166,19 +147,16 @@ describe('contract defaults (extra)', () => { describeIf(isWs)('transactionBlockTimeout', () => { it('should use "transactionBlockTimeout" on "instance" level', async () => { - contract = new Contract(GreeterAbi, undefined, { - provider: getSystemTestProvider(), - }); - contract = await contract.deploy(deployOptions).send(sendOptions); + const deployedContract = await contract.deploy(deployOptions).send(sendOptions); const sendTransactionSpy = jest.spyOn(Web3Eth, 'sendTransaction'); - expect(contract.transactionBlockTimeout).toBe(50); + expect(deployedContract.transactionBlockTimeout).toBe(50); - contract.transactionBlockTimeout = 32; - expect(contract.transactionBlockTimeout).toBe(32); + deployedContract.transactionBlockTimeout = 32; + expect(deployedContract.transactionBlockTimeout).toBe(32); // eslint-disable-next-line @typescript-eslint/no-unsafe-call - await contract.methods.setGreeting('New Greeting').send(sendOptions); + await deployedContract.methods.setGreeting('New Greeting').send(sendOptions); expect(sendTransactionSpy).toHaveBeenLastCalledWith( expect.objectContaining({ @@ -191,38 +169,41 @@ describe('contract defaults (extra)', () => { }); it('should fail if transaction was not mined within `transactionBlockTimeout` blocks', async () => { - contract = new Contract(GreeterAbi, undefined, { - provider: getSystemTestProvider(), - }); - contract = await contract.deploy(deployOptions).send(sendOptions); + const deployedContract = await contract.deploy(deployOptions).send(sendOptions); // Make the test run faster by casing the polling to start after 2 blocks - contract.transactionBlockTimeout = 1; + deployedContract.transactionBlockTimeout = 1; // Prevent transaction from stucking for a long time if the provider (like Ganache v7.4.0) // does not respond, when raising the nonce - contract.transactionSendTimeout = MAX_32_SIGNED_INTEGER; + deployedContract.transactionSendTimeout = MAX_32_SIGNED_INTEGER; // Increase other timeouts - contract.transactionPollingTimeout = MAX_32_SIGNED_INTEGER; + deployedContract.transactionPollingTimeout = MAX_32_SIGNED_INTEGER; // Setting a high `nonce` when sending a transaction, to cause the RPC call to stuck at the Node // The previous test has the nonce set to Number.MAX_SAFE_INTEGER. // So, just decrease 1 from it here to not fall into another error. - const sentTx = contract.methods.setGreeting('New Greeting with high nonce').send({ - ...sendOptions, - nonce: (Number.MAX_SAFE_INTEGER - 1).toString(), - }); + const sentTx = deployedContract.methods + .setGreeting('New Greeting with high nonce') + .send({ + ...sendOptions, + nonce: (Number.MAX_SAFE_INTEGER - 1).toString(), + }); // Some providers (mostly used for development) will make blocks only when there are new transactions // So, send 2 transactions because in this test `transactionBlockTimeout = 2`. And do nothing if an error happens. setTimeout(() => { (async () => { try { - await contract.methods.setGreeting('New Greeting').send(sendOptions); + await deployedContract.methods + .setGreeting('New Greeting') + .send(sendOptions); } catch (error) { // Nothing needed to be done. } try { - await contract.methods.setGreeting('New Greeting').send(sendOptions); + await deployedContract.methods + .setGreeting('New Greeting') + .send(sendOptions); } catch (error) { // Nothing needed to be done. } @@ -237,20 +218,16 @@ describe('contract defaults (extra)', () => { describeIf(isWs)('blockHeaderTimeout', () => { it('should use "blockHeaderTimeout" on "instance" level', async () => { - contract = new Contract(GreeterAbi, undefined, { - provider: getSystemTestProvider(), - }); + const deployedContract = await contract.deploy(deployOptions).send(sendOptions); - contract = await contract.deploy(deployOptions).send(sendOptions); - - expect(contract.blockHeaderTimeout).toBe(10); + expect(deployedContract.blockHeaderTimeout).toBe(10); const blockHeaderTimeout = 1; - contract.blockHeaderTimeout = blockHeaderTimeout; + deployedContract.blockHeaderTimeout = blockHeaderTimeout; - expect(contract.blockHeaderTimeout).toBe(blockHeaderTimeout); + expect(deployedContract.blockHeaderTimeout).toBe(blockHeaderTimeout); - const sentTx = contract.methods.setGreeting('New Greeting').send(sendOptions); + const sentTx = deployedContract.methods.setGreeting('New Greeting').send(sendOptions); const confirmationPromise = new Promise((resolve: Resolve) => { // Tx promise is handled separately @@ -262,7 +239,9 @@ describe('contract defaults (extra)', () => { resolve(); } else { // Send a transaction to cause dev providers creating new blocks to fire the 'confirmation' event again. - await contract.methods.setGreeting('New Greeting').send(sendOptions); + await deployedContract.methods + .setGreeting('New Greeting') + .send(sendOptions); } }, ); @@ -284,36 +263,28 @@ describe('contract defaults (extra)', () => { describeIf(isHttp)('transactionPollingInterval', () => { it('should use "transactionPollingTimeout" on "instance" level', async () => { - contract = new Contract(GreeterAbi, undefined, { - provider: getSystemTestProvider(), - }); - - contract = await contract.deploy(deployOptions).send(sendOptions); + const deployedContract = await contract.deploy(deployOptions).send(sendOptions); const transactionPollingInterval = 500; - contract.transactionPollingInterval = transactionPollingInterval; + deployedContract.transactionPollingInterval = transactionPollingInterval; - expect(contract.transactionPollingInterval).toBe(transactionPollingInterval); + expect(deployedContract.transactionPollingInterval).toBe(transactionPollingInterval); }); }); it('should use "handleRevert" on "instance" level', async () => { - contract = new Contract(GreeterAbi, undefined, { - provider: getSystemTestProvider(), - }); - - contract = await contract.deploy(deployOptions).send(sendOptions); + const deployedContract = await contract.deploy(deployOptions).send(sendOptions); - expect(contract.handleRevert).toBeFalsy(); + expect(deployedContract.handleRevert).toBeFalsy(); const handleRevert = true; - contract.handleRevert = handleRevert; + deployedContract.handleRevert = handleRevert; - expect(contract.handleRevert).toBe(handleRevert); + expect(deployedContract.handleRevert).toBe(handleRevert); const sendTransactionSpy = jest.spyOn(Web3Eth, 'sendTransaction'); - await contract.methods.setGreeting('New Greeting').send(sendOptions); + await deployedContract.methods.setGreeting('New Greeting').send(sendOptions); expect(sendTransactionSpy).toHaveBeenCalled(); }); diff --git a/packages/web3-eth-contract/test/integration/contract_deploy.test.ts b/packages/web3-eth-contract/test/integration/contract_deploy.test.ts index b54ed63b41d..e4833882e94 100644 --- a/packages/web3-eth-contract/test/integration/contract_deploy.test.ts +++ b/packages/web3-eth-contract/test/integration/contract_deploy.test.ts @@ -17,13 +17,11 @@ along with web3.js. If not, see . import { Web3Eth } from 'web3-eth'; import { FMT_BYTES, FMT_NUMBER } from 'web3-types'; import { Contract, createContractAddress } from '../../src'; -import { sleep } from '../shared_fixtures/utils'; import { ERC721TokenAbi, ERC721TokenBytecode } from '../shared_fixtures/build/ERC721Token'; import { GreeterBytecode, GreeterAbi } from '../shared_fixtures/build/Greeter'; import { DeployRevertAbi, DeployRevertBytecode } from '../shared_fixtures/build/DeployRevert'; import { getSystemTestProvider, - isWs, createTempAccount, createNewAccount, signTxAndSendEIP2930, @@ -46,16 +44,22 @@ describe('contract', () => { beforeAll(() => { web3Eth = new Web3Eth(getSystemTestProvider()); + contract = new Contract(GreeterAbi, undefined, { + provider: getSystemTestProvider(), + }); deployOptions = { data: GreeterBytecode, arguments: ['My Greeting'], }; }); + + afterAll(async () => { + await closeOpenConnection(web3Eth); + await closeOpenConnection(contract); + }); + beforeEach(async () => { acc = await createTempAccount(); - contract = new Contract(GreeterAbi, undefined, { - provider: getSystemTestProvider(), - }); sendOptions = { from: acc.address, gas: '1000000' }; }); @@ -71,9 +75,6 @@ describe('contract', () => { expect(deployedContract.options.address).toEqual(address); }); - afterAll(async () => { - await closeOpenConnection(web3Eth); - }); describe('local account', () => { it.each([signTxAndSendEIP1559, signTxAndSendEIP2930])( 'should deploy the contract %p', @@ -112,9 +113,11 @@ describe('contract', () => { ); it('should return estimated gas of contract constructor %p', async () => { - const estimatedGas = await new Contract(GreeterAbi, undefined, { + const testContract = new Contract(GreeterAbi, undefined, { provider: getSystemTestProvider(), - }) + }); + + const estimatedGas = await testContract .deploy({ data: GreeterBytecode, arguments: ['My Greeting'], @@ -123,21 +126,27 @@ describe('contract', () => { from: acc.address, gas: '1000000', }); + expect(typeof estimatedGas).toBe('bigint'); expect(Number(estimatedGas)).toBeGreaterThan(0); + + await closeOpenConnection(testContract); }); + it.each(Object.values(FMT_NUMBER))( 'should return estimated gas of contract constructor %p with correct type', async format => { const returnFormat = { number: format as FMT_NUMBER, bytes: FMT_BYTES.HEX }; - const estimatedGas = await new Contract( + const testContract = new Contract( GreeterAbi, { provider: getSystemTestProvider(), }, returnFormat, - ) + ); + + const estimatedGas = await testContract .deploy({ data: GreeterBytecode, arguments: ['My Greeting'], @@ -146,14 +155,20 @@ describe('contract', () => { from: acc.address, gas: '1000000', }); + expect(typeof estimatedGas).toBe(mapFormatToType[format as string]); expect(Number(estimatedGas)).toBeGreaterThan(0); + + await closeOpenConnection(testContract); }, ); + it('should return estimated gas of contract constructor without arguments', async () => { - const estimatedGas = await new Contract(ERC721TokenAbi, undefined, { + const testContract = new Contract(ERC721TokenAbi, undefined, { provider: getSystemTestProvider(), - }) + }); + + const estimatedGas = await testContract .deploy({ data: ERC721TokenBytecode, arguments: [], @@ -162,8 +177,12 @@ describe('contract', () => { from: acc.address, gas: '10000000', }); + expect(Number(estimatedGas)).toBeGreaterThan(0); + + await closeOpenConnection(testContract); }); + it('should return estimated gas of contract method', async () => { const contractDeployed = await contract.deploy(deployOptions).send(sendOptions); @@ -173,8 +192,10 @@ describe('contract', () => { gas: '1000000', from: acc.address, }); + expect(Number(estimatedGas)).toBeGreaterThan(0); }); + it('should return estimated gas of contract method without arguments', async () => { const contractDeployed = await contract.deploy(deployOptions).send(sendOptions); @@ -193,15 +214,19 @@ describe('contract', () => { }); it('should deploy the contract if data is provided at initiation', async () => { - contract = new Contract(GreeterAbi, { + const testContract = new Contract(GreeterAbi, { provider: getSystemTestProvider(), data: GreeterBytecode, from: acc.address, gas: '1000000', }); - const deployedContract = await contract.deploy({ arguments: ['Hello World'] }).send(); + const deployedContract = await testContract + .deploy({ arguments: ['Hello World'] }) + .send(); expect(deployedContract).toBeDefined(); + + await closeOpenConnection(testContract); }); it('should return instance of the contract', async () => { @@ -218,26 +243,18 @@ describe('contract', () => { it('should emit the "confirmation" event', async () => { const confirmationHandler = jest.fn(); - contract.setConfig({ transactionConfirmationBlocks: 1 }); - await contract + contract.setConfig({ transactionConfirmationBlocks: 2 }); + + const promiEvent = contract .deploy(deployOptions) .send(sendOptions) .on('confirmation', confirmationHandler); - // Wait for some time to allow the transaction to be processed - await sleep(500); - - // Deploy once again to trigger block mining to trigger confirmation - // We can send any other transaction as well - await contract.deploy(deployOptions).send(sendOptions); + // Deploy the contract + await promiEvent; await sendFewSampleTxs(3); - // Wait for some fraction of time to trigger the handler - // On http we use polling to get confirmation, so wait a bit longer - await sleep(isWs ? 500 : 2000); - - // eslint-disable-next-line jest/no-standalone-expect expect(confirmationHandler).toHaveBeenCalled(); }); @@ -345,6 +362,8 @@ describe('contract', () => { 'Error happened while trying to execute a function inside a smart contract', ); } + + await closeOpenConnection(revert); }); }); }); diff --git a/packages/web3-eth-contract/test/integration/contract_empty_string.test.ts b/packages/web3-eth-contract/test/integration/contract_empty_string.test.ts index 25540c2ebf4..ceba0aa6c61 100644 --- a/packages/web3-eth-contract/test/integration/contract_empty_string.test.ts +++ b/packages/web3-eth-contract/test/integration/contract_empty_string.test.ts @@ -16,13 +16,18 @@ along with web3.js. If not, see . */ import { Contract } from '../../src'; -import { getSystemTestProvider, createTempAccount } from '../fixtures/system_test_utils'; +import { + getSystemTestProvider, + createTempAccount, + closeOpenConnection, +} from '../fixtures/system_test_utils'; import { MyContractAbi, MyContractBytecode } from '../fixtures/MyContract'; describe('request empty string from contract', () => { let contract: Contract; let deployOptions: Record; let sendOptions: Record; + beforeAll(async () => { contract = new Contract(MyContractAbi, undefined, { provider: getSystemTestProvider(), @@ -34,7 +39,11 @@ describe('request empty string from contract', () => { arguments: [], }; - sendOptions = { from: acc.address, gas: '1000000' }; + sendOptions = { from: acc.address }; + }); + + afterAll(async () => { + await closeOpenConnection(contract); }); it('should fetch empty string', async () => { diff --git a/packages/web3-eth-contract/test/integration/contract_erc20.test.ts b/packages/web3-eth-contract/test/integration/contract_erc20.test.ts index 5e268691aa5..c18582a4f8e 100644 --- a/packages/web3-eth-contract/test/integration/contract_erc20.test.ts +++ b/packages/web3-eth-contract/test/integration/contract_erc20.test.ts @@ -27,8 +27,9 @@ import { refillAccount, signAndSendContractMethodEIP1559, signAndSendContractMethodEIP2930, + closeOpenConnection, } from '../fixtures/system_test_utils'; -import { processAsync, toUpperCaseHex } from '../shared_fixtures/utils'; +import { toUpperCaseHex } from '../shared_fixtures/utils'; const initialSupply = BigInt('5000000000'); @@ -49,6 +50,10 @@ describe('contract', () => { }; }); + afterAll(async () => { + await closeOpenConnection(contract); + }); + it('should deploy the contract', async () => { const acc = await createTempAccount(); const sendOptionsLocal = { from: acc.address, gas: '10000000' }; @@ -61,6 +66,7 @@ describe('contract', () => { let contractDeployed: Contract; let pkAccount: { address: string; privateKey: string }; let mainAcc: { address: string; privateKey: string }; + const prepareForTransfer = async (value: string) => { const tempAccount = await createTempAccount(); await contractDeployed.methods.transfer(pkAccount.address, value).send(sendOptions); @@ -74,6 +80,11 @@ describe('contract', () => { sendOptions = { from: mainAcc.address, gas: '10000000' }; contractDeployed = await contract.deploy(deployOptions).send(sendOptions); }); + + afterAll(async () => { + await closeOpenConnection(contractDeployed); + }); + describe('methods', () => { it('should return the name', async () => { expect(await contractDeployed.methods.name().call()).toBe('Gold'); @@ -150,6 +161,7 @@ describe('contract', () => { expect(await catchErrorPromise).toBeDefined(); expect(catchError).toBe(true); }); + it('send tokens from the account that does not have tokens', async () => { const tempAccount = await createTempAccount(); const test = await createNewAccount({ @@ -186,7 +198,7 @@ describe('contract', () => { const value = BigInt(10); const tempAccount = await prepareForTransfer(value.toString()); await signAndSendContractMethod( - contract.provider, + contractDeployed.provider, contractDeployed.options.address as string, contractDeployed.methods.transfer(tempAccount.address, value), pkAccount.privateKey, @@ -291,22 +303,21 @@ describe('contract', () => { describeIf(isWs)('events', () => { it('should emit transfer event', async () => { const acc2 = await createTempAccount(); - await expect( - processAsync(async resolve => { - const event = contractDeployed.events.Transfer(); - event.on('data', data => { - resolve({ - from: toUpperCaseHex(data.returnValues.from as string), - to: toUpperCaseHex(data.returnValues.to as string), - value: data.returnValues.value, - }); + const event = contractDeployed.events.Transfer(); + const eventPromise = new Promise((resolve, reject) => { + event.on('data', data => { + resolve({ + from: toUpperCaseHex(data.returnValues.from as string), + to: toUpperCaseHex(data.returnValues.to as string), + value: data.returnValues.value, }); + }); + event.on('error', reject); + }); - await contractDeployed.methods - .transfer(acc2.address, '100') - .send(sendOptions); - }), - ).resolves.toEqual({ + await contractDeployed.methods.transfer(acc2.address, '100').send(sendOptions); + + await expect(eventPromise).resolves.toEqual({ from: toUpperCaseHex(sendOptions.from as string), to: toUpperCaseHex(acc2.address), value: BigInt(100), diff --git a/packages/web3-eth-contract/test/integration/contract_erc721.test.ts b/packages/web3-eth-contract/test/integration/contract_erc721.test.ts index 9463a636930..f979e1d396a 100644 --- a/packages/web3-eth-contract/test/integration/contract_erc721.test.ts +++ b/packages/web3-eth-contract/test/integration/contract_erc721.test.ts @@ -27,8 +27,9 @@ import { signAndSendContractMethodEIP2930, createNewAccount, refillAccount, + closeOpenConnection, } from '../fixtures/system_test_utils'; -import { processAsync, toUpperCaseHex } from '../shared_fixtures/utils'; +import { toUpperCaseHex } from '../shared_fixtures/utils'; describe('contract', () => { describe('erc721', () => { @@ -51,21 +52,25 @@ describe('contract', () => { sendOptions = { from: acc.address, gas: '10000000' }; }); + afterAll(async () => { + await closeOpenConnection(contract); + }); + it('should deploy the contract', async () => { await expect(contract.deploy(deployOptions).send(sendOptions)).resolves.toBeDefined(); }); describe('contract instance', () => { let acc: { address: string; privateKey: string }; - let acc2: { address: string; privateKey: string }; let pkAccount: { address: string; privateKey: string }; + beforeAll(async () => { acc = await createTempAccount(); pkAccount = await createNewAccount(); await refillAccount(acc.address, pkAccount.address, '20000000000000000'); }); + beforeEach(async () => { - acc2 = await createTempAccount(); sendOptions = { from: acc.address, gas: '10000000' }; contractDeployed = await contract.deploy(deployOptions).send(sendOptions); }); @@ -293,42 +298,47 @@ describe('contract', () => { describeIf(isWs)('events', () => { it('should emit transfer event', async () => { - await expect( - processAsync(async resolve => { - const event = contractDeployed.events.Transfer(); - event.on('data', data => { - resolve({ - from: toUpperCaseHex(data.returnValues.from as string), - to: toUpperCaseHex(data.returnValues.to as string), - tokenId: data.returnValues.tokenId, - }); + const acc2 = await createTempAccount(); + const event = contractDeployed.events.Transfer(); + + const eventPromise = new Promise((resolve, reject) => { + event.on('data', data => { + resolve({ + from: toUpperCaseHex(data.returnValues.from as string), + to: toUpperCaseHex(data.returnValues.to as string), + tokenId: data.returnValues.tokenId, }); + }); + event.on('error', reject); + }); + + const receipt = await contractDeployed.methods + .awardItem(acc2.address, 'http://my-nft-uri') + .send(sendOptions); - const receipt = await contractDeployed.methods - .awardItem(acc2.address, 'http://my-nft-uri') - .send(sendOptions); - - expect(receipt.events).toBeDefined(); - expect(receipt.events?.Transfer).toBeDefined(); - expect(receipt.events?.Transfer.event).toBe('Transfer'); - expect( - String(receipt.events?.Transfer.returnValues.from).toLowerCase(), - ).toBe('0x0000000000000000000000000000000000000000'); - expect( - String(receipt.events?.Transfer.returnValues[0]).toLowerCase(), - ).toBe('0x0000000000000000000000000000000000000000'); - expect( - String(receipt.events?.Transfer.returnValues.to).toLowerCase(), - ).toBe(acc2.address.toLowerCase()); - expect( - String(receipt.events?.Transfer.returnValues[1]).toLowerCase(), - ).toBe(acc2.address.toLowerCase()); - }), - ).resolves.toEqual({ + expect(receipt.events).toBeDefined(); + expect(receipt.events?.Transfer).toBeDefined(); + expect(receipt.events?.Transfer.event).toBe('Transfer'); + expect(String(receipt.events?.Transfer.returnValues.from).toLowerCase()).toBe( + '0x0000000000000000000000000000000000000000', + ); + expect(String(receipt.events?.Transfer.returnValues[0]).toLowerCase()).toBe( + '0x0000000000000000000000000000000000000000', + ); + expect(String(receipt.events?.Transfer.returnValues.to).toLowerCase()).toBe( + acc2.address.toLowerCase(), + ); + expect(String(receipt.events?.Transfer.returnValues[1]).toLowerCase()).toBe( + acc2.address.toLowerCase(), + ); + + await expect(eventPromise).resolves.toEqual({ from: '0x0000000000000000000000000000000000000000', to: toUpperCaseHex(acc2.address), tokenId: BigInt(0), }); + + event.removeAllListeners(); }); }); }); diff --git a/packages/web3-eth-contract/test/integration/contract_estimateGas_without_0x.test.ts b/packages/web3-eth-contract/test/integration/contract_estimateGas_without_0x.test.ts index d74a901e265..7212060bac5 100644 --- a/packages/web3-eth-contract/test/integration/contract_estimateGas_without_0x.test.ts +++ b/packages/web3-eth-contract/test/integration/contract_estimateGas_without_0x.test.ts @@ -17,7 +17,11 @@ along with web3.js. If not, see . import { ETH_DATA_FORMAT } from 'web3-types'; import { Contract } from '../../src'; -import { getSystemTestProvider, createTempAccount } from '../fixtures/system_test_utils'; +import { + getSystemTestProvider, + createTempAccount, + closeOpenConnection, +} from '../fixtures/system_test_utils'; describe('contract', () => { // Create a new contract object using the ABI and bytecode @@ -49,6 +53,10 @@ describe('contract', () => { acc = await createTempAccount(); }); + afterAll(async () => { + await closeOpenConnection(contract); + }); + it('should be able to add `data` input without `0x` prefix', async () => { contract = new Contract(abi, undefined, { provider: getSystemTestProvider(), diff --git a/packages/web3-eth-contract/test/integration/contract_events.test.ts b/packages/web3-eth-contract/test/integration/contract_events.test.ts index b84a875d173..0e13a68f366 100644 --- a/packages/web3-eth-contract/test/integration/contract_events.test.ts +++ b/packages/web3-eth-contract/test/integration/contract_events.test.ts @@ -15,10 +15,8 @@ You should have received a copy of the GNU Lesser General Public License along with web3.js. If not, see . */ -import { EventLog } from 'web3-types'; -import { Contract } from '../../src'; +import { Contract, EventLog } from '../../src'; import { BasicAbi, BasicBytecode } from '../shared_fixtures/build/Basic'; -import { processAsync } from '../shared_fixtures/utils'; import { getSystemTestProvider, describeIf, @@ -26,6 +24,8 @@ import { itIf, isHttp, createTempAccount, + closeOpenConnection, + sendFewSampleTxs, } from '../fixtures/system_test_utils'; describe('contract', () => { @@ -34,12 +34,11 @@ describe('contract', () => { let deployOptions: Record; let sendOptions: Record; - beforeAll(() => { + beforeAll(async () => { contract = new Contract(BasicAbi, undefined, { provider: getSystemTestProvider(), }); - }); - beforeEach(async () => { + const acc = await createTempAccount(); deployOptions = { @@ -47,123 +46,127 @@ describe('contract', () => { arguments: [10, 'string init value'], }; - sendOptions = { from: acc.address, gas: '1000000' }; + sendOptions = { from: acc.address }; + }); + afterAll(async () => { + await closeOpenConnection(contract); + }); + + beforeEach(async () => { contractDeployed = await contract.deploy(deployOptions).send(sendOptions); }); - describe('events', () => { - itIf(isWs)('should trigger the "contract.events."', async () => { - // eslint-disable-next-line jest/no-standalone-expect - return expect( - processAsync(async (resolve, reject) => { - const event = contractDeployed.events.MultiValueEvent(); + describeIf(isWs)('events', () => { + it('should trigger the "contract.events."', async () => { + const event = contractDeployed.events.MultiValueEvent(); + + const eventPromise = new Promise((resolve, reject) => { + event.on('data', resolve); + event.on('error', reject); + }); - event.on('data', resolve); - event.on('error', reject); + await contractDeployed.methods + .firesMultiValueEvent('value', 12, true) + .send(sendOptions); - // trigger event - await contractDeployed.methods - .firesMultiValueEvent('value', 12, true) - .send(sendOptions); + await expect(eventPromise).resolves.toEqual( + expect.objectContaining({ + event: 'MultiValueEvent', }), - ).resolves.toEqual( + ); + + event.removeAllListeners(); + }); + + it('should trigger the "contract.events." for indexed parameters', async () => { + const event = contractDeployed.events.MultiValueIndexedEvent({ + filter: { val: 100 }, + }); + + const eventPromise = new Promise((resolve, reject) => { + event.on('data', resolve); + event.on('error', reject); + }); + + await contractDeployed.methods + .firesMultiValueIndexedEvent('value', 12, true) + .send(sendOptions); + await contractDeployed.methods + .firesMultiValueIndexedEvent('value', 100, true) + .send(sendOptions); + + await expect(eventPromise).resolves.toEqual( + expect.objectContaining({ + event: 'MultiValueIndexedEvent', + returnValues: expect.objectContaining({ + val: BigInt(100), + }), + }), + ); + + event.removeAllListeners(); + }); + + it('should trigger when "fromBlock" is passed to contract.events.', async () => { + const event = contractDeployed.events.MultiValueEvent({ + fromBlock: 'latest', + }); + + const eventPromise = new Promise((resolve, reject) => { + event.on('data', resolve); + event.on('error', reject); + }); + + await contractDeployed.methods + .firesMultiValueEvent('Event Value', 11, false) + .send(sendOptions); + + await expect(eventPromise).resolves.toEqual( expect.objectContaining({ event: 'MultiValueEvent', }), ); + + event.removeAllListeners(); }); - itIf(isWs)( - 'should trigger the "contract.events." for indexed parameters', - async () => { - const res = await processAsync(async (resolve, reject) => { - const event = contractDeployed.events.MultiValueIndexedEvent({ - filter: { val: 100 }, - }); - - event.on('data', resolve); - event.on('error', reject); - - // trigger event - await contractDeployed.methods - .firesMultiValueIndexedEvent('value', 12, true) - .send(sendOptions); - await contractDeployed.methods - .firesMultiValueIndexedEvent('value', 100, true) - .send(sendOptions); + it('should fetch past events when "fromBlock" is passed to contract.events.', async () => { + const eventValues = [11, 12, 13, 14]; + const event = contractDeployed.events.MultiValueEvent({ + fromBlock: 'earliest', + }); + + const eventPromise = new Promise((resolve, reject) => { + const pastEvents: EventLog[] = []; + event.on('data', d => { + pastEvents.push(d); + if (pastEvents.length === eventValues.length) { + resolve(pastEvents); + } }); - // eslint-disable-next-line jest/no-standalone-expect - expect((res as any)?.event).toBe('MultiValueIndexedEvent'); - // eslint-disable-next-line jest/no-standalone-expect - expect((res as any)?.returnValues.val).toBe(BigInt(100)); - }, - ); - - itIf(isWs)( - 'should trigger when "fromBlock" is passed to contract.events.', - async () => { - // eslint-disable-next-line jest/no-standalone-expect - return expect( - processAsync(async (resolve, reject) => { - const event = contractDeployed.events.MultiValueEvent({ - fromBlock: 'latest', - }); - - event.on('data', resolve); - event.on('error', reject); - - // trigger event - await contractDeployed.methods - .firesMultiValueEvent('Event Value', 11, false) - .send(sendOptions); - }), - ).resolves.toEqual( - expect.objectContaining({ - event: 'MultiValueEvent', - }), - ); - }, - ); - - itIf(isWs)( - 'should fetch past events when "fromBlock" is passed to contract.events.', - async () => { - const eventValues = [11, 12, 13, 14]; - // eslint-disable-next-line jest/no-standalone-expect - return expect( - processAsync(async resolve => { - // trigger multiple events - for (const eventValue of eventValues) { - // Wait for every transaction, before firing the next one, to prevent a possible nonce duplication. - // eslint-disable-next-line no-await-in-loop - await contractDeployed.methods - .firesMultiValueEvent('Event Value', eventValue, false) - .send(sendOptions); - } - - const event = contractDeployed.events.MultiValueEvent({ - fromBlock: 'earliest', - }); - - const pastEvents: EventLog[] = []; - event.on('data', d => { - pastEvents.push(d); - if (pastEvents.length === eventValues.length) { - resolve(pastEvents); - } - }); - }), - ).resolves.toEqual( - expect.arrayContaining([ - expect.objectContaining({ event: 'MultiValueEvent' }), - expect.objectContaining({ event: 'MultiValueEvent' }), - expect.objectContaining({ event: 'MultiValueEvent' }), - expect.objectContaining({ event: 'MultiValueEvent' }), - ]), - ); - }, - ); + event.on('error', reject); + }); + + for (const eventValue of eventValues) { + // Wait for every transaction, before firing the next one, to prevent a possible nonce duplication. + // eslint-disable-next-line no-await-in-loop + await contractDeployed.methods + .firesMultiValueEvent('Event Value', eventValue, false) + .send(sendOptions); + } + + await expect(eventPromise).resolves.toEqual( + expect.arrayContaining([ + expect.objectContaining({ event: 'MultiValueEvent' }), + expect.objectContaining({ event: 'MultiValueEvent' }), + expect.objectContaining({ event: 'MultiValueEvent' }), + expect.objectContaining({ event: 'MultiValueEvent' }), + ]), + ); + + event.removeAllListeners(); + }); }); describe('events subscription with HTTP', () => { @@ -186,7 +189,6 @@ describe('contract', () => { }); describeIf(isWs)('getPastEvents', () => { - // TODO: Debug why this tests is hanging the websocket it('should return all past events using earliest and latest options', async () => { await contractDeployed.methods .firesMultiValueEvent('New Greeting 1', 11, true) @@ -195,6 +197,8 @@ describe('contract', () => { .firesMultiValueEvent('New Greeting 2', 12, true) .send(sendOptions); + await sendFewSampleTxs(2); + expect( await contractDeployed.getPastEvents('MultiValueEvent', { fromBlock: 'earliest', @@ -202,6 +206,7 @@ describe('contract', () => { }), ).toHaveLength(2); }); + it('should return all past events using number options', async () => { await contractDeployed.methods .firesMultiValueEvent('New Greeting 1', 11, true) @@ -210,6 +215,8 @@ describe('contract', () => { .firesMultiValueEvent('New Greeting 2', 12, true) .send(sendOptions); + await sendFewSampleTxs(2); + expect( await contractDeployed.getPastEvents('MultiValueEvent', { fromBlock: 0, @@ -217,6 +224,7 @@ describe('contract', () => { }), ).toHaveLength(2); }); + it('should return all past events using string options', async () => { await contractDeployed.methods .firesMultiValueEvent('New Greeting 1', 11, true) @@ -225,6 +233,8 @@ describe('contract', () => { .firesMultiValueEvent('New Greeting 2', 12, true) .send(sendOptions); + await sendFewSampleTxs(2); + expect( await contractDeployed.getPastEvents('MultiValueEvent', { fromBlock: '0', @@ -232,6 +242,7 @@ describe('contract', () => { }), ).toHaveLength(2); }); + it('should return all past events using bigint options', async () => { await contractDeployed.methods .firesMultiValueEvent('New Greeting 1', 11, true) @@ -240,6 +251,8 @@ describe('contract', () => { .firesMultiValueEvent('New Greeting 2', 12, true) .send(sendOptions); + await sendFewSampleTxs(2); + expect( await contractDeployed.getPastEvents('MultiValueEvent', { fromBlock: BigInt(0), @@ -251,45 +264,43 @@ describe('contract', () => { describeIf(isWs)('allEvents', () => { it('should sub and get event using earliest options with allEvents()', async () => { - // eslint-disable-next-line jest/no-standalone-expect - return expect( - processAsync(async (resolve, reject) => { - const event = contractDeployed.events.allEvents({ fromBlock: 'earliest' }); + const event = contractDeployed.events.allEvents({ fromBlock: 'earliest' }); - event.on('data', resolve); - event.on('error', reject); + const eventPromise = new Promise((resolve, reject) => { + event.on('data', resolve); + event.on('error', reject); + }); - // trigger event - await contractDeployed.methods - .firesMultiValueEvent('val test', 12, true) - .send(sendOptions); - }), - ).resolves.toEqual( + await contractDeployed.methods + .firesMultiValueEvent('val test', 12, true) + .send(sendOptions); + + await expect(eventPromise).resolves.toEqual( expect.objectContaining({ event: 'MultiValueEvent', }), ); + + event.removeAllListeners(); }); it('should sub allEvents()', async () => { - // eslint-disable-next-line jest/no-standalone-expect - return expect( - processAsync(async (resolve, reject) => { - const event = contractDeployed.events.allEvents(); + const event = contractDeployed.events.allEvents(); - event.on('data', resolve); - event.on('error', reject); + const eventPromise = new Promise((resolve, reject) => { + event.on('data', resolve); + event.on('error', reject); + }); - // trigger event - await contractDeployed.methods - .firesMultiValueEvent('Pak1', 12, true) - .send(sendOptions); - }), - ).resolves.toEqual( + await contractDeployed.methods.firesMultiValueEvent('Pak1', 12, true).send(sendOptions); + + await expect(eventPromise).resolves.toEqual( expect.objectContaining({ event: 'MultiValueEvent', }), ); + + event.removeAllListeners(); }); }); }); diff --git a/packages/web3-eth-contract/test/integration/contract_filter_events.test.ts b/packages/web3-eth-contract/test/integration/contract_filter_events.test.ts index 338cd448c12..000a305eb72 100644 --- a/packages/web3-eth-contract/test/integration/contract_filter_events.test.ts +++ b/packages/web3-eth-contract/test/integration/contract_filter_events.test.ts @@ -24,6 +24,7 @@ import { getSystemTestProvider, createTempAccount, createNewAccount, + closeOpenConnection, } from '../fixtures/system_test_utils'; const initialSupply = BigInt('5000000000'); @@ -60,6 +61,10 @@ describe('contract getPastEvent filter', () => { await contractDeployed.methods.transfer(toAcc3.address, value).send(sendOptions); }); + afterAll(async () => { + await closeOpenConnection(contract); + }); + it('should filter one event by address with event name and filter param', async () => { const res: EventLog[] = (await contractDeployed.getPastEvents('Transfer', { fromBlock: 'earliest', @@ -155,6 +160,7 @@ describe('contract getPastEvent filter', () => { ); }); }); + describe('basic', () => { let contract: Contract; let contractDeployed: Contract; @@ -188,6 +194,10 @@ describe('contract getPastEvent filter', () => { .send(sendOptions); }); + afterAll(async () => { + await closeOpenConnection(contract); + }); + it('should filter one event by address with event name and filter param', async () => { const res: EventLog[] = (await contractDeployed.getPastEvents( 'MultiValueIndexedEvent', diff --git a/packages/web3-eth-contract/test/integration/contract_methods.test.ts b/packages/web3-eth-contract/test/integration/contract_methods.test.ts index 152c3feec8a..7048fe121d6 100644 --- a/packages/web3-eth-contract/test/integration/contract_methods.test.ts +++ b/packages/web3-eth-contract/test/integration/contract_methods.test.ts @@ -22,6 +22,7 @@ import { createTempAccount, getSystemTestBackend, BACKEND, + closeOpenConnection, } from '../fixtures/system_test_utils'; describe('contract', () => { @@ -47,6 +48,10 @@ describe('contract', () => { contractDeployed = await contract.deploy(deployOptions).send(sendOptions); }); + afterAll(async () => { + await closeOpenConnection(contract); + }); + describe('methods', () => { describe('call', () => { it('should retrieve the values', async () => { @@ -72,6 +77,8 @@ describe('contract', () => { .send(); const res = await deployedTempContract.methods.getStringValue().call(); expect(res).toBe('string init value'); + + await closeOpenConnection(tempContract); }); describe('revert handling', () => { @@ -191,6 +198,8 @@ describe('contract', () => { await deployedTempContract.methods.setValues(10, 'TEST', true).send(); expect(await deployedTempContract.methods.getStringValue().call()).toBe('TEST'); + + await closeOpenConnection(tempContract); }); it('should returns errors on reverts', async () => { diff --git a/packages/web3-eth-contract/test/integration/contract_methods_errors.test.ts b/packages/web3-eth-contract/test/integration/contract_methods_errors.test.ts index 7c07ee5af8d..276bb23b992 100644 --- a/packages/web3-eth-contract/test/integration/contract_methods_errors.test.ts +++ b/packages/web3-eth-contract/test/integration/contract_methods_errors.test.ts @@ -24,6 +24,7 @@ import { getSystemTestBackend, describeIf, BACKEND, + closeOpenConnection, } from '../fixtures/system_test_utils'; describe('contract errors', () => { @@ -47,8 +48,10 @@ describe('contract errors', () => { const sendOptionsLocal = { from: acc.address, gas: '10000000' }; deployedContract = await contract.deploy(deployOptions).send(sendOptionsLocal); + }); - contract.setProvider(getSystemTestProvider()); + afterAll(async () => { + await closeOpenConnection(contract); }); describeIf(getSystemTestBackend() === BACKEND.GETH)('Test EIP-838 Error Codes', () => { diff --git a/packages/web3-eth-contract/test/integration/contract_negative_numbers.test.ts b/packages/web3-eth-contract/test/integration/contract_negative_numbers.test.ts index bf9283d5a4f..9e29824c2c6 100644 --- a/packages/web3-eth-contract/test/integration/contract_negative_numbers.test.ts +++ b/packages/web3-eth-contract/test/integration/contract_negative_numbers.test.ts @@ -15,7 +15,11 @@ You should have received a copy of the GNU Lesser General Public License along with web3.js. If not, see . */ import Contract from '../../src'; -import { createTempAccount, getSystemTestProvider } from '../fixtures/system_test_utils'; +import { + closeOpenConnection, + createTempAccount, + getSystemTestProvider, +} from '../fixtures/system_test_utils'; import { NegativeNumbersAbi, NegativeNumbersBytecode, @@ -39,14 +43,15 @@ describe('Contract - NegativeNumbers.sol', () => { data: NegativeNumbersBytecode, arguments: [storedNegativeNumber], }; - sendOptions = { - from: account.address, - gas: '1000000', - }; + sendOptions = { from: account.address }; contractDeployed = await contract.deploy(deployOptions).send(sendOptions); }); + afterAll(async () => { + await closeOpenConnection(contract); + }); + it('should retrieve storedNegativeNumber', async () => { const response = await contractDeployed.methods.storedNegativeNumber().call(); expect(response).toBe(BigInt(storedNegativeNumber)); diff --git a/packages/web3-eth-contract/test/integration/contract_simple_overloaded.test.ts b/packages/web3-eth-contract/test/integration/contract_simple_overloaded.test.ts index 0e786b77428..fd71aff487a 100644 --- a/packages/web3-eth-contract/test/integration/contract_simple_overloaded.test.ts +++ b/packages/web3-eth-contract/test/integration/contract_simple_overloaded.test.ts @@ -16,7 +16,11 @@ along with web3.js. If not, see . */ import Contract from '../../src'; import { SimpleOverloadedAbi, SimpleOverloadedBytecode } from '../fixtures/SimpleOverloaded'; -import { createTempAccount, getSystemTestProvider } from '../fixtures/system_test_utils'; +import { + closeOpenConnection, + createTempAccount, + getSystemTestProvider, +} from '../fixtures/system_test_utils'; describe('SimpleOverloaded', () => { let contract: Contract; @@ -32,7 +36,11 @@ describe('SimpleOverloaded', () => { .deploy({ data: SimpleOverloadedBytecode, }) - .send({ from: mainAcc.address, gas: '10000000' }); + .send({ from: mainAcc.address }); + }); + + afterAll(async () => { + await closeOpenConnection(contract); }); it('should call getSecret with no args', async () => { diff --git a/packages/web3-eth-contract/test/integration/local_account/contract_deploy.test.ts b/packages/web3-eth-contract/test/integration/local_account/contract_deploy.test.ts index 821101ca225..cb24ad22fca 100644 --- a/packages/web3-eth-contract/test/integration/local_account/contract_deploy.test.ts +++ b/packages/web3-eth-contract/test/integration/local_account/contract_deploy.test.ts @@ -20,7 +20,11 @@ import Web3 from 'web3'; // eslint-disable-next-line import/no-extraneous-dependencies import { Web3Account } from 'web3-eth-accounts'; import { GreeterBytecode, GreeterAbi } from '../../shared_fixtures/build/Greeter'; -import { getSystemTestProvider, createLocalAccount } from '../../fixtures/system_test_utils'; +import { + getSystemTestProvider, + createLocalAccount, + closeOpenConnection, +} from '../../fixtures/system_test_utils'; import { Contract } from '../../../src'; describe('contract', () => { @@ -31,13 +35,20 @@ describe('contract', () => { let localAccount: Web3Account; let web3: Web3; - beforeEach(async () => { + beforeAll(async () => { web3 = new Web3(getSystemTestProvider()); contract = new web3.eth.Contract(GreeterAbi) as unknown as Contract; deployOptions = { data: GreeterBytecode, arguments: ['My Greeting'], }; + }); + + afterAll(async () => { + await closeOpenConnection(web3); + }); + + beforeEach(async () => { localAccount = await createLocalAccount(web3); sendOptions = { from: localAccount.address, diff --git a/packages/web3-eth-contract/test/integration/local_account/contract_erc20.test.ts b/packages/web3-eth-contract/test/integration/local_account/contract_erc20.test.ts index edff03fe598..35ebc29cc46 100644 --- a/packages/web3-eth-contract/test/integration/local_account/contract_erc20.test.ts +++ b/packages/web3-eth-contract/test/integration/local_account/contract_erc20.test.ts @@ -21,7 +21,11 @@ import Web3 from 'web3'; import { Web3Account } from 'web3-eth-accounts'; import { Contract } from '../../../src'; import { ERC20TokenAbi, ERC20TokenBytecode } from '../../shared_fixtures/build/ERC20Token'; -import { getSystemTestProvider, createLocalAccount } from '../../fixtures/system_test_utils'; +import { + getSystemTestProvider, + createLocalAccount, + closeOpenConnection, +} from '../../fixtures/system_test_utils'; const initialSupply = BigInt('5000000000'); @@ -53,6 +57,10 @@ describe('contract', () => { contractDeployed = await contract.deploy(deployOptions).send(sendOptions); }); + afterAll(async () => { + await closeOpenConnection(web3); + }); + it('should deploy the contract', () => { expect(contractDeployed.options.address).toBeDefined(); }); diff --git a/packages/web3-eth-contract/test/integration/local_account/contract_erc721.test.ts b/packages/web3-eth-contract/test/integration/local_account/contract_erc721.test.ts index d9226c580f1..4ea801ee686 100644 --- a/packages/web3-eth-contract/test/integration/local_account/contract_erc721.test.ts +++ b/packages/web3-eth-contract/test/integration/local_account/contract_erc721.test.ts @@ -21,7 +21,11 @@ import Web3 from 'web3'; import { Web3Account } from 'web3-eth-accounts'; import { Contract } from '../../../src'; import { ERC721TokenAbi, ERC721TokenBytecode } from '../../shared_fixtures/build/ERC721Token'; -import { getSystemTestProvider, createLocalAccount } from '../../fixtures/system_test_utils'; +import { + getSystemTestProvider, + createLocalAccount, + closeOpenConnection, +} from '../../fixtures/system_test_utils'; import { toUpperCaseHex } from '../../shared_fixtures/utils'; describe('contract', () => { @@ -32,6 +36,7 @@ describe('contract', () => { let localAccount: Web3Account; let web3: Web3; let contractDeployed: Contract; + beforeAll(async () => { web3 = new Web3(getSystemTestProvider()); localAccount = await createLocalAccount(web3); @@ -46,11 +51,13 @@ describe('contract', () => { sendOptions = { from: localAccount.address, - gas: '1000000', }; - contractDeployed = await contract - .deploy(deployOptions) - .send({ ...sendOptions, gas: '3000000' }); + contractDeployed = await contract.deploy(deployOptions).send({ ...sendOptions }); + }); + + afterAll(async () => { + await closeOpenConnection(web3); + await closeOpenConnection(contract); }); it('should deploy the contract', () => { diff --git a/packages/web3-eth-contract/test/integration/local_account/contract_overloaded_methods.test.ts b/packages/web3-eth-contract/test/integration/local_account/contract_overloaded_methods.test.ts index 0c905e8ece2..5593e905b3a 100644 --- a/packages/web3-eth-contract/test/integration/local_account/contract_overloaded_methods.test.ts +++ b/packages/web3-eth-contract/test/integration/local_account/contract_overloaded_methods.test.ts @@ -23,7 +23,11 @@ import { utf8ToHex } from 'web3-utils'; import { EventLog } from 'web3-types'; import { Contract } from '../../../src'; import { ERC721TokenAbi, ERC721TokenBytecode } from '../../shared_fixtures/build/ERC721Token'; -import { getSystemTestProvider, createLocalAccount } from '../../fixtures/system_test_utils'; +import { + getSystemTestProvider, + createLocalAccount, + closeOpenConnection, +} from '../../fixtures/system_test_utils'; import { toUpperCaseHex } from '../../shared_fixtures/utils'; describe('contract ERC721 overloaded functions', () => { @@ -55,6 +59,10 @@ describe('contract ERC721 overloaded functions', () => { .send({ ...sendOptions, gas: '3000000' }); }); + afterAll(async () => { + await closeOpenConnection(web3); + }); + it('transferFrom with 4 arguments', async () => { const tempAccount = await createLocalAccount(web3); const toAccount = await createLocalAccount(web3); diff --git a/scripts/system_tests_utils.ts b/scripts/system_tests_utils.ts index e634b98a35b..db460e8229c 100644 --- a/scripts/system_tests_utils.ts +++ b/scripts/system_tests_utils.ts @@ -165,7 +165,8 @@ export const closeOpenConnection = async (web3Context: Web3Context) => { (web3Context.provider as unknown as Web3BaseProvider).disconnect(); await new Promise(resolve => { - setTimeout(resolve, 1000); + const timer = setTimeout(resolve, 1); + timer.unref(); }); } }; @@ -250,8 +251,9 @@ export const createNewAccount = async (config?: { const url = getSystemTestProviderUrl(); const web3 = new Web3(url); web3.registerPlugin(new HardhatPlugin()); + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call await web3.hardhat.impersonateAccount(acc.address); - // await impersonateAccount(acc.address); + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call await web3.hardhat.setBalance(acc.address, web3.utils.toHex('100000000')); await closeOpenConnection(web3); } else { @@ -275,6 +277,7 @@ export const createNewAccount = async (config?: { const url = getSystemTestProviderUrl(); const web3 = new Web3(url); web3.registerPlugin(new HardhatPlugin()); + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call await web3.hardhat.setBalance(acc.address, web3.utils.toHex('100000000')); await closeOpenConnection(web3); } else { @@ -365,7 +368,9 @@ export const signTxAndSendEIP1559 = async ( from: acc.address, }; - return web3.eth.sendTransaction(txObj, undefined, { checkRevertBeforeSending: false }); + return web3.eth.sendTransaction(txObj, undefined, { + checkRevertBeforeSending: false, + }); }; export const signTxAndSendEIP2930 = async ( @@ -383,7 +388,9 @@ export const signTxAndSendEIP2930 = async ( from: acc.address, }; - return web3.eth.sendTransaction(txObj, undefined, { checkRevertBeforeSending: false }); + return web3.eth.sendTransaction(txObj, undefined, { + checkRevertBeforeSending: false, + }); }; export const signAndSendContractMethodEIP1559 = async ( @@ -418,7 +425,7 @@ export const signAndSendContractMethodEIP2930 = async ( export const createLocalAccount = async (web3: Web3) => { const account = web3.eth.accounts.create(); - await refillAccount((await createTempAccount()).address, account.address, '10000000000000000'); + await refillAccount((await createTempAccount()).address, account.address, '100000000000000000'); web3.eth.accounts.wallet.add(account); return account; }; @@ -515,8 +522,8 @@ export const waitForCondition = async ( logicFunc: () => Promise | void, maxIterations = 10, // 10 times duration = 8000, // check after each 8 seconds -): Promise => { - return new Promise((resolve, reject) => { +): Promise => + new Promise((resolve, reject) => { let iterations = 0; // eslint-disable-next-line @typescript-eslint/no-misused-promises const interval = setInterval(async () => { @@ -540,4 +547,3 @@ export const waitForCondition = async ( } }, duration); }); -}; From 2011192f92218aa1572f2c711f38866eba92f844 Mon Sep 17 00:00:00 2001 From: Kris <605420+krzysu@users.noreply.github.com> Date: Wed, 13 Nov 2024 10:25:57 +0100 Subject: [PATCH 02/21] fix: export Web3Account, Wallet and signature related types (#7374) --- CHANGELOG.md | 6 ++++ packages/web3-eth-accounts/CHANGELOG.md | 4 +++ packages/web3-eth-accounts/src/account.ts | 11 +++--- packages/web3-eth-accounts/src/types.ts | 38 +++++---------------- packages/web3-types/CHANGELOG.md | 4 +++ packages/web3-types/src/web3_base_wallet.ts | 35 ++++++++++--------- packages/web3/CHANGELOG.md | 6 ++++ packages/web3/src/types.ts | 2 ++ packages/web3/test/unit/accounts.test.ts | 3 +- 9 files changed, 55 insertions(+), 54 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 91d8d858ed7..6c97c573755 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2803,3 +2803,9 @@ If there are any bugs, improvements, optimizations or any new feature proposal f - Fix Contract methods input param type any[] (#7340) ## [Unreleased] + +### Fixed + +#### web3 + +- Export Web3Account, Wallet and signature related types. (#7374) diff --git a/packages/web3-eth-accounts/CHANGELOG.md b/packages/web3-eth-accounts/CHANGELOG.md index 939bd836ce8..e707999a1c2 100644 --- a/packages/web3-eth-accounts/CHANGELOG.md +++ b/packages/web3-eth-accounts/CHANGELOG.md @@ -190,3 +190,7 @@ Documentation: - `hashMessage` now has a new optional param `skipPrefix` with a default value of `false`. A new function `signRaw` was added to sign a message without prefix. (#7346) ## [Unreleased] + +### Removed + +- Move signature related types to web3-types. Re-export them for backwards compatibility. (#7374) diff --git a/packages/web3-eth-accounts/src/account.ts b/packages/web3-eth-accounts/src/account.ts index 511ebcc92d2..9faed9ceaed 100644 --- a/packages/web3-eth-accounts/src/account.ts +++ b/packages/web3-eth-accounts/src/account.ts @@ -69,6 +69,9 @@ import { KeyStore, PBKDF2SHA256Params, ScryptParams, + SignatureObject, + SignResult, + SignTransactionResult, Transaction, } from 'web3-types'; import { @@ -90,13 +93,7 @@ import { isHexStrict, isNullish, isString, validator } from 'web3-validator'; import { secp256k1 } from './tx/constants.js'; import { keyStoreSchema } from './schemas.js'; import { TransactionFactory } from './tx/transactionFactory.js'; -import type { - SignatureObject, - SignTransactionResult, - TypedTransaction, - Web3Account, - SignResult, -} from './types.js'; +import type { TypedTransaction, Web3Account } from './types.js'; /** * Get the private key Uint8Array after the validation. diff --git a/packages/web3-eth-accounts/src/types.ts b/packages/web3-eth-accounts/src/types.ts index ed45ad94ffb..54a7aba7b78 100644 --- a/packages/web3-eth-accounts/src/types.ts +++ b/packages/web3-eth-accounts/src/types.ts @@ -15,38 +15,16 @@ You should have received a copy of the GNU Lesser General Public License along with web3.js. If not, see . */ -import { Web3BaseWalletAccount, HexString } from 'web3-types'; -import { FeeMarketEIP1559TxData, AccessListEIP2930TxData, TxData } from './tx/types.js'; +import { + HexString, + SignatureObject, + SignResult, + SignTransactionResult, + Web3BaseWalletAccount, +} from 'web3-types'; import { AccessListEIP2930Transaction, FeeMarketEIP1559Transaction, Transaction } from './tx'; -export type SignatureObject = { - messageHash: string; - r: string; - s: string; - v: string; -}; - -export type SignTransactionResult = SignatureObject & { - rawTransaction: string; - transactionHash: string; -}; - -export type SignTransactionFunction = ( - transaction: - | TxData - | AccessListEIP2930TxData - | FeeMarketEIP1559TxData - | Record, -) => SignTransactionResult; - -export type SignResult = SignatureObject & { - message?: string; - signature: string; -}; - -export type SignFunction = (data: string, privateKey: string) => SignResult; - -// https://github.com/ethereum/wiki/wiki/Web3-Secret-Storage-Definition +export { SignatureObject, SignResult, SignTransactionResult }; export interface Web3Account extends Web3BaseWalletAccount { address: HexString; diff --git a/packages/web3-types/CHANGELOG.md b/packages/web3-types/CHANGELOG.md index 4158022da52..c78df9f3265 100644 --- a/packages/web3-types/CHANGELOG.md +++ b/packages/web3-types/CHANGELOG.md @@ -221,3 +221,7 @@ Documentation: - `FilterParams` type added (#7353) ## [Unreleased] + +#### Added + +- Add signature related types. (#7374) diff --git a/packages/web3-types/src/web3_base_wallet.ts b/packages/web3-types/src/web3_base_wallet.ts index 484e8072603..153a34450a1 100644 --- a/packages/web3-types/src/web3_base_wallet.ts +++ b/packages/web3-types/src/web3_base_wallet.ts @@ -60,26 +60,29 @@ export type KeyStore = { address: string; }; +export type SignatureObject = { + messageHash: string; + r: string; + s: string; + v: string; +}; + +export type SignTransactionResult = SignatureObject & { + rawTransaction: string; + transactionHash: string; +}; + +export type SignResult = SignatureObject & { + message?: string; + signature: string; +}; + export interface Web3BaseWalletAccount { [key: string]: unknown; readonly address: string; readonly privateKey: string; - readonly signTransaction: (tx: Transaction) => Promise<{ - readonly messageHash: HexString; - readonly r: HexString; - readonly s: HexString; - readonly v: HexString; - readonly rawTransaction: HexString; - readonly transactionHash: HexString; - }>; - readonly sign: (data: Record | string) => { - readonly messageHash: HexString; - readonly r: HexString; - readonly s: HexString; - readonly v: HexString; - readonly message?: string; - readonly signature: HexString; - }; + readonly signTransaction: (tx: Transaction) => Promise; + readonly sign: (data: Record | string) => SignResult; readonly encrypt: (password: string, options?: Record) => Promise; } diff --git a/packages/web3/CHANGELOG.md b/packages/web3/CHANGELOG.md index f3ec9b9679e..b1f440e0074 100644 --- a/packages/web3/CHANGELOG.md +++ b/packages/web3/CHANGELOG.md @@ -561,3 +561,9 @@ Documentation: - Fix Contract methods input param type any[] (#7340) ## [Unreleased] + +### Fixed + +#### web3 + +- Export Web3Account, Wallet and signature related types. (#7374) diff --git a/packages/web3/src/types.ts b/packages/web3/src/types.ts index 3b87896789c..341e017015c 100644 --- a/packages/web3/src/types.ts +++ b/packages/web3/src/types.ts @@ -42,6 +42,8 @@ import { Net } from 'web3-net'; import { Iban } from 'web3-eth-iban'; import { Personal } from 'web3-eth-personal'; +export type { Web3Account, Wallet } from 'web3-eth-accounts'; + /** * The Ethereum interface for main web3 object. It provides extra methods in addition to `web3-eth` interface. * diff --git a/packages/web3/test/unit/accounts.test.ts b/packages/web3/test/unit/accounts.test.ts index 9cc2618d24b..2bd75cbe90e 100644 --- a/packages/web3/test/unit/accounts.test.ts +++ b/packages/web3/test/unit/accounts.test.ts @@ -17,7 +17,8 @@ along with web3.js. If not, see . import * as eth from 'web3-eth'; import * as ethAccounts from 'web3-eth-accounts'; -import { SignTransactionResult, Web3Account } from 'web3-eth-accounts'; +import { Web3Account } from 'web3-eth-accounts'; +import type { SignTransactionResult } from 'web3-types'; import { Web3EthInterface } from '../../src/types'; import { Web3 } from '../../src'; From 0915cf4e426feb06618d6e264239bf8f67b3c278 Mon Sep 17 00:00:00 2001 From: Kris <605420+krzysu@users.noreply.github.com> Date: Wed, 13 Nov 2024 21:39:04 +0100 Subject: [PATCH 03/21] fix: CI workflow cache issues (#7384) --- .github/workflows/build.yml | 435 +++++++++--------- .../test/integration/resolver.test.ts | 2 +- 2 files changed, 208 insertions(+), 229 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b8c0f6647fd..81ce725b842 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,136 +28,107 @@ jobs: - run: yarn build:cjs - uses: actions/cache/save@v4 with: - path: ./ - key: web3-${{ matrix.node }}-${{github.sha}} + path: ./ + key: web3-${{ matrix.node }}-${{ github.sha }} build-esm: name: Build ESM needs: build runs-on: ubuntu-latest steps: - - uses: actions/setup-node@v4 - with: - node-version: 18 - - uses: actions/cache/restore@v4 - with: - path: ./ - key: web3-18-${{github.sha}} - - run: yarn build:esm + - uses: actions/setup-node@v4 + with: + node-version: 18 + - uses: actions/cache/restore@v4 + with: + path: ./ + key: web3-18-${{ github.sha }} + - run: yarn build:esm + build-types: name: Build Types needs: build runs-on: ubuntu-latest steps: - - uses: actions/setup-node@v4 - with: - node-version: 18 - - uses: actions/cache/restore@v4 - with: - path: ./ - key: web3-18-${{github.sha}} - - run: yarn build:types + - uses: actions/setup-node@v4 + with: + node-version: 18 + - uses: actions/cache/restore@v4 + with: + path: ./ + key: web3-18-${{ github.sha }} + - run: yarn build:types + lint: name: Lint needs: build runs-on: ubuntu-latest steps: - - uses: actions/setup-node@v4 - with: - node-version: 18 - - uses: actions/cache/restore@v4 - with: - path: ./ - key: web3-18-${{github.sha}} - - run: npx ts-node scripts/init.ts - - name: Restore eslint caches - uses: actions/cache/restore@v4 - with: - path: | - packages/web3/.eslintcache - packages/web3-core/.eslintcache - packages/web3-eth/.eslintcache - packages/web3-eth-abi/.eslintcache - packages/web3-eth-accounts/.eslintcache - packages/web3-eth-contract/.eslintcache - packages/web3-eth-ens/.eslintcache - packages/web3-eth-iban/.eslintcache - packages/web3-eth-personal/.eslintcache - packages/web3-net/.eslintcache - packages/web3-providers-http/.eslintcache - packages/web3-providers-ws/.eslintcache - packages/web3-rpc-methods/.eslintcache - packages/web3-types/.eslintcache - packages/web3-utils/.eslintcache - packages/web3-validator/.eslintcache - tools/web3-plugin-example/.eslintcache - key: ${{ runner.os }}-eslintcache - - - run: yarn lint - - run: gh cache delete "${{ runner.os }}-eslintcache" - if: github.event_name == 'push' && github.ref == 'refs/heads/4.x' - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Save eslint caches - if: github.event_name == 'push' && github.ref == 'refs/heads/4.x' - uses: actions/cache/save@v4 - with: - path: | - packages/web3/.eslintcache - packages/web3-core/.eslintcache - packages/web3-eth/.eslintcache - packages/web3-eth-abi/.eslintcache - packages/web3-eth-accounts/.eslintcache - packages/web3-eth-contract/.eslintcache - packages/web3-eth-ens/.eslintcache - packages/web3-eth-iban/.eslintcache - packages/web3-eth-personal/.eslintcache - packages/web3-net/.eslintcache - packages/web3-providers-http/.eslintcache - packages/web3-providers-ws/.eslintcache - packages/web3-rpc-methods/.eslintcache - packages/web3-types/.eslintcache - packages/web3-utils/.eslintcache - packages/web3-validator/.eslintcache - tools/web3-plugin-example/.eslintcache - key: ${{ runner.os }}-eslintcache + - uses: actions/setup-node@v4 + with: + node-version: 18 + - uses: actions/cache/restore@v4 + with: + path: ./ + key: web3-18-${{ github.sha }} + - run: npx ts-node scripts/init.ts + - uses: actions/cache@v4 + with: + path: | + packages/web3/.eslintcache + packages/web3-core/.eslintcache + packages/web3-eth/.eslintcache + packages/web3-eth-abi/.eslintcache + packages/web3-eth-accounts/.eslintcache + packages/web3-eth-contract/.eslintcache + packages/web3-eth-ens/.eslintcache + packages/web3-eth-iban/.eslintcache + packages/web3-eth-personal/.eslintcache + packages/web3-net/.eslintcache + packages/web3-providers-http/.eslintcache + packages/web3-providers-ws/.eslintcache + packages/web3-rpc-methods/.eslintcache + packages/web3-types/.eslintcache + packages/web3-utils/.eslintcache + packages/web3-validator/.eslintcache + tools/web3-plugin-example/.eslintcache + key: ${{ runner.os }}-eslintcache-${{ github.ref_name }} + - run: yarn lint build-web: name: Build Web needs: build runs-on: ubuntu-latest steps: - - uses: actions/setup-node@v4 - with: - node-version: 18 - - uses: actions/cache/restore@v4 - with: - path: ./ - key: web3-18-${{github.sha}} - - name: Restore default branch stats - if: github.event_name != 'push' - uses: actions/cache/restore@v4 - with: - path: packages/web3/dist/4.x.json - key: web3-bundle-stats-4x-${{github.event.pull_request.base.sha}} - - run: yarn build:web:analyze - env: - STATS_FILE: ${{ github.ref_name }}.json - - name: Compare bundle stats - uses: github/webpack-bundlesize-compare-action@v1.8.2 - continue-on-error: true - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - current-stats-json-path: "packages/web3/dist/${{ github.ref_name }}.json" - base-stats-json-path: "packages/web3/dist/4.x.json" - - name: Cache default branch stats - uses: actions/cache/save@v4 - if: github.event_name == 'push' && github.ref == 'refs/heads/4.x' - with: - path: packages/web3/dist/${{ github.ref_name }}.json - key: web3-bundle-stats-4x-${{github.sha}} - + - uses: actions/setup-node@v4 + with: + node-version: 18 + - uses: actions/cache/restore@v4 + with: + path: ./ + key: web3-18-${{ github.sha }} + - name: Restore default branch stats + if: github.event_name != 'push' + uses: actions/cache/restore@v4 + with: + path: packages/web3/dist/4.x.json + key: web3-bundle-stats-4x-${{ github.event.pull_request.base.sha }} + - run: yarn build:web:analyze + env: + STATS_FILE: ${{ github.ref_name }}.json + - name: Compare bundle stats + uses: github/webpack-bundlesize-compare-action@v1.8.2 + continue-on-error: true + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + current-stats-json-path: 'packages/web3/dist/${{ github.ref_name }}.json' + base-stats-json-path: 'packages/web3/dist/4.x.json' + - name: Cache default branch stats + uses: actions/cache/save@v4 + if: github.event_name == 'push' && github.ref == 'refs/heads/4.x' + with: + path: packages/web3/dist/${{ github.ref_name }}.json + key: web3-bundle-stats-4x-${{ github.sha }} unit: name: Unit Tests @@ -173,8 +144,8 @@ jobs: node-version: ${{ matrix.node }} - uses: actions/cache/restore@v4 with: - path: ./ - key: web3-${{ matrix.node }}-${{github.sha}} + path: ./ + key: web3-${{ matrix.node }}-${{ github.sha }} - run: yarn test:unit continue-on-error: ${{ matrix.node == '20.17.0' }} - name: Upload coverage to Codecov @@ -189,18 +160,18 @@ jobs: needs: build runs-on: ubuntu-latest strategy: - fail-fast: false + fail-fast: false steps: - - uses: actions/setup-node@v3 - with: - node-version: 18 - - uses: actions/cache/restore@v4 - with: - path: ./ - key: web3-18-${{github.sha}} - - run: npx hardhat node & - - run: yarn test:e2e:hardhat:http - shell: bash + - uses: actions/setup-node@v3 + with: + node-version: 18 + - uses: actions/cache/restore@v4 + with: + path: ./ + key: web3-18-${{ github.sha }} + - run: npx hardhat node & + - run: yarn test:e2e:hardhat:http + shell: bash e2e-geth: name: Integration # (geth with HTTP, IPC & WS) @@ -212,44 +183,44 @@ jobs: strategy: fail-fast: false matrix: - mode: [ 'ipc', 'ws', 'http' ] + mode: ['ipc', 'ws', 'http'] steps: - - uses: actions/setup-node@v4 - with: - node-version: 18 - - uses: actions/cache/restore@v4 - with: - path: ./ - key: web3-18-${{github.sha}} - - run: yarn test:e2e:geth:${{ matrix.mode }} - shell: bash + - uses: actions/setup-node@v4 + with: + node-version: 18 + - uses: actions/cache/restore@v4 + with: + path: ./ + key: web3-18-${{ github.sha }} + - run: yarn test:e2e:geth:${{ matrix.mode }} + shell: bash e2e-browsers: name: End-to-End hardhat:ws needs: build runs-on: ubuntu-latest strategy: - fail-fast: false - matrix: - browser: ['electron', 'chrome', 'firefox'] + fail-fast: false + matrix: + browser: ['electron', 'chrome', 'firefox'] steps: - - uses: actions/setup-node@v3 - with: - node-version: 18 - - uses: browser-actions/setup-firefox@latest - if: matrix.browser == 'firefox' - - uses: actions/cache/restore@v4 - with: - path: ./ - key: web3-18-${{github.sha}} - - run: npx hardhat node & - - run: npm install --no-package-lock --no-save --force cypress - - name: Cypress run - uses: cypress-io/github-action@v4 - with: - install: false - command: yarn test:e2e:hardhat:ws:${{ matrix.browser }} - cache-key: node-v18-on-${{ matrix.browser }}-hash-${{ hashFiles('yarn.lock') }} + - uses: actions/setup-node@v3 + with: + node-version: 18 + - uses: browser-actions/setup-firefox@latest + if: matrix.browser == 'firefox' + - uses: actions/cache/restore@v4 + with: + path: ./ + key: web3-18-${{ github.sha }} + - run: npx hardhat node & + - run: npm install --no-package-lock --no-save --force cypress + - name: Cypress run + uses: cypress-io/github-action@v4 + with: + install: false + command: yarn test:e2e:hardhat:ws:${{ matrix.browser }} + cache-key: node-v18-on-${{ matrix.browser }}-hash-${{ hashFiles('yarn.lock') }} deploy-docs: name: Docs CloudFlare Deploy @@ -259,85 +230,93 @@ jobs: contents: read deployments: write steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - cache: yarn - node-version: '18' - - uses: actions/cache/restore@v4 - with: - path: ./ - key: web3-18-${{github.sha}} - - run: yarn install --ignore-scripts - - run: yarn build:cjs - - run: yarn run build:docs - - name: Publish to Cloudflare Pages - uses: cloudflare/pages-action@v1 - with: - apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} - accountId: 2238a825c5aca59233eab1f221f7aefb - projectName: web3-js-docs - directory: ./docs/build - gitHubToken: ${{ secrets.GITHUB_TOKEN }} + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + cache: yarn + node-version: '18' + - uses: actions/cache/restore@v4 + with: + path: ./ + key: web3-18-${{ github.sha }} + - run: yarn install --ignore-scripts + - run: yarn build:cjs + - run: yarn run build:docs + - name: Publish to Cloudflare Pages + uses: cloudflare/pages-action@v1 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: 2238a825c5aca59233eab1f221f7aefb + projectName: web3-js-docs + directory: ./docs/build + gitHubToken: ${{ secrets.GITHUB_TOKEN }} + benchmark: name: Benchmark Tests needs: build runs-on: ubuntu-latest steps: - - uses: actions/setup-node@v4 - with: - node-version: 18 - - uses: actions/cache/restore@v4 - with: - path: ./ - key: web3-18-${{github.sha}} - # @octokit/core not supported on node 16, so I can't add it to the package.json - - run: npm install --no-package-lock --no-save --force @octokit/core@5.1.0 - - name: Restore main branch benchmark data - uses: actions/cache/restore@v4 - with: - path: web3-benchmark-main.json - key: ${{ runner.os }}-web3-benchmark-main.json - - run: yarn test:benchmark - - name: Compare benchmark result and make comment - uses: benchmark-action/github-action-benchmark@v1 - with: - # What benchmark tool the output.txt came from - tool: 'benchmarkjs' - # Where the output from the benchmark tool is stored - output-file-path: benchmark-data.txt - # Where the previous data file is stored - external-data-json-path: web3-benchmark-main.json - # Workflow will fail when an alert happens - fail-on-alert: false - # GitHub API token to make a commit comment - github-token: ${{ secrets.GITHUB_TOKEN }} - # Enable alert commit comment - comment-always: true - save-data-file: false - # copy comment from commit to Pull Request - - run: node scripts/copyCommitCommentToPrComment.js ${{ secrets.GITHUB_TOKEN }} ${{github.event.pull_request.head.sha}} ${{github.event.number}} - - name: Compare benchmark result and fail if threshold is reached - uses: benchmark-action/github-action-benchmark@v1 - with: - # What benchmark tool the output.txt came from - tool: 'benchmarkjs' - # Where the output from the benchmark tool is stored - output-file-path: benchmark-data.txt - # Where the previous data file is stored - external-data-json-path: web3-benchmark-main.json - # Workflow will fail when an alert happens - fail-on-alert: true - # Enable alert commit comment - alert-threshold: '200%' - comment-always: false - - run: gh cache delete "${{ runner.os }}-web3-benchmark-main.json" - if: github.event_name == 'push' && github.ref == 'refs/heads/4.x' - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Save main branch benchmark data - uses: actions/cache/save@v4 - if: github.event_name == 'push' && github.ref == 'refs/heads/4.x' - with: - path: web3-benchmark-main.json - key: ${{ runner.os }}-web3-benchmark-main.json + - uses: actions/setup-node@v4 + with: + node-version: 18 + - uses: actions/cache/restore@v4 + with: + path: ./ + key: web3-18-${{ github.sha }} + # @octokit/core not supported on node 16, so I can't add it to the package.json + - run: npm install --no-package-lock --no-save --force @octokit/core@5.1.0 + - name: Restore main branch benchmark data + uses: actions/cache/restore@v4 + with: + path: web3-benchmark-main.json + key: ${{ runner.os }}-web3-benchmark-main + - run: yarn test:benchmark + - name: Compare benchmark result and make comment + uses: benchmark-action/github-action-benchmark@v1 + with: + # What benchmark tool the output.txt came from + tool: 'benchmarkjs' + # Where the output from the benchmark tool is stored + output-file-path: benchmark-data.txt + # Where the previous data file is stored + external-data-json-path: web3-benchmark-main.json + # Workflow will fail when an alert happens + fail-on-alert: false + # GitHub API token to make a commit comment + github-token: ${{ secrets.GITHUB_TOKEN }} + # Enable alert commit comment + comment-always: true + save-data-file: false + # copy comment from commit to Pull Request + - run: node scripts/copyCommitCommentToPrComment.js ${{ secrets.GITHUB_TOKEN }} ${{ github.event.pull_request.head.sha }} ${{ github.event.number }} + - name: Compare benchmark result and fail if threshold is reached + uses: benchmark-action/github-action-benchmark@v1 + with: + # What benchmark tool the output.txt came from + tool: 'benchmarkjs' + # Where the output from the benchmark tool is stored + output-file-path: benchmark-data.txt + # Where the previous data file is stored + external-data-json-path: web3-benchmark-main.json + # Workflow will fail when an alert happens + fail-on-alert: true + # Enable alert commit comment + alert-threshold: '200%' + comment-always: false + - name: Check and delete cache if it exists + run: | + if gh cache list | grep -q "${{ runner.os }}-web3-benchmark-main"; then + echo "Cache found. Deleting..." + gh cache delete "${{ runner.os }}-web3-benchmark-main" + else + echo "No matching cache found. Skipping delete." + fi + if: github.event_name == 'push' && github.ref == 'refs/heads/4.x' + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Save main branch benchmark data + uses: actions/cache/save@v4 + if: github.event_name == 'push' && github.ref == 'refs/heads/4.x' + with: + path: web3-benchmark-main.json + key: ${{ runner.os }}-web3-benchmark-main diff --git a/packages/web3-eth-ens/test/integration/resolver.test.ts b/packages/web3-eth-ens/test/integration/resolver.test.ts index f6b2e648991..a79003d009c 100644 --- a/packages/web3-eth-ens/test/integration/resolver.test.ts +++ b/packages/web3-eth-ens/test/integration/resolver.test.ts @@ -42,7 +42,7 @@ import { ENSRegistryBytecode } from '../fixtures/ens/bytecode/ENSRegistryBytecod import { NameWrapperBytecode } from '../fixtures/ens/bytecode/NameWrapperBytecode'; import { PublicResolverBytecode } from '../fixtures/ens/bytecode/PublicResolverBytecode'; -jest.setTimeout(25000); +jest.setTimeout(35000); describe('ens', () => { let registry: Contract; let resolver: Contract; From 6af068fa5982f0e487146fc61a8c1e4032fc5dca Mon Sep 17 00:00:00 2001 From: Kris <605420+krzysu@users.noreply.github.com> Date: Wed, 13 Nov 2024 23:03:47 +0100 Subject: [PATCH 04/21] fix: return type of sendTransaction in docs (#7386) * fix: return type of sendTransaction in docs * Fix Very Minor Typo in Docs --------- Co-authored-by: Dan Forbes --- .../infer_contract_types.md | 2 +- packages/web3-eth/src/web3_eth.ts | 84 ++++++++++++++----- 2 files changed, 64 insertions(+), 22 deletions(-) diff --git a/docs/docs/guides/05_smart_contracts/infer_contract_types.md b/docs/docs/guides/05_smart_contracts/infer_contract_types.md index b5288412522..4d7c6e3b8c7 100644 --- a/docs/docs/guides/05_smart_contracts/infer_contract_types.md +++ b/docs/docs/guides/05_smart_contracts/infer_contract_types.md @@ -7,7 +7,7 @@ sidebar_label: 'Infer Contract Types from JSON Artifact (TypeScript)' :::tip 📝 This article is for **TypeScript** developers. So, if you are using JavaScript, you do not need to read this. -However, web3.js version 4.x has been rewritten in TypeScript. And we encorage you to use its strongly-typed features with TypeScript. +However, web3.js version 4.x has been rewritten in TypeScript. And we encourage you to use its strongly-typed features with TypeScript. ::: Web3.js is a popular library used for interacting with EVM blockchains. One of its key features is the ability to invoke EVM smart contracts deployed on the blockchain. In this blog post, we will show how to interact with the smart contract in **TypeScript**, with a special focus on how to infer types from JSON artifact files. diff --git a/packages/web3-eth/src/web3_eth.ts b/packages/web3-eth/src/web3_eth.ts index ba951914e91..6320ff4f524 100644 --- a/packages/web3-eth/src/web3_eth.ts +++ b/packages/web3-eth/src/web3_eth.ts @@ -1021,19 +1021,61 @@ export class Web3Eth extends Web3Context 0xdf7756865c2056ce34c4eabe4eff42ad251a9f920a1c620c00b4ea0988731d3f + * const transactionReceipt = await web3.eth.sendTransaction(transaction); + * console.log(transactionReceipt); + * > { + * blockHash: '0x39cee0da843293ae3136cee0de4c0803745868b6e72b7cd05fba395bffa0ee85', + * blockNumber: 6659547n, + * cumulativeGasUsed: 1029036n, + * effectiveGasPrice: 6765796845n, + * from: '0x6E599DA0bfF7A6598AC1224E4985430Bf16458a4', + * gasUsed: 21000n, + * logs: [], + * logsBloom: '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', + * status: 1n, + * to: '0x6f1df96865d09d21e8f3f9a7fba3b17a11c7c53c', + * transactionHash: '0x619de868dd73c07bd0c096adcd405c93c1e924fdf741e684a127a52324c28bb9', + * transactionIndex: 16n, + * type: 2n + *} * * web3.eth.sendTransaction(transaction).then(console.log); - * > 0xdf7756865c2056ce34c4eabe4eff42ad251a9f920a1c620c00b4ea0988731d3f + * > { + * blockHash: '0x39cee0da843293ae3136cee0de4c0803745868b6e72b7cd05fba395bffa0ee85', + * blockNumber: 6659547n, + * cumulativeGasUsed: 1029036n, + * effectiveGasPrice: 6765796845n, + * from: '0x6E599DA0bfF7A6598AC1224E4985430Bf16458a4', + * gasUsed: 21000n, + * logs: [], + * logsBloom: '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', + * status: 1n, + * to: '0x6f1df96865d09d21e8f3f9a7fba3b17a11c7c53c', + * transactionHash: '0x619de868dd73c07bd0c096adcd405c93c1e924fdf741e684a127a52324c28bb9', + * transactionIndex: 16n, + * type: 2n + *} * * web3.eth.sendTransaction(transaction).catch(console.log); * > * * // Example using options.ignoreGasPricing = true * web3.eth.sendTransaction(transaction, undefined, { ignoreGasPricing: true }).then(console.log); - * > 0xdf7756865c2056ce34c4eabe4eff42ad251a9f920a1c620c00b4ea0988731d3f + * > { + * blockHash: '0x39cee0da843293ae3136cee0de4c0803745868b6e72b7cd05fba395bffa0ee85', + * blockNumber: 6659547n, + * cumulativeGasUsed: 1029036n, + * effectiveGasPrice: 6765796845n, + * from: '0x6E599DA0bfF7A6598AC1224E4985430Bf16458a4', + * gasUsed: 21000n, + * logs: [], + * logsBloom: '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', + * status: 1n, + * to: '0x6f1df96865d09d21e8f3f9a7fba3b17a11c7c53c', + * transactionHash: '0x619de868dd73c07bd0c096adcd405c93c1e924fdf741e684a127a52324c28bb9', + * transactionIndex: 16n, + * type: 2n + *} * ``` * * @@ -1042,24 +1084,24 @@ export class Web3Eth extends Web3Context console.log(transactionToBeSent)); * > { - * from: '0x6E599DA0bfF7A6598AC1224E4985430Bf16458a4', - * to: '0x6f1DF96865D09d21e8f3f9a7fbA3b17A11c7C53C', - * value: '0x1', - * gasPrice: '0x77359400', - * maxPriorityFeePerGas: undefined, - * maxFeePerGas: undefined + * from: '0x6E599DA0bfF7A6598AC1224E4985430Bf16458a4', + * to: '0x6f1DF96865D09d21e8f3f9a7fbA3b17A11c7C53C', + * value: '0x1', + * gasPrice: '0x77359400', + * maxPriorityFeePerGas: undefined, + * maxFeePerGas: undefined * } * ``` * - `sent` * ```ts * web3.eth.sendTransaction(transaction).on('sent', sentTransaction => console.log(sentTransaction)); * > { - * from: '0x6E599DA0bfF7A6598AC1224E4985430Bf16458a4', - * to: '0x6f1DF96865D09d21e8f3f9a7fbA3b17A11c7C53C', - * value: '0x1', - * gasPrice: '0x77359400', - * maxPriorityFeePerGas: undefined, - * maxFeePerGas: undefined + * from: '0x6E599DA0bfF7A6598AC1224E4985430Bf16458a4', + * to: '0x6f1DF96865D09d21e8f3f9a7fbA3b17A11c7C53C', + * value: '0x1', + * gasPrice: '0x77359400', + * maxPriorityFeePerGas: undefined, + * maxFeePerGas: undefined * } * ``` * - `transactionHash` @@ -1090,8 +1132,8 @@ export class Web3Eth extends Web3Context console.log(confirmation)); * > { - * confirmations: 1n, - * receipt: { + * confirmations: 1n, + * receipt: { * transactionHash: '0xb4a3a35ae0f3e77ef0ff7be42010d948d011b21a4e341072ee18717b67e99ab8', * transactionIndex: 0n, * blockNumber: 5n, @@ -1105,8 +1147,8 @@ export class Web3Eth extends Web3Context Date: Thu, 14 Nov 2024 10:17:26 +0100 Subject: [PATCH 05/21] chore: update CI actions (#7385) --- .github/workflows/black_box_tests.yml | 96 ++++++++++++------------- .github/workflows/build.yml | 6 +- .github/workflows/canary_release.yml | 37 +++++----- .github/workflows/deploy-docs.yaml | 8 +-- .github/workflows/e2e_network_tests.yml | 90 +++++++++++------------ .github/workflows/stale.yml | 32 ++++----- 6 files changed, 134 insertions(+), 135 deletions(-) diff --git a/.github/workflows/black_box_tests.yml b/.github/workflows/black_box_tests.yml index 8d26e163264..bb47ea822d2 100644 --- a/.github/workflows/black_box_tests.yml +++ b/.github/workflows/black_box_tests.yml @@ -1,53 +1,53 @@ name: 'Black Box Tests' on: push: - branches: - - release/** - tags: - - v4.* + branches: + - release/** + tags: + - v4.* jobs: - build: - strategy: - matrix: - node: [18] - name: Build Packages - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node }} - - run: yarn - - run: tar -czf /tmp/web3-${{ matrix.node }}.js.tar.gz --exclude="./.git" ./ - - uses: actions/upload-artifact@v3 - with: - name: web3-${{ matrix.node }}.js.tar.gz - path: /tmp/web3-${{ matrix.node }}.js.tar.gz - black-box: - name: Black Box - needs: build - runs-on: ubuntu-latest - env: - INFURA_MAINNET_HTTP: ${{ secrets.INFURA_MAINNET_HTTP }} - INFURA_MAINNET_WS: ${{ secrets.INFURA_MAINNET_WS }} - INFURA_SEPOLIA_WS: ${{ secrets.INFURA_SEPOLIA_WS }} - MODE: ${{ matrix.mode }} - strategy: - fail-fast: false - matrix: - node: [18] - mode: ['http', 'ws'] - backend: ['geth', 'infura'] - steps: - - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node }} - - uses: actions/download-artifact@v3 - with: - name: web3-${{ matrix.node }}.js.tar.gz - path: /tmp - - run: tar -xf /tmp/web3-${{ matrix.node }}.js.tar.gz -C ./ - - run: | - yarn test:blackbox:${{ matrix.backend }}:${{ matrix.mode }} - shell: bash + build: + strategy: + matrix: + node: [18] + name: Build Packages + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + - run: yarn + - run: tar -czf /tmp/web3-${{ matrix.node }}.js.tar.gz --exclude="./.git" ./ + - uses: actions/upload-artifact@v4 + with: + name: web3-${{ matrix.node }}.js.tar.gz + path: /tmp/web3-${{ matrix.node }}.js.tar.gz + black-box: + name: Black Box + needs: build + runs-on: ubuntu-latest + env: + INFURA_MAINNET_HTTP: ${{ secrets.INFURA_MAINNET_HTTP }} + INFURA_MAINNET_WS: ${{ secrets.INFURA_MAINNET_WS }} + INFURA_SEPOLIA_WS: ${{ secrets.INFURA_SEPOLIA_WS }} + MODE: ${{ matrix.mode }} + strategy: + fail-fast: false + matrix: + node: [18] + mode: ['http', 'ws'] + backend: ['geth', 'infura'] + steps: + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + - uses: actions/download-artifact@v4 + with: + name: web3-${{ matrix.node }}.js.tar.gz + path: /tmp + - run: tar -xf /tmp/web3-${{ matrix.node }}.js.tar.gz -C ./ + - run: | + yarn test:blackbox:${{ matrix.backend }}:${{ matrix.mode }} + shell: bash diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 81ce725b842..a9d9346359e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -149,7 +149,7 @@ jobs: - run: yarn test:unit continue-on-error: ${{ matrix.node == '20.17.0' }} - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: flags: UnitTests token: ${{ secrets.CODECOV_TOKEN }} @@ -162,7 +162,7 @@ jobs: strategy: fail-fast: false steps: - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: 18 - uses: actions/cache/restore@v4 @@ -204,7 +204,7 @@ jobs: matrix: browser: ['electron', 'chrome', 'firefox'] steps: - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: 18 - uses: browser-actions/setup-firefox@latest diff --git a/.github/workflows/canary_release.yml b/.github/workflows/canary_release.yml index f7081481f8d..8b59ebde563 100644 --- a/.github/workflows/canary_release.yml +++ b/.github/workflows/canary_release.yml @@ -1,23 +1,22 @@ name: 'Release Canary' on: - push: - branches: - - '4.x' + push: + branches: + - '4.x' jobs: - release: - name: release - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 18 - cache: yarn - registry-url: 'https://registry.npmjs.org' - - run: yarn install --frozen-lockfile - - run: yarn build:web - - run: yarn publish:canary - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - \ No newline at end of file + release: + name: release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 18 + cache: yarn + registry-url: 'https://registry.npmjs.org' + - run: yarn install --frozen-lockfile + - run: yarn build:web + - run: yarn publish:canary + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/deploy-docs.yaml b/.github/workflows/deploy-docs.yaml index ce0ee35cee2..aff3ca793bb 100644 --- a/.github/workflows/deploy-docs.yaml +++ b/.github/workflows/deploy-docs.yaml @@ -1,10 +1,10 @@ name: Docs CloudFlare Deploy on: push: - branches: - - "4.x" - tags-ignore: - - v4* + branches: + - '4.x' + tags-ignore: + - v4* jobs: deploy: diff --git a/.github/workflows/e2e_network_tests.yml b/.github/workflows/e2e_network_tests.yml index 232420fca12..133815e4e2e 100644 --- a/.github/workflows/e2e_network_tests.yml +++ b/.github/workflows/e2e_network_tests.yml @@ -1,10 +1,10 @@ name: 'E2E Network Tests' on: push: - branches: - - release/** - tags: - - v4.* + branches: + - release/** + tags: + - v4.* # For test purpose only: # pull_request: @@ -12,44 +12,44 @@ on: # - '4.x' # types: [ opened, reopened, synchronize ] jobs: - build: - name: Build Packages - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 18 - cache: yarn - - run: yarn - - uses: actions/cache/save@v4 - with: - path: ./ - key: web3-e2e-18-${{github.sha}} - e2e: - name: E2E Network Tests - needs: build - runs-on: ubuntu-latest - env: - INFURA_SEPOLIA_HTTP: ${{ secrets.CS_ETH_SEPOLIA }} - INFURA_MAINNET_HTTP: ${{ secrets.CS_ETH_MAINNET }} - MODE: ${{ matrix.mode }} - 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: - fail-fast: false - matrix: - mode: ['http'] - network: ['sepolia', 'mainnet'] - steps: - - uses: actions/setup-node@v3 - with: - node-version: 18 - - uses: actions/cache/restore@v4 - with: - path: ./ - key: web3-e2e-18-${{github.sha}} - - run: | - yarn test:e2e:${{ matrix.network }}:${{ matrix.mode }} - shell: bash + build: + name: Build Packages + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 18 + cache: yarn + - run: yarn + - uses: actions/cache/save@v4 + with: + path: ./ + key: web3-e2e-18-${{github.sha}} + e2e: + name: E2E Network Tests + needs: build + runs-on: ubuntu-latest + env: + INFURA_SEPOLIA_HTTP: ${{ secrets.CS_ETH_SEPOLIA }} + INFURA_MAINNET_HTTP: ${{ secrets.CS_ETH_MAINNET }} + MODE: ${{ matrix.mode }} + 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: + fail-fast: false + matrix: + mode: ['http'] + network: ['sepolia', 'mainnet'] + steps: + - uses: actions/setup-node@v4 + with: + node-version: 18 + - uses: actions/cache/restore@v4 + with: + path: ./ + key: web3-e2e-18-${{github.sha}} + - run: | + yarn test:e2e:${{ matrix.network }}:${{ matrix.mode }} + shell: bash diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index d89cbdb6622..bc5e88ab6c9 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -1,19 +1,19 @@ -name: "Close stale issues" +name: 'Close stale issues' on: - schedule: - - cron: "0 0 * * *" + schedule: + - cron: '0 0 * * *' jobs: - stale: - runs-on: ubuntu-latest - steps: - - uses: actions/stale@v3 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - stale-issue-message: 'This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. If you believe this was a mistake, please comment.' - stale-pr-message: 'This PR has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. If you believe this was a mistake, please comment.' - days-before-stale: 60 - days-before-close: 14 - operations-per-run: 100 - exempt-pr-labels: 'work-in-progress,4.x' - exempt-issue-labels: 'work-in-progress,4.x' + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v3 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + stale-issue-message: 'This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. If you believe this was a mistake, please comment.' + stale-pr-message: 'This PR has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. If you believe this was a mistake, please comment.' + days-before-stale: 60 + days-before-close: 14 + operations-per-run: 100 + exempt-pr-labels: 'work-in-progress,4.x' + exempt-issue-labels: 'work-in-progress,4.x' From 6ad1ca9f99624fb650b9391347e930fc6595d2ae Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Nov 2024 11:09:08 +0100 Subject: [PATCH 06/21] Bump express from 4.19.2 to 4.21.1 in /docs (#7388) --- docs/yarn.lock | 105 ++++++++++++++++++++++++++----------------------- 1 file changed, 55 insertions(+), 50 deletions(-) diff --git a/docs/yarn.lock b/docs/yarn.lock index cf67200d6e6..13d7341ed3a 100644 --- a/docs/yarn.lock +++ b/docs/yarn.lock @@ -4024,10 +4024,10 @@ binary-extensions@^2.0.0: resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.3.0.tgz#f6e14a97858d327252200242d4ccfe522c445522" integrity sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw== -body-parser@1.20.2: - version "1.20.2" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.2.tgz#6feb0e21c4724d06de7ff38da36dad4f57a747fd" - integrity sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA== +body-parser@1.20.3: + version "1.20.3" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.3.tgz#1953431221c6fb5cd63c4b36d53fab0928e548c6" + integrity sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g== dependencies: bytes "3.1.2" content-type "~1.0.5" @@ -4037,7 +4037,7 @@ body-parser@1.20.2: http-errors "2.0.0" iconv-lite "0.4.24" on-finished "2.4.1" - qs "6.11.0" + qs "6.13.0" raw-body "2.5.2" type-is "~1.6.18" unpipe "1.0.0" @@ -4613,10 +4613,10 @@ cookie-signature@1.0.6: resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" integrity sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ== -cookie@0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.6.0.tgz#2798b04b071b0ecbff0dbb62a505a8efa4e19051" - integrity sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw== +cookie@0.7.1: + version "0.7.1" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.7.1.tgz#2f73c42142d5d5cf71310a74fc4ae61670e5dbc9" + integrity sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w== copy-text-to-clipboard@^3.2.0: version "3.2.0" @@ -5274,6 +5274,11 @@ encodeurl@~1.0.2: resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" integrity sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w== +encodeurl@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-2.0.0.tgz#7b8ea898077d7e409d3ac45474ea38eaf0857a58" + integrity sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg== + enhanced-resolve@^5.17.0: version "5.17.1" resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz#67bfbbcc2f81d511be77d686a90267ef7f898a15" @@ -5478,36 +5483,36 @@ execa@^5.0.0: strip-final-newline "^2.0.0" express@^4.17.3: - version "4.19.2" - resolved "https://registry.yarnpkg.com/express/-/express-4.19.2.tgz#e25437827a3aa7f2a827bc8171bbbb664a356465" - integrity sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q== + version "4.21.1" + resolved "https://registry.yarnpkg.com/express/-/express-4.21.1.tgz#9dae5dda832f16b4eec941a4e44aa89ec481b281" + integrity sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ== dependencies: accepts "~1.3.8" array-flatten "1.1.1" - body-parser "1.20.2" + body-parser "1.20.3" content-disposition "0.5.4" content-type "~1.0.4" - cookie "0.6.0" + cookie "0.7.1" cookie-signature "1.0.6" debug "2.6.9" depd "2.0.0" - encodeurl "~1.0.2" + encodeurl "~2.0.0" escape-html "~1.0.3" etag "~1.8.1" - finalhandler "1.2.0" + finalhandler "1.3.1" fresh "0.5.2" http-errors "2.0.0" - merge-descriptors "1.0.1" + merge-descriptors "1.0.3" methods "~1.1.2" on-finished "2.4.1" parseurl "~1.3.3" - path-to-regexp "0.1.7" + path-to-regexp "0.1.10" proxy-addr "~2.0.7" - qs "6.11.0" + qs "6.13.0" range-parser "~1.2.1" safe-buffer "5.2.1" - send "0.18.0" - serve-static "1.15.0" + send "0.19.0" + serve-static "1.16.2" setprototypeof "1.2.0" statuses "2.0.1" type-is "~1.6.18" @@ -5627,13 +5632,13 @@ fill-range@^7.1.1: dependencies: to-regex-range "^5.0.1" -finalhandler@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.2.0.tgz#7d23fe5731b207b4640e4fcd00aec1f9207a7b32" - integrity sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg== +finalhandler@1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.3.1.tgz#0c575f1d1d324ddd1da35ad7ece3df7d19088019" + integrity sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ== dependencies: debug "2.6.9" - encodeurl "~1.0.2" + encodeurl "~2.0.0" escape-html "~1.0.3" on-finished "2.4.1" parseurl "~1.3.3" @@ -7487,10 +7492,10 @@ memorystream@^0.3.1: resolved "https://registry.yarnpkg.com/memorystream/-/memorystream-0.3.1.tgz#86d7090b30ce455d63fbae12dda51a47ddcaf9b2" integrity sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw== -merge-descriptors@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" - integrity sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w== +merge-descriptors@1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.3.tgz#d80319a65f3c7935351e5cfdac8f9318504dbed5" + integrity sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ== merge-stream@^2.0.0: version "2.0.0" @@ -8472,10 +8477,10 @@ path-scurry@^1.11.1: lru-cache "^10.2.0" minipass "^5.0.0 || ^6.0.2 || ^7.0.0" -path-to-regexp@0.1.7: - version "0.1.7" - resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" - integrity sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ== +path-to-regexp@0.1.10: + version "0.1.10" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.10.tgz#67e9108c5c0551b9e5326064387de4763c4d5f8b" + integrity sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w== path-to-regexp@2.2.1: version "2.2.1" @@ -8953,12 +8958,12 @@ pupa@^3.1.0: dependencies: escape-goat "^4.0.0" -qs@6.11.0: - version "6.11.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a" - integrity sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q== +qs@6.13.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.13.0.tgz#6ca3bd58439f7e245655798997787b0d88a51906" + integrity sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg== dependencies: - side-channel "^1.0.4" + side-channel "^1.0.6" queue-microtask@^1.2.2: version "1.2.3" @@ -9751,10 +9756,10 @@ semver@^7.3.2, semver@^7.3.5, semver@^7.3.7, semver@^7.5.4: resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== -send@0.18.0: - version "0.18.0" - resolved "https://registry.yarnpkg.com/send/-/send-0.18.0.tgz#670167cc654b05f5aa4a767f9113bb371bc706be" - integrity sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg== +send@0.19.0: + version "0.19.0" + resolved "https://registry.yarnpkg.com/send/-/send-0.19.0.tgz#bbc5a388c8ea6c048967049dbeac0e4a3f09d7f8" + integrity sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw== dependencies: debug "2.6.9" depd "2.0.0" @@ -9804,15 +9809,15 @@ serve-index@^1.9.1: mime-types "~2.1.17" parseurl "~1.3.2" -serve-static@1.15.0: - version "1.15.0" - resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.15.0.tgz#faaef08cffe0a1a62f60cad0c4e513cff0ac9540" - integrity sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g== +serve-static@1.16.2: + version "1.16.2" + resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.16.2.tgz#b6a5343da47f6bdd2673848bf45754941e803296" + integrity sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw== dependencies: - encodeurl "~1.0.2" + encodeurl "~2.0.0" escape-html "~1.0.3" parseurl "~1.3.3" - send "0.18.0" + send "0.19.0" set-function-length@^1.2.1: version "1.2.2" @@ -9901,7 +9906,7 @@ shiki@^0.14.7: vscode-oniguruma "^1.7.0" vscode-textmate "^8.0.0" -side-channel@^1.0.4: +side-channel@^1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.6.tgz#abd25fb7cd24baf45466406b1096b7831c9215f2" integrity sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA== From bde13161e76e99841c6d8901c03901ce739174f2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Nov 2024 11:13:51 +0100 Subject: [PATCH 07/21] Bump ws from 7.4.6 to 8.18.0 (#7171) --- yarn.lock | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/yarn.lock b/yarn.lock index 0884fd08293..52a562b8587 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12953,26 +12953,21 @@ ws@7.4.6: integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A== ws@^5.1.1: - version "5.2.3" - resolved "https://registry.yarnpkg.com/ws/-/ws-5.2.3.tgz#05541053414921bc29c63bee14b8b0dd50b07b3d" - integrity sha512-jZArVERrMsKUatIdnLzqvcfydI85dvd/Fp1u/VOpfdDWQ4c9qWXe+VIeAbQ5FrDwciAkr+lzofXLz3Kuf26AOA== + version "5.2.4" + resolved "https://registry.yarnpkg.com/ws/-/ws-5.2.4.tgz#c7bea9f1cfb5f410de50e70e82662e562113f9a7" + integrity sha512-fFCejsuC8f9kOSu9FYaOw8CdO68O3h5v0lg4p74o8JqWpwTf9tniOD+nOB78aWoVSS6WptVUmDrp/KPsMVBWFQ== dependencies: async-limiter "~1.0.0" ws@^7.3.1, ws@^7.4.6: - version "7.5.9" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.9.tgz#54fa7db29f4c7cec68b1ddd3a89de099942bb591" - integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q== - -ws@^8.11.0: - version "8.14.2" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.14.2.tgz#6c249a806eb2db7a20d26d51e7709eab7b2e6c7f" - integrity sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g== - -ws@^8.17.1: - version "8.17.1" - resolved "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz#9293da530bb548febc95371d90f9c878727d919b" - integrity sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ== + version "7.5.10" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.10.tgz#58b5c20dc281633f6c19113f39b349bd8bd558d9" + integrity sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ== + +ws@^8.11.0, ws@^8.17.1: + version "8.18.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.0.tgz#0d7505a6eafe2b0e712d232b42279f53bc289bbc" + integrity sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw== xhr@^2.2.0: version "2.6.0" From 8c55cb0061a4089a2c5470b11834e18c6c1b11ea Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Nov 2024 11:20:39 +0100 Subject: [PATCH 08/21] Bump micromatch from 4.0.7 to 4.0.8 in /docs (#7225) --- docs/yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/yarn.lock b/docs/yarn.lock index 13d7341ed3a..a25944a756d 100644 --- a/docs/yarn.lock +++ b/docs/yarn.lock @@ -7942,9 +7942,9 @@ micromark@~2.11.0: parse-entities "^2.0.0" micromatch@^4.0.2, micromatch@^4.0.4, micromatch@^4.0.5: - version "4.0.7" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.7.tgz#33e8190d9fe474a9895525f5618eee136d46c2e5" - integrity sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q== + version "4.0.8" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.8.tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202" + integrity sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA== dependencies: braces "^3.0.3" picomatch "^2.3.1" From 471c12bac67dd40162c8c6c897a5c98c3a3815cc Mon Sep 17 00:00:00 2001 From: Muhammad Altabba <24407834+Muhammad-Altabba@users.noreply.github.com> Date: Thu, 14 Nov 2024 11:21:52 +0100 Subject: [PATCH 09/21] fix: upgrade prism-react-renderer from 2.3.1 to 2.4.0 (#7367) --- docs/package.json | 2 +- docs/yarn.lock | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/package.json b/docs/package.json index 9f337bbbcd3..f8b1958d25f 100644 --- a/docs/package.json +++ b/docs/package.json @@ -23,7 +23,7 @@ "classnames": "^2.3.2", "clsx": "^2.0.0", "docusaurus-lunr-search": "^3.3.1", - "prism-react-renderer": "^2.3.0", + "prism-react-renderer": "^2.4.0", "react": "^18.2.0", "react-dom": "^18.2.0" }, diff --git a/docs/yarn.lock b/docs/yarn.lock index a25944a756d..dc1815d39a5 100644 --- a/docs/yarn.lock +++ b/docs/yarn.lock @@ -8889,6 +8889,14 @@ prism-react-renderer@^2.0.6, prism-react-renderer@^2.3.0: "@types/prismjs" "^1.26.0" clsx "^2.0.0" +prism-react-renderer@^2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/prism-react-renderer/-/prism-react-renderer-2.4.0.tgz#c5ea692029c2f8b3fd04f63662d04ffd4eaf10a0" + integrity sha512-327BsVCD/unU4CNLZTWVHyUHKnsqcvj2qbPlQ8MiBE2eq2rgctjigPA1Gp9HLF83kZ20zNN6jgizHJeEsyFYOw== + dependencies: + "@types/prismjs" "^1.26.0" + clsx "^2.0.0" + prismjs@^1.29.0: version "1.29.0" resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.29.0.tgz#f113555a8fa9b57c35e637bba27509dcf802dd12" From 1b367e6c0c98682a605c56bba786045823d375f0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Nov 2024 11:31:40 +0100 Subject: [PATCH 10/21] Bump express from 4.18.1 to 4.20.0 (#7258) --- yarn.lock | 275 +++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 221 insertions(+), 54 deletions(-) diff --git a/yarn.lock b/yarn.lock index 52a562b8587..cf7dd00cedd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3595,21 +3595,21 @@ bn.js@^5.1.2, bn.js@^5.2.0, bn.js@^5.2.1: resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== -body-parser@1.20.0: - version "1.20.0" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.0.tgz#3de69bd89011c11573d7bfee6a64f11b6bd27cc5" - integrity sha512-DfJ+q6EPcGKZD1QWUjSpqp+Q7bDQTsQIF4zfUAtZ6qk+H/3/QRhg9CEp39ss+/T2vw0+HaidC0ecJj/DRLIaKg== +body-parser@1.20.3: + version "1.20.3" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.3.tgz#1953431221c6fb5cd63c4b36d53fab0928e548c6" + integrity sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g== dependencies: bytes "3.1.2" - content-type "~1.0.4" + content-type "~1.0.5" debug "2.6.9" depd "2.0.0" destroy "1.2.0" http-errors "2.0.0" iconv-lite "0.4.24" on-finished "2.4.1" - qs "6.10.3" - raw-body "2.5.1" + qs "6.13.0" + raw-body "2.5.2" type-is "~1.6.18" unpipe "1.0.0" @@ -3876,6 +3876,17 @@ call-bind@^1.0.0, call-bind@^1.0.2: function-bind "^1.1.1" get-intrinsic "^1.0.2" +call-bind@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.7.tgz#06016599c40c56498c18769d2730be242b6fa3b9" + integrity sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w== + dependencies: + es-define-property "^1.0.0" + es-errors "^1.3.0" + function-bind "^1.1.2" + get-intrinsic "^1.2.4" + set-function-length "^1.2.1" + callsites@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" @@ -4329,10 +4340,10 @@ content-disposition@0.5.4: dependencies: safe-buffer "5.2.1" -content-type@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" - integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== +content-type@~1.0.4, content-type@~1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.5.tgz#8b773162656d1d1086784c8f23a54ce6d73d7918" + integrity sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA== conventional-changelog-angular@5.0.12: version "5.0.12" @@ -4433,10 +4444,10 @@ cookie-signature@1.0.6: resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" integrity sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ== -cookie@0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.5.0.tgz#d1f5d71adec6558c58f389987c366aa47e994f8b" - integrity sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw== +cookie@0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.6.0.tgz#2798b04b071b0ecbff0dbb62a505a8efa4e19051" + integrity sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw== cookie@^0.4.1: version "0.4.2" @@ -4631,7 +4642,14 @@ debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.9: dependencies: ms "2.0.0" -debug@4, debug@4.3.4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.2, debug@^4.3.3, debug@^4.3.4: +debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.2, debug@^4.3.3, debug@^4.3.4, debug@~4.3.6: + version "4.3.6" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.6.tgz#2ab2c38fbaffebf8aa95fdfe6d88438c7a13c52b" + integrity sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg== + dependencies: + ms "2.1.2" + +debug@4.3.4: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== @@ -4645,13 +4663,6 @@ debug@^3.2.7: dependencies: ms "^2.1.1" -debug@~4.3.6: - version "4.3.6" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.6.tgz#2ab2c38fbaffebf8aa95fdfe6d88438c7a13c52b" - integrity sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg== - dependencies: - ms "2.1.2" - decamelize-keys@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/decamelize-keys/-/decamelize-keys-1.1.0.tgz#d171a87933252807eb3cb61dc1c1445d078df2d9" @@ -4737,6 +4748,15 @@ deferred-leveldown@~1.2.1: dependencies: abstract-leveldown "~2.6.0" +define-data-property@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.4.tgz#894dc141bb7d3060ae4366f6a0107e68fbe48c5e" + integrity sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A== + dependencies: + es-define-property "^1.0.0" + es-errors "^1.3.0" + gopd "^1.0.1" + define-lazy-prop@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz#3f7ae421129bcaaac9bc74905c98a0009ec9ee7f" @@ -5004,6 +5024,11 @@ encodeurl@~1.0.2: resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" integrity sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w== +encodeurl@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-2.0.0.tgz#7b8ea898077d7e409d3ac45474ea38eaf0857a58" + integrity sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg== + encoding@^0.1.13: version "0.1.13" resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.13.tgz#56574afdd791f54a8e9b2785c0582a2d26210fa9" @@ -5109,6 +5134,18 @@ es-abstract@^1.19.0, es-abstract@^1.19.1, es-abstract@^1.19.2, es-abstract@^1.19 string.prototype.trimstart "^1.0.5" unbox-primitive "^1.0.2" +es-define-property@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/es-define-property/-/es-define-property-1.0.0.tgz#c7faefbdff8b2696cf5f46921edfb77cc4ba3845" + integrity sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ== + dependencies: + get-intrinsic "^1.2.4" + +es-errors@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/es-errors/-/es-errors-1.3.0.tgz#05f75a25dab98e4fb1dcd5e1472c0546d5057c8f" + integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw== + es-module-lexer@^0.9.0: version "0.9.3" resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-0.9.3.tgz#6f13db00cc38417137daf74366f535c8eb438f19" @@ -5873,36 +5910,36 @@ expect@^29.7.0: jest-util "^29.7.0" express@^4.18.1: - version "4.18.1" - resolved "https://registry.yarnpkg.com/express/-/express-4.18.1.tgz#7797de8b9c72c857b9cd0e14a5eea80666267caf" - integrity sha512-zZBcOX9TfehHQhtupq57OF8lFZ3UZi08Y97dwFCkD8p9d/d2Y3M+ykKcwaMDEL+4qyUolgBDX6AblpR3fL212Q== + version "4.20.0" + resolved "https://registry.yarnpkg.com/express/-/express-4.20.0.tgz#f1d08e591fcec770c07be4767af8eb9bcfd67c48" + integrity sha512-pLdae7I6QqShF5PnNTCVn4hI91Dx0Grkn2+IAsMTgMIKuQVte2dN9PeGSSAME2FR8anOhVA62QDIUaWVfEXVLw== dependencies: accepts "~1.3.8" array-flatten "1.1.1" - body-parser "1.20.0" + body-parser "1.20.3" content-disposition "0.5.4" content-type "~1.0.4" - cookie "0.5.0" + cookie "0.6.0" cookie-signature "1.0.6" debug "2.6.9" depd "2.0.0" - encodeurl "~1.0.2" + encodeurl "~2.0.0" escape-html "~1.0.3" etag "~1.8.1" finalhandler "1.2.0" fresh "0.5.2" http-errors "2.0.0" - merge-descriptors "1.0.1" + merge-descriptors "1.0.3" methods "~1.1.2" on-finished "2.4.1" parseurl "~1.3.3" - path-to-regexp "0.1.7" + path-to-regexp "0.1.10" proxy-addr "~2.0.7" - qs "6.10.3" + qs "6.11.0" range-parser "~1.2.1" safe-buffer "5.2.1" - send "0.18.0" - serve-static "1.15.0" + send "0.19.0" + serve-static "1.16.0" setprototypeof "1.2.0" statuses "2.0.1" type-is "~1.6.18" @@ -6303,6 +6340,11 @@ function-bind@^1.1.1: resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== +function-bind@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c" + integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA== + function.prototype.name@^1.1.5: version "1.1.5" resolved "https://registry.yarnpkg.com/function.prototype.name/-/function.prototype.name-1.1.5.tgz#cce0505fe1ffb80503e6f9e46cc64e46a12a9621" @@ -6426,6 +6468,17 @@ get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1: has "^1.0.3" has-symbols "^1.0.3" +get-intrinsic@^1.1.3, get-intrinsic@^1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.4.tgz#e385f5a4b5227d449c3eabbad05494ef0abbeadd" + integrity sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ== + dependencies: + es-errors "^1.3.0" + function-bind "^1.1.2" + has-proto "^1.0.1" + has-symbols "^1.0.3" + hasown "^2.0.0" + get-package-type@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" @@ -6678,6 +6731,13 @@ globby@^6.1.0: pify "^2.0.0" pinkie-promise "^2.0.0" +gopd@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.0.1.tgz#29ff76de69dac7489b7c0918a5788e56477c332c" + integrity sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA== + dependencies: + get-intrinsic "^1.1.3" + graceful-fs@4.2.10, graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@^4.2.0, graceful-fs@^4.2.4, graceful-fs@^4.2.6, graceful-fs@^4.2.9: version "4.2.10" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" @@ -6801,6 +6861,18 @@ has-property-descriptors@^1.0.0: dependencies: get-intrinsic "^1.1.1" +has-property-descriptors@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz#963ed7d071dc7bf5f084c5bfbe0d1b6222586854" + integrity sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg== + dependencies: + es-define-property "^1.0.0" + +has-proto@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has-proto/-/has-proto-1.0.3.tgz#b31ddfe9b0e6e9914536a6ab286426d0214f77fd" + integrity sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q== + has-symbols@^1.0.2, has-symbols@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" @@ -6873,6 +6945,13 @@ hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3, hash.js@^1.1.7: inherits "^2.0.3" minimalistic-assert "^1.0.1" +hasown@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003" + integrity sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ== + dependencies: + function-bind "^1.1.2" + he@1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" @@ -9048,10 +9127,10 @@ meow@^8.0.0: type-fest "^0.18.0" yargs-parser "^20.2.3" -merge-descriptors@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" - integrity sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w== +merge-descriptors@1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.3.tgz#d80319a65f3c7935351e5cfdac8f9318504dbed5" + integrity sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ== merge-stream@^2.0.0: version "2.0.0" @@ -9884,6 +9963,11 @@ object-inspect@^1.12.0, object-inspect@^1.9.0: resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.2.tgz#c0641f26394532f28ab8d796ab954e43c009a8ea" integrity sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ== +object-inspect@^1.13.1: + version "1.13.3" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.3.tgz#f14c183de51130243d6d18ae149375ff50ea488a" + integrity sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA== + object-is@^1.0.1: version "1.1.5" resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.1.5.tgz#b9deeaa5fc7f1846a0faecdceec138e5778f53ac" @@ -10320,10 +10404,10 @@ path-scurry@^1.6.1, path-scurry@^1.7.0: lru-cache "^9.1.1" minipass "^5.0.0 || ^6.0.2" -path-to-regexp@0.1.7: - version "0.1.7" - resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" - integrity sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ== +path-to-regexp@0.1.10: + version "0.1.10" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.10.tgz#67e9108c5c0551b9e5326064387de4763c4d5f8b" + integrity sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w== path-type@^3.0.0: version "3.0.0" @@ -10614,13 +10698,20 @@ q@^1.5.1: resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" integrity sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw== -qs@6.10.3: - version "6.10.3" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.10.3.tgz#d6cde1b2ffca87b5aa57889816c5f81535e22e8e" - integrity sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ== +qs@6.11.0: + version "6.11.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a" + integrity sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q== dependencies: side-channel "^1.0.4" +qs@6.13.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.13.0.tgz#6ca3bd58439f7e245655798997787b0d88a51906" + integrity sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg== + dependencies: + side-channel "^1.0.6" + qs@~6.5.2: version "6.5.3" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad" @@ -10653,7 +10744,17 @@ range-parser@~1.2.1: resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== -raw-body@2.5.1, raw-body@^2.4.1: +raw-body@2.5.2: + version "2.5.2" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.2.tgz#99febd83b90e08975087e8f1f9419a149366b68a" + integrity sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA== + dependencies: + bytes "3.1.2" + http-errors "2.0.0" + iconv-lite "0.4.24" + unpipe "1.0.0" + +raw-body@^2.4.1: version "2.5.1" resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.1.tgz#fe1b1628b181b700215e5fd42389f98b71392857" integrity sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig== @@ -11235,6 +11336,25 @@ send@0.18.0: range-parser "~1.2.1" statuses "2.0.1" +send@0.19.0: + version "0.19.0" + resolved "https://registry.yarnpkg.com/send/-/send-0.19.0.tgz#bbc5a388c8ea6c048967049dbeac0e4a3f09d7f8" + integrity sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw== + dependencies: + debug "2.6.9" + depd "2.0.0" + destroy "1.2.0" + encodeurl "~1.0.2" + escape-html "~1.0.3" + etag "~1.8.1" + fresh "0.5.2" + http-errors "2.0.0" + mime "1.6.0" + ms "2.1.3" + on-finished "2.4.1" + range-parser "~1.2.1" + statuses "2.0.1" + serialize-javascript@6.0.0, serialize-javascript@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" @@ -11242,10 +11362,10 @@ serialize-javascript@6.0.0, serialize-javascript@^6.0.0: dependencies: randombytes "^2.1.0" -serve-static@1.15.0: - version "1.15.0" - resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.15.0.tgz#faaef08cffe0a1a62f60cad0c4e513cff0ac9540" - integrity sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g== +serve-static@1.16.0: + version "1.16.0" + resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.16.0.tgz#2bf4ed49f8af311b519c46f272bf6ac3baf38a92" + integrity sha512-pDLK8zwl2eKaYrs8mrPZBJua4hMplRWJ1tIFksVC3FtBEBnl8dxgeHtsaMS8DhS9i4fLObaon6ABoc4/hQGdPA== dependencies: encodeurl "~1.0.2" escape-html "~1.0.3" @@ -11257,6 +11377,18 @@ set-blocking@^2.0.0, set-blocking@~2.0.0: resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== +set-function-length@^1.2.1: + version "1.2.2" + resolved "https://registry.yarnpkg.com/set-function-length/-/set-function-length-1.2.2.tgz#aac72314198eaed975cf77b2c3b6b880695e5449" + integrity sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg== + dependencies: + define-data-property "^1.1.4" + es-errors "^1.3.0" + function-bind "^1.1.2" + get-intrinsic "^1.2.4" + gopd "^1.0.1" + has-property-descriptors "^1.0.2" + set-immediate-shim@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61" @@ -11333,6 +11465,16 @@ side-channel@^1.0.4: get-intrinsic "^1.0.2" object-inspect "^1.9.0" +side-channel@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.6.tgz#abd25fb7cd24baf45466406b1096b7831c9215f2" + integrity sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA== + dependencies: + call-bind "^1.0.7" + es-errors "^1.3.0" + get-intrinsic "^1.2.4" + object-inspect "^1.13.1" + signal-exit@3.0.7, signal-exit@^3.0.0, signal-exit@^3.0.2, signal-exit@^3.0.3, signal-exit@^3.0.7: version "3.0.7" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" @@ -11681,7 +11823,7 @@ string-length@^4.0.1: char-regex "^1.0.2" strip-ansi "^6.0.0" -"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0": version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -11699,6 +11841,15 @@ string-width@^1.0.1: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" +"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + string-width@^5.0.1, string-width@^5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" @@ -11754,7 +11905,7 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -11768,6 +11919,13 @@ strip-ansi@^3.0.0, strip-ansi@^3.0.1: dependencies: ansi-regex "^2.0.0" +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + strip-ansi@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.0.1.tgz#61740a08ce36b61e50e65653f07060d000975fb2" @@ -12861,7 +13019,16 @@ workerpool@6.2.1: resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343" integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== From 6229f4d8f0f0a327b00970a48702d191b64a6b49 Mon Sep 17 00:00:00 2001 From: Kris <605420+krzysu@users.noreply.github.com> Date: Tue, 19 Nov 2024 10:48:21 +0100 Subject: [PATCH 11/21] chore: update deps to fix vulnerabilities (#7389) --- yarn.lock | 541 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 297 insertions(+), 244 deletions(-) diff --git a/yarn.lock b/yarn.lock index cf7dd00cedd..a6973e86251 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1210,7 +1210,7 @@ "@jridgewell/set-array" "^1.0.0" "@jridgewell/sourcemap-codec" "^1.4.10" -"@jridgewell/gen-mapping@^0.3.0", "@jridgewell/gen-mapping@^0.3.2": +"@jridgewell/gen-mapping@^0.3.2": version "0.3.2" resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz#c1aedc61e853f2bb9f5dfe6d4442d3b565b253b9" integrity sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A== @@ -1219,6 +1219,15 @@ "@jridgewell/sourcemap-codec" "^1.4.10" "@jridgewell/trace-mapping" "^0.3.9" +"@jridgewell/gen-mapping@^0.3.5": + version "0.3.5" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz#dcce6aff74bdf6dad1a95802b69b04a2fcb1fb36" + integrity sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg== + dependencies: + "@jridgewell/set-array" "^1.2.1" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/trace-mapping" "^0.3.24" + "@jridgewell/resolve-uri@^3.0.3": version "3.1.0" resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" @@ -1234,13 +1243,18 @@ resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== -"@jridgewell/source-map@^0.3.2": - version "0.3.2" - resolved "https://registry.yarnpkg.com/@jridgewell/source-map/-/source-map-0.3.2.tgz#f45351aaed4527a298512ec72f81040c998580fb" - integrity sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw== +"@jridgewell/set-array@^1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.2.1.tgz#558fb6472ed16a4c850b889530e6b36438c49280" + integrity sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A== + +"@jridgewell/source-map@^0.3.3": + version "0.3.6" + resolved "https://registry.yarnpkg.com/@jridgewell/source-map/-/source-map-0.3.6.tgz#9d71ca886e32502eb9362c9a74a46787c36df81a" + integrity sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ== dependencies: - "@jridgewell/gen-mapping" "^0.3.0" - "@jridgewell/trace-mapping" "^0.3.9" + "@jridgewell/gen-mapping" "^0.3.5" + "@jridgewell/trace-mapping" "^0.3.25" "@jridgewell/sourcemap-codec@^1.4.10": version "1.4.14" @@ -1260,7 +1274,7 @@ "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" -"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.14", "@jridgewell/trace-mapping@^0.3.9": +"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.9": version "0.3.15" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.15.tgz#aba35c48a38d3fd84b37e66c9c0423f9744f9774" integrity sha512-oWZNOULl+UbhsgB51uuZzglikfIKSUBO/M9W2OfEjn7cmqoAiCgmv9lyACTUacZwBz0ITnJ2NqjU8Tx0DHL88g== @@ -1284,6 +1298,14 @@ "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" +"@jridgewell/trace-mapping@^0.3.20", "@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.25": + version "0.3.25" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz#15f190e98895f3fc23276ee14bc76b675c2e50f0" + integrity sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ== + dependencies: + "@jridgewell/resolve-uri" "^3.1.0" + "@jridgewell/sourcemap-codec" "^1.4.14" + "@lerna/child-process@6.6.2": version "6.6.2" resolved "https://registry.yarnpkg.com/@lerna/child-process/-/child-process-6.6.2.tgz#5d803c8dee81a4e013dc428292e77b365cba876c" @@ -2037,9 +2059,9 @@ "@octokit/openapi-types" "^13.1.0" "@openzeppelin/contracts@^4.7.1": - version "4.9.3" - resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.9.3.tgz#00d7a8cf35a475b160b3f0293a6403c511099364" - integrity sha512-He3LieZ1pP2TNt5JbkPA4PNT9WC3gOTOlDcFGJW4Le4QKqwmiNJCRt44APfxMxvq7OugU/cqYuPcSBzOw38DAg== + version "4.9.6" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.9.6.tgz#2a880a24eb19b4f8b25adc2a5095f2aa27f39677" + integrity "sha1-KogKJOsZtPiyWtwqUJXyqifzlnc= sha512-xSmezSupL+y9VkHZJGDoCBpmnB2ogM13ccaYDWqJTfS3dbuHkgjuwDFUmaFauBCboQMGB/S5UqUl2y54X99BmA==" "@parcel/watcher@2.0.4": version "2.0.4" @@ -2362,10 +2384,10 @@ dependencies: "@types/node" "*" -"@types/eslint-scope@^3.7.3": - version "3.7.4" - resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.4.tgz#37fc1223f0786c39627068a12e94d6e6fc61de16" - integrity sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA== +"@types/eslint-scope@^3.7.7": + version "3.7.7" + resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.7.tgz#3108bd5f18b0cdb277c867b3dd449c9ed7079ac5" + integrity "sha1-MQi9XxiwzbJ3yGez3UScntcHmsU= sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==" dependencies: "@types/eslint" "*" "@types/estree" "*" @@ -2383,10 +2405,10 @@ resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.0.tgz#5fb2e536c1ae9bf35366eed879e827fa59ca41c2" integrity sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ== -"@types/estree@^0.0.51": - version "0.0.51" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.51.tgz#cfd70924a25a3fd32b218e5e420e6897e1ac4f40" - integrity sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ== +"@types/estree@^1.0.6": + version "1.0.6" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.6.tgz#628effeeae2064a1b4e79f78e81d87b7e5fc7b50" + integrity sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw== "@types/express-serve-static-core@^4.17.18": version "4.17.30" @@ -2719,125 +2741,125 @@ "@typescript-eslint/types" "5.33.1" eslint-visitor-keys "^3.3.0" -"@webassemblyjs/ast@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.11.1.tgz#2bfd767eae1a6996f432ff7e8d7fc75679c0b6a7" - integrity sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw== +"@webassemblyjs/ast@1.14.1", "@webassemblyjs/ast@^1.12.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.14.1.tgz#a9f6a07f2b03c95c8d38c4536a1fdfb521ff55b6" + integrity "sha1-qfagfysDyVyNOMRTah/ftSH/VbY= sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ==" dependencies: - "@webassemblyjs/helper-numbers" "1.11.1" - "@webassemblyjs/helper-wasm-bytecode" "1.11.1" + "@webassemblyjs/helper-numbers" "1.13.2" + "@webassemblyjs/helper-wasm-bytecode" "1.13.2" -"@webassemblyjs/floating-point-hex-parser@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.1.tgz#f6c61a705f0fd7a6aecaa4e8198f23d9dc179e4f" - integrity sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ== +"@webassemblyjs/floating-point-hex-parser@1.13.2": + version "1.13.2" + resolved "https://registry.yarnpkg.com/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.13.2.tgz#fcca1eeddb1cc4e7b6eed4fc7956d6813b21b9fb" + integrity "sha1-/Moe7dscxOe27tT8eVbWgTshufs= sha512-6oXyTOzbKxGH4steLbLNOu71Oj+C8Lg34n6CqRvqfS2O71BxY6ByfMDRhBytzknj9yGUPVJ1qIKhRlAwO1AovA==" -"@webassemblyjs/helper-api-error@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.1.tgz#1a63192d8788e5c012800ba6a7a46c705288fd16" - integrity sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg== +"@webassemblyjs/helper-api-error@1.13.2": + version "1.13.2" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-api-error/-/helper-api-error-1.13.2.tgz#e0a16152248bc38daee76dd7e21f15c5ef3ab1e7" + integrity "sha1-4KFhUiSLw42u523X4h8Vxe86sec= sha512-U56GMYxy4ZQCbDZd6JuvvNV/WFildOjsaWD3Tzzvmw/mas3cXzRJPMjP83JqEsgSbyrmaGjBfDtV7KDXV9UzFQ==" -"@webassemblyjs/helper-buffer@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.1.tgz#832a900eb444884cde9a7cad467f81500f5e5ab5" - integrity sha512-gwikF65aDNeeXa8JxXa2BAk+REjSyhrNC9ZwdT0f8jc4dQQeDQ7G4m0f2QCLPJiMTTO6wfDmRmj/pW0PsUvIcA== +"@webassemblyjs/helper-buffer@1.14.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.14.1.tgz#822a9bc603166531f7d5df84e67b5bf99b72b96b" + integrity "sha1-giqbxgMWZTH31d+E5ntb+ZtyuWs= sha512-jyH7wtcHiKssDtFPRB+iQdxlDf96m0E39yb0k5uJVhFGleZFoNw1c4aeIcVUPPbXUVJ94wwnMOAqUHyzoEPVMA==" -"@webassemblyjs/helper-numbers@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.1.tgz#64d81da219fbbba1e3bd1bfc74f6e8c4e10a62ae" - integrity sha512-vDkbxiB8zfnPdNK9Rajcey5C0w+QJugEglN0of+kmO8l7lDb77AnlKYQF7aarZuCrv+l0UvqL+68gSDr3k9LPQ== +"@webassemblyjs/helper-numbers@1.13.2": + version "1.13.2" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-numbers/-/helper-numbers-1.13.2.tgz#dbd932548e7119f4b8a7877fd5a8d20e63490b2d" + integrity "sha1-29kyVI5xGfS4p4d/1ajSDmNJCy0= sha512-FE8aCmS5Q6eQYcV3gI35O4J789wlQA+7JrqTTpJqn5emA4U2hvwJmvFRC0HODS+3Ye6WioDklgd6scJ3+PLnEA==" dependencies: - "@webassemblyjs/floating-point-hex-parser" "1.11.1" - "@webassemblyjs/helper-api-error" "1.11.1" + "@webassemblyjs/floating-point-hex-parser" "1.13.2" + "@webassemblyjs/helper-api-error" "1.13.2" "@xtuc/long" "4.2.2" -"@webassemblyjs/helper-wasm-bytecode@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.1.tgz#f328241e41e7b199d0b20c18e88429c4433295e1" - integrity sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q== +"@webassemblyjs/helper-wasm-bytecode@1.13.2": + version "1.13.2" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.13.2.tgz#e556108758f448aae84c850e593ce18a0eb31e0b" + integrity "sha1-5VYQh1j0SKroTIUOWTzhig6zHgs= sha512-3QbLKy93F0EAIXLh0ogEVR6rOubA9AoZ+WRYhNbFyuB70j3dRdwH9g+qXhLAO0kiYGlg3TxDV+I4rQTr/YNXkA==" -"@webassemblyjs/helper-wasm-section@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.1.tgz#21ee065a7b635f319e738f0dd73bfbda281c097a" - integrity sha512-10P9No29rYX1j7F3EVPX3JvGPQPae+AomuSTPiF9eBQeChHI6iqjMIwR9JmOJXwpnn/oVGDk7I5IlskuMwU/pg== +"@webassemblyjs/helper-wasm-section@1.14.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.14.1.tgz#9629dda9c4430eab54b591053d6dc6f3ba050348" + integrity "sha1-lindqcRDDqtUtZEFPW3G87oFA0g= sha512-ds5mXEqTJ6oxRoqjhWDU83OgzAYjwsCV8Lo/N+oRsNDmx/ZDpqalmrtgOMkHwxsG0iI//3BwWAErYRHtgn0dZw==" dependencies: - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/helper-buffer" "1.11.1" - "@webassemblyjs/helper-wasm-bytecode" "1.11.1" - "@webassemblyjs/wasm-gen" "1.11.1" + "@webassemblyjs/ast" "1.14.1" + "@webassemblyjs/helper-buffer" "1.14.1" + "@webassemblyjs/helper-wasm-bytecode" "1.13.2" + "@webassemblyjs/wasm-gen" "1.14.1" -"@webassemblyjs/ieee754@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/ieee754/-/ieee754-1.11.1.tgz#963929e9bbd05709e7e12243a099180812992614" - integrity sha512-hJ87QIPtAMKbFq6CGTkZYJivEwZDbQUgYd3qKSadTNOhVY7p+gfP6Sr0lLRVTaG1JjFj+r3YchoqRYxNH3M0GQ== +"@webassemblyjs/ieee754@1.13.2": + version "1.13.2" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ieee754/-/ieee754-1.13.2.tgz#1c5eaace1d606ada2c7fd7045ea9356c59ee0dba" + integrity "sha1-HF6qzh1gatosf9cEXqk1bFnuDbo= sha512-4LtOzh58S/5lX4ITKxnAK2USuNEvpdVV9AlgGQb8rJDHaLeHciwG4zlGr0j/SNWlr7x3vO1lDEsuePvtcDNCkw==" dependencies: "@xtuc/ieee754" "^1.2.0" -"@webassemblyjs/leb128@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/leb128/-/leb128-1.11.1.tgz#ce814b45574e93d76bae1fb2644ab9cdd9527aa5" - integrity sha512-BJ2P0hNZ0u+Th1YZXJpzW6miwqQUGcIHT1G/sf72gLVD9DZ5AdYTqPNbHZh6K1M5VmKvFXwGSWZADz+qBWxeRw== +"@webassemblyjs/leb128@1.13.2": + version "1.13.2" + resolved "https://registry.yarnpkg.com/@webassemblyjs/leb128/-/leb128-1.13.2.tgz#57c5c3deb0105d02ce25fa3fd74f4ebc9fd0bbb0" + integrity "sha1-V8XD3rAQXQLOJfo/109OvJ/Qu7A= sha512-Lde1oNoIdzVzdkNEAWZ1dZ5orIbff80YPdHx20mrHwHrVNNTjNr8E3xz9BdpcGqRQbAEa+fkrCb+fRFTl/6sQw==" dependencies: "@xtuc/long" "4.2.2" -"@webassemblyjs/utf8@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/utf8/-/utf8-1.11.1.tgz#d1f8b764369e7c6e6bae350e854dec9a59f0a3ff" - integrity sha512-9kqcxAEdMhiwQkHpkNiorZzqpGrodQQ2IGrHHxCy+Ozng0ofyMA0lTqiLkVs1uzTRejX+/O0EOT7KxqVPuXosQ== - -"@webassemblyjs/wasm-edit@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.1.tgz#ad206ebf4bf95a058ce9880a8c092c5dec8193d6" - integrity sha512-g+RsupUC1aTHfR8CDgnsVRVZFJqdkFHpsHMfJuWQzWU3tvnLC07UqHICfP+4XyL2tnr1amvl1Sdp06TnYCmVkA== - dependencies: - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/helper-buffer" "1.11.1" - "@webassemblyjs/helper-wasm-bytecode" "1.11.1" - "@webassemblyjs/helper-wasm-section" "1.11.1" - "@webassemblyjs/wasm-gen" "1.11.1" - "@webassemblyjs/wasm-opt" "1.11.1" - "@webassemblyjs/wasm-parser" "1.11.1" - "@webassemblyjs/wast-printer" "1.11.1" - -"@webassemblyjs/wasm-gen@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.1.tgz#86c5ea304849759b7d88c47a32f4f039ae3c8f76" - integrity sha512-F7QqKXwwNlMmsulj6+O7r4mmtAlCWfO/0HdgOxSklZfQcDu0TpLiD1mRt/zF25Bk59FIjEuGAIyn5ei4yMfLhA== - dependencies: - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/helper-wasm-bytecode" "1.11.1" - "@webassemblyjs/ieee754" "1.11.1" - "@webassemblyjs/leb128" "1.11.1" - "@webassemblyjs/utf8" "1.11.1" - -"@webassemblyjs/wasm-opt@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.1.tgz#657b4c2202f4cf3b345f8a4c6461c8c2418985f2" - integrity sha512-VqnkNqnZlU5EB64pp1l7hdm3hmQw7Vgqa0KF/KCNO9sIpI6Fk6brDEiX+iCOYrvMuBWDws0NkTOxYEb85XQHHw== - dependencies: - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/helper-buffer" "1.11.1" - "@webassemblyjs/wasm-gen" "1.11.1" - "@webassemblyjs/wasm-parser" "1.11.1" - -"@webassemblyjs/wasm-parser@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.1.tgz#86ca734534f417e9bd3c67c7a1c75d8be41fb199" - integrity sha512-rrBujw+dJu32gYB7/Lup6UhdkPx9S9SnobZzRVL7VcBH9Bt9bCBLEuX/YXOOtBsOZ4NQrRykKhffRWHvigQvOA== - dependencies: - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/helper-api-error" "1.11.1" - "@webassemblyjs/helper-wasm-bytecode" "1.11.1" - "@webassemblyjs/ieee754" "1.11.1" - "@webassemblyjs/leb128" "1.11.1" - "@webassemblyjs/utf8" "1.11.1" - -"@webassemblyjs/wast-printer@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-printer/-/wast-printer-1.11.1.tgz#d0c73beda8eec5426f10ae8ef55cee5e7084c2f0" - integrity sha512-IQboUWM4eKzWW+N/jij2sRatKMh99QEelo3Eb2q0qXkvPRISAj8Qxtmw5itwqK+TTkBuUIE45AxYPToqPtL5gg== - dependencies: - "@webassemblyjs/ast" "1.11.1" +"@webassemblyjs/utf8@1.13.2": + version "1.13.2" + resolved "https://registry.yarnpkg.com/@webassemblyjs/utf8/-/utf8-1.13.2.tgz#917a20e93f71ad5602966c2d685ae0c6c21f60f1" + integrity "sha1-kXog6T9xrVYClmwtaFrgxsIfYPE= sha512-3NQWGjKTASY1xV5m7Hr0iPeXD9+RDobLll3T9d2AO+g3my8xy5peVyjSag4I50mR1bBSN/Ct12lo+R9tJk0NZQ==" + +"@webassemblyjs/wasm-edit@^1.12.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-edit/-/wasm-edit-1.14.1.tgz#ac6689f502219b59198ddec42dcd496b1004d597" + integrity "sha1-rGaJ9QIhm1kZjd7ELc1JaxAE1Zc= sha512-RNJUIQH/J8iA/1NzlE4N7KtyZNHi3w7at7hDjvRNm5rcUXa00z1vRz3glZoULfJ5mpvYhLybmVcwcjGrC1pRrQ==" + dependencies: + "@webassemblyjs/ast" "1.14.1" + "@webassemblyjs/helper-buffer" "1.14.1" + "@webassemblyjs/helper-wasm-bytecode" "1.13.2" + "@webassemblyjs/helper-wasm-section" "1.14.1" + "@webassemblyjs/wasm-gen" "1.14.1" + "@webassemblyjs/wasm-opt" "1.14.1" + "@webassemblyjs/wasm-parser" "1.14.1" + "@webassemblyjs/wast-printer" "1.14.1" + +"@webassemblyjs/wasm-gen@1.14.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.14.1.tgz#991e7f0c090cb0bb62bbac882076e3d219da9570" + integrity "sha1-mR5/DAkMsLtiu6yIIHbj0hnalXA= sha512-AmomSIjP8ZbfGQhumkNvgC33AY7qtMCXnN6bL2u2Js4gVCg8fp735aEiMSBbDR7UQIj90n4wKAFUSEd0QN2Ukg==" + dependencies: + "@webassemblyjs/ast" "1.14.1" + "@webassemblyjs/helper-wasm-bytecode" "1.13.2" + "@webassemblyjs/ieee754" "1.13.2" + "@webassemblyjs/leb128" "1.13.2" + "@webassemblyjs/utf8" "1.13.2" + +"@webassemblyjs/wasm-opt@1.14.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-opt/-/wasm-opt-1.14.1.tgz#e6f71ed7ccae46781c206017d3c14c50efa8106b" + integrity "sha1-5vce18yuRngcIGAX08FMUO+oEGs= sha512-PTcKLUNvBqnY2U6E5bdOQcSM+oVP/PmrDY9NzowJjislEjwP/C4an2303MCVS2Mg9d3AJpIGdUFIQQWbPds0Sw==" + dependencies: + "@webassemblyjs/ast" "1.14.1" + "@webassemblyjs/helper-buffer" "1.14.1" + "@webassemblyjs/wasm-gen" "1.14.1" + "@webassemblyjs/wasm-parser" "1.14.1" + +"@webassemblyjs/wasm-parser@1.14.1", "@webassemblyjs/wasm-parser@^1.12.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-parser/-/wasm-parser-1.14.1.tgz#b3e13f1893605ca78b52c68e54cf6a865f90b9fb" + integrity "sha1-s+E/GJNgXKeLUsaOVM9qhl+Qufs= sha512-JLBl+KZ0R5qB7mCnud/yyX08jWFw5MsoalJ1pQ4EdFlgj9VdXKGuENGsiCIjegI1W7p91rUlcB/LB5yRJKNTcQ==" + dependencies: + "@webassemblyjs/ast" "1.14.1" + "@webassemblyjs/helper-api-error" "1.13.2" + "@webassemblyjs/helper-wasm-bytecode" "1.13.2" + "@webassemblyjs/ieee754" "1.13.2" + "@webassemblyjs/leb128" "1.13.2" + "@webassemblyjs/utf8" "1.13.2" + +"@webassemblyjs/wast-printer@1.14.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-printer/-/wast-printer-1.14.1.tgz#3bb3e9638a8ae5fdaf9610e7a06b4d9f9aa6fe07" + integrity "sha1-O7PpY4qK5f2vlhDnoGtNn5qm/gc= sha512-kPSSXE6De1XOR820C90RIo2ogvZG+c3KiHzqUoO/F34Y2shGzesfqv7o57xrxovZJH/MetF5UjroJ/R/3isoiw==" + dependencies: + "@webassemblyjs/ast" "1.14.1" "@xtuc/long" "4.2.2" "@webpack-cli/configtest@^1.2.0": @@ -2982,11 +3004,6 @@ acorn-globals@^7.0.0: acorn "^8.1.0" acorn-walk "^8.0.2" -acorn-import-assertions@^1.7.6: - version "1.8.0" - resolved "https://registry.yarnpkg.com/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz#ba2b5939ce62c238db6d93d81c9b111b29b855e9" - integrity sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw== - acorn-jsx@^5.3.2: version "5.3.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" @@ -2997,7 +3014,7 @@ acorn-walk@^8.0.0, acorn-walk@^8.0.2, acorn-walk@^8.1.1: resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== -acorn@^8.0.4, acorn@^8.4.1, acorn@^8.5.0, acorn@^8.7.1, acorn@^8.8.0: +acorn@^8.0.4, acorn@^8.4.1, acorn@^8.8.0: version "8.8.2" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.2.tgz#1b2f25db02af965399b9776b0c2c391276d37c4a" integrity sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw== @@ -3007,6 +3024,11 @@ acorn@^8.1.0, acorn@^8.8.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.10.0.tgz#8be5b3907a67221a81ab23c7889c4c5526b62ec5" integrity sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw== +acorn@^8.14.0, acorn@^8.8.2: + version "8.14.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.14.0.tgz#063e2c70cac5fb4f6467f0b11152e04c682795b0" + integrity sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA== + add-stream@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/add-stream/-/add-stream-1.0.0.tgz#6a7990437ca736d5e1288db92bd3266d5f5cb2aa" @@ -3651,14 +3673,7 @@ braces@^2.3.1: split-string "^3.0.2" to-regex "^3.0.1" -braces@^3.0.2, braces@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" - integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== - dependencies: - fill-range "^7.0.1" - -braces@^3.0.3: +braces@^3.0.3, braces@~3.0.2: version "3.0.3" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789" integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== @@ -3697,7 +3712,7 @@ browserify-aes@^1.2.0: inherits "^2.0.1" safe-buffer "^5.0.1" -browserslist@^4.14.5, browserslist@^4.20.2, browserslist@^4.21.3: +browserslist@^4.20.2, browserslist@^4.21.3: version "4.21.3" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.3.tgz#5df277694eb3c48bc5c4b05af3e8b7e09c5a6d1a" integrity sha512-898rgRXLAyRkM1GryrrBHGkqA5hlpkV5MhtZwg9QXeiyLUYs2k00Un05aX5l2/yJIOObYKOpS2JNo8nJDE7fWQ== @@ -3707,6 +3722,16 @@ browserslist@^4.14.5, browserslist@^4.20.2, browserslist@^4.21.3: node-releases "^2.0.6" update-browserslist-db "^1.0.5" +browserslist@^4.24.0: + version "4.24.2" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.24.2.tgz#f5845bc91069dbd55ee89faf9822e1d885d16580" + integrity sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg== + dependencies: + caniuse-lite "^1.0.30001669" + electron-to-chromium "^1.5.41" + node-releases "^2.0.18" + update-browserslist-db "^1.1.1" + bs-logger@0.x: version "0.2.6" resolved "https://registry.yarnpkg.com/bs-logger/-/bs-logger-0.2.6.tgz#eb7d365307a72cf974cc6cda76b68354ad336bd8" @@ -3916,6 +3941,11 @@ caniuse-lite@^1.0.30001370: resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001378.tgz#3d2159bf5a8f9ca093275b0d3ecc717b00f27b67" integrity sha512-JVQnfoO7FK7WvU4ZkBRbPjaot4+YqxogSDosHv0Hv5mWpUESmN+UubMU6L/hGz8QlQ2aY5U0vR6MOs6j/CXpNA== +caniuse-lite@^1.0.30001669: + version "1.0.30001680" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001680.tgz#5380ede637a33b9f9f1fc6045ea99bd142f3da5e" + integrity "sha1-U4Dt5jejO5+fH8YEXqmb0ULz2l4= sha512-rPQy70G6AGUMnbwS1z6Xg+RkHYPAi18ihs47GH0jcxIG7wArmPgY3XbS2sRdBbxJljp3thdT8BIqv9ccCypiPA==" + case@^1.6.3: version "1.6.3" resolved "https://registry.yarnpkg.com/case/-/case-1.6.3.tgz#0a4386e3e9825351ca2e6216c60467ff5f1ea1c9" @@ -4692,9 +4722,9 @@ declaration-bundler-webpack-plugin@^1.0.3: integrity sha512-bgeoSOZYTOOdiNUZd/U8K6Z+6IrM/X+DgUcm3/VI1l130lzOBeL+ObetjIkKksxcj0zUJbLaFRFumFGYDOQ9fg== decode-uri-component@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" - integrity sha512-hjf+xovcEn31w/EUYdTXQh/8smFL/dzYjohQGEIgjyNavaJfBY2p5F527Bo1VPATxv0VYTUC2bOcXvqFwk78Og== + version "0.2.2" + resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.2.tgz#e69dbe25d37941171dd540e024c444cd5188e1e9" + integrity "sha1-5p2+JdN5QRcd1UDgJMREzVGI4ek= sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==" dedent@0.7.0, dedent@^0.7.0: version "0.7.0" @@ -4965,9 +4995,9 @@ ee-first@1.1.1: integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow== ejs@^3.1.7: - version "3.1.9" - resolved "https://registry.yarnpkg.com/ejs/-/ejs-3.1.9.tgz#03c9e8777fe12686a9effcef22303ca3d8eeb361" - integrity sha512-rC+QVNMJWv+MtPgkt0y+0rVEIdbtxVADApW9JXrUVlzHetgcyczP/E7DJmWJ4fJCZF2cPcBk0laWO9ZHMG3DmQ== + version "3.1.10" + resolved "https://registry.yarnpkg.com/ejs/-/ejs-3.1.10.tgz#69ab8358b14e896f80cc39e62087b88500c3ac3b" + integrity sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA== dependencies: jake "^10.8.5" @@ -4976,6 +5006,11 @@ electron-to-chromium@^1.4.202: resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.222.tgz#2ba24bef613fc1985dbffea85df8f62f2dec6448" integrity sha512-gEM2awN5HZknWdLbngk4uQCVfhucFAfFzuchP3wM3NN6eow1eDU0dFy2kts43FB20ZfhVFF0jmFSTb1h5OhyIg== +electron-to-chromium@^1.5.41: + version "1.5.58" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.58.tgz#d90bd7a04d9223dce4e72316e14492140ec9af40" + integrity "sha1-2QvXoE2SI9zk5yMW4USSFA7Jr0A= sha512-al2l4r+24ZFL7WzyPTlyD0fC33LLzvxqLCwurtBibVPghRGO9hSTl+tis8t1kD7biPiH/en4U0I7o/nQbYeoVA==" + elliptic@6.5.4, elliptic@^6.5.2, elliptic@^6.5.4: version "6.5.4" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" @@ -5043,7 +5078,7 @@ end-of-stream@^1.4.1: dependencies: once "^1.4.0" -enhanced-resolve@^5.0.0, enhanced-resolve@^5.10.0: +enhanced-resolve@^5.0.0: version "5.10.0" resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.10.0.tgz#0dc579c3bb2a1032e357ac45b8f3a6f3ad4fb1e6" integrity sha512-T0yTFjdpldGY8PmuXXR0PyQ1ufZpEGiHVrp7zHKB7jdR4qlmZHhONVM5AQOAWXuF/w3dnHbEQVrNptJgt7F+cQ== @@ -5059,6 +5094,14 @@ enhanced-resolve@^5.12.0: graceful-fs "^4.2.4" tapable "^2.2.0" +enhanced-resolve@^5.17.1: + version "5.17.1" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz#67bfbbcc2f81d511be77d686a90267ef7f898a15" + integrity sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg== + dependencies: + graceful-fs "^4.2.4" + tapable "^2.2.0" + enquirer@^2.3.0, enquirer@~2.3.6: version "2.3.6" resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" @@ -5146,10 +5189,10 @@ es-errors@^1.3.0: resolved "https://registry.yarnpkg.com/es-errors/-/es-errors-1.3.0.tgz#05f75a25dab98e4fb1dcd5e1472c0546d5057c8f" integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw== -es-module-lexer@^0.9.0: - version "0.9.3" - resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-0.9.3.tgz#6f13db00cc38417137daf74366f535c8eb438f19" - integrity sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ== +es-module-lexer@^1.2.1: + version "1.5.4" + resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-1.5.4.tgz#a8efec3a3da991e60efa6b633a7cad6ab8d26b78" + integrity sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw== es-shim-unscopables@^1.0.0: version "1.0.0" @@ -5177,6 +5220,11 @@ escalade@^3.1.1: resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== +escalade@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.2.0.tgz#011a3f69856ba189dffa7dc8fcce99d2a87903e5" + integrity sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA== + escape-html@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" @@ -6114,13 +6162,6 @@ fill-range@^4.0.0: repeat-string "^1.6.1" to-regex-range "^2.1.0" -fill-range@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" - integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== - dependencies: - to-regex-range "^5.0.1" - fill-range@^7.1.1: version "7.1.1" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292" @@ -6188,9 +6229,9 @@ flatted@^3.3.1: integrity sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw== follow-redirects@^1.0.0, follow-redirects@^1.12.1: - version "1.15.1" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.1.tgz#0ca6a452306c9b276e4d3127483e29575e207ad5" - integrity sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA== + version "1.15.9" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.9.tgz#a604fa10e443bf98ca94228d9eebcc2e8a2c8ee1" + integrity sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ== follow-redirects@^1.15.6: version "1.15.6" @@ -6743,6 +6784,11 @@ graceful-fs@4.2.10, graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2 resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== +graceful-fs@^4.2.11: + version "4.2.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" + integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== + grapheme-splitter@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e" @@ -7019,12 +7065,7 @@ http-browserify@^1.7.0: Base64 "~0.2.0" inherits "~2.0.1" -http-cache-semantics@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz#49e91c5cbf36c9b94bcfcd71c23d5249ec74e390" - integrity sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ== - -http-cache-semantics@^4.1.1: +http-cache-semantics@^4.1.0, http-cache-semantics@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz#abe02fcb2985460bf0323be664436ec3476a6d5a" integrity sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ== @@ -8465,9 +8506,9 @@ json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== json5@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" - integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow== + version "1.0.2" + resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.2.tgz#63d98d60f21b313b77c4d6da18bfa69d80e1d593" + integrity sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA== dependencies: minimist "^1.2.0" @@ -9180,15 +9221,7 @@ micromatch@^3.1.10: snapdragon "^0.8.1" to-regex "^3.0.2" -micromatch@^4.0.0, micromatch@^4.0.2, micromatch@^4.0.4: - version "4.0.5" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" - integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== - dependencies: - braces "^3.0.2" - picomatch "^2.3.1" - -micromatch@~4.0.7: +micromatch@^4.0.0, micromatch@^4.0.2, micromatch@^4.0.4, micromatch@~4.0.7: version "4.0.8" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.8.tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202" integrity sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA== @@ -9607,6 +9640,11 @@ node-int64@^0.4.0: resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== +node-releases@^2.0.18: + version "2.0.18" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.18.tgz#f010e8d35e2fe8d6b2944f03f70213ecedc4ca3f" + integrity sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g== + node-releases@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.6.tgz#8a7088c63a55e493845683ebf3c828d8c51c5503" @@ -10442,6 +10480,11 @@ picocolors@^1.0.0: resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== +picocolors@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b" + integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA== + picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3, picomatch@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" @@ -11234,7 +11277,7 @@ saxes@^6.0.0: dependencies: xmlchars "^2.2.0" -schema-utils@^3.1.0, schema-utils@^3.1.1: +schema-utils@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-3.1.1.tgz#bc74c4b6b6995c1d88f76a8b77bea7219e0c8281" integrity sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw== @@ -11243,6 +11286,15 @@ schema-utils@^3.1.0, schema-utils@^3.1.1: ajv "^6.12.5" ajv-keywords "^3.5.2" +schema-utils@^3.2.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-3.3.0.tgz#f50a88877c3c01652a15b622ae9e9795df7a60fe" + integrity sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg== + dependencies: + "@types/json-schema" "^7.0.8" + ajv "^6.12.5" + ajv-keywords "^3.5.2" + scrypt-js@3.0.1, scrypt-js@^3.0.0, scrypt-js@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-3.0.1.tgz#d314a57c2aef69d1ad98a138a21fe9eafa9ee312" @@ -11287,9 +11339,9 @@ semver@7.3.8: lru-cache "^6.0.0" semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" - integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== + version "6.3.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" + integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== semver@^7.0.0, semver@^7.1.1, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7: version "7.3.7" @@ -11355,13 +11407,20 @@ send@0.19.0: range-parser "~1.2.1" statuses "2.0.1" -serialize-javascript@6.0.0, serialize-javascript@^6.0.0: +serialize-javascript@6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" integrity sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag== dependencies: randombytes "^2.1.0" +serialize-javascript@^6.0.1: + version "6.0.2" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.2.tgz#defa1e055c83bf6d59ea805d8da862254eb6a6c2" + integrity sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g== + dependencies: + randombytes "^2.1.0" + serve-static@1.16.0: version "1.16.0" resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.16.0.tgz#2bf4ed49f8af311b519c46f272bf6ac3baf38a92" @@ -11823,7 +11882,7 @@ string-length@^4.0.1: char-regex "^1.0.2" strip-ansi "^6.0.0" -"string-width-cjs@npm:string-width@^4.2.0": +"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -11841,15 +11900,6 @@ string-width@^1.0.1: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - string-width@^5.0.1, string-width@^5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" @@ -11905,7 +11955,7 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -11919,13 +11969,6 @@ strip-ansi@^3.0.0, strip-ansi@^3.0.1: dependencies: ansi-regex "^2.0.0" -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - strip-ansi@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.0.1.tgz#61740a08ce36b61e50e65653f07060d000975fb2" @@ -12043,7 +12086,7 @@ tar-stream@~2.2.0: inherits "^2.0.3" readable-stream "^3.1.1" -tar@6.1.11, tar@^6.1.11, tar@^6.1.2: +tar@6.1.11: version "6.1.11" resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.11.tgz#6760a38f003afa1b2ffd0ffe9e9abbd0eab3d621" integrity sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA== @@ -12055,6 +12098,18 @@ tar@6.1.11, tar@^6.1.11, tar@^6.1.2: mkdirp "^1.0.3" yallist "^4.0.0" +tar@^6.1.11, tar@^6.1.2: + version "6.2.1" + resolved "https://registry.yarnpkg.com/tar/-/tar-6.2.1.tgz#717549c541bc3c2af15751bea94b1dd068d4b03a" + integrity "sha1-cXVJxUG8PCrxV1G+qUsd0GjUsDo= sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==" + dependencies: + chownr "^2.0.0" + fs-minipass "^2.0.0" + minipass "^5.0.0" + minizlib "^2.1.1" + mkdirp "^1.0.3" + yallist "^4.0.0" + temp-dir@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/temp-dir/-/temp-dir-1.0.0.tgz#0a7c0ea26d3a39afa7e0ebea9c1fc0bc4daa011d" @@ -12076,24 +12131,24 @@ tempy@1.0.0: type-fest "^0.16.0" unique-string "^2.0.0" -terser-webpack-plugin@^5.1.3: - version "5.3.5" - resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.5.tgz#f7d82286031f915a4f8fb81af4bd35d2e3c011bc" - integrity sha512-AOEDLDxD2zylUGf/wxHxklEkOe2/r+seuyOWujejFrIxHf11brA1/dWQNIgXa1c6/Wkxgu7zvv0JhOWfc2ELEA== +terser-webpack-plugin@^5.3.10: + version "5.3.10" + resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.10.tgz#904f4c9193c6fd2a03f693a2150c62a92f40d199" + integrity sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w== dependencies: - "@jridgewell/trace-mapping" "^0.3.14" + "@jridgewell/trace-mapping" "^0.3.20" jest-worker "^27.4.5" schema-utils "^3.1.1" - serialize-javascript "^6.0.0" - terser "^5.14.1" + serialize-javascript "^6.0.1" + terser "^5.26.0" -terser@^5.14.1: - version "5.14.2" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.14.2.tgz#9ac9f22b06994d736174f4091aa368db896f1c10" - integrity sha512-oL0rGeM/WFQCUd0y2QrWxYnq7tfSuKBiqTjRPWrRgB46WD/kiwHwF8T23z78H6Q6kGCuuHcPB+KULHRdxvVGQA== +terser@^5.26.0: + version "5.36.0" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.36.0.tgz#8b0dbed459ac40ff7b4c9fd5a3a2029de105180e" + integrity sha512-IYV9eNMuFAV4THUspIRXkLakHnV6XO7FEdtKjf/mDyrnqUg9LnlOn6/RwRvM9SZjR4GUq8Nk8zj67FzVARr74w== dependencies: - "@jridgewell/source-map" "^0.3.2" - acorn "^8.5.0" + "@jridgewell/source-map" "^0.3.3" + acorn "^8.8.2" commander "^2.20.0" source-map-support "~0.5.20" @@ -12607,6 +12662,14 @@ update-browserslist-db@^1.0.5: escalade "^3.1.1" picocolors "^1.0.0" +update-browserslist-db@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.1.1.tgz#80846fba1d79e82547fb661f8d141e0945755fe5" + integrity sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A== + dependencies: + escalade "^3.2.0" + picocolors "^1.1.0" + uri-js@^4.2.2: version "4.4.1" resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" @@ -12785,10 +12848,10 @@ walker@^1.0.8: dependencies: makeerror "1.0.12" -watchpack@^2.4.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.4.0.tgz#fa33032374962c78113f93c7f2fb4c54c9862a5d" - integrity sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg== +watchpack@^2.4.1: + version "2.4.2" + resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.4.2.tgz#2feeaed67412e7c33184e5a79ca738fbd38564da" + integrity sha512-TnbFSbcOCcDgjZ4piURLCbJ3nJhznVh9kw6F6iokjiFPl8ONxe9A6nMDVXDiNbrSfLILs6vB07F7wLBrwPYzJw== dependencies: glob-to-regexp "^0.4.1" graceful-fs "^4.1.2" @@ -12893,33 +12956,32 @@ webpack-sources@^3.2.3: integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w== webpack@^5, webpack@^5.73.0: - version "5.76.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.76.0.tgz#f9fb9fb8c4a7dbdcd0d56a98e56b8a942ee2692c" - integrity sha512-l5sOdYBDunyf72HW8dF23rFtWq/7Zgvt/9ftMof71E/yUb1YLOBmTgA2K4vQthB3kotMrSj609txVE0dnr2fjA== - dependencies: - "@types/eslint-scope" "^3.7.3" - "@types/estree" "^0.0.51" - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/wasm-edit" "1.11.1" - "@webassemblyjs/wasm-parser" "1.11.1" - acorn "^8.7.1" - acorn-import-assertions "^1.7.6" - browserslist "^4.14.5" + version "5.96.1" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.96.1.tgz#3676d1626d8312b6b10d0c18cc049fba7ac01f0c" + integrity "sha1-NnbRYm2DEraxDQwYzASfunrAHww= sha512-l2LlBSvVZGhL4ZrPwyr8+37AunkcYj5qh8o6u2/2rzoPc8gxFJkLj1WxNgooi9pnoc06jh0BjuXnamM4qlujZA==" + dependencies: + "@types/eslint-scope" "^3.7.7" + "@types/estree" "^1.0.6" + "@webassemblyjs/ast" "^1.12.1" + "@webassemblyjs/wasm-edit" "^1.12.1" + "@webassemblyjs/wasm-parser" "^1.12.1" + acorn "^8.14.0" + browserslist "^4.24.0" chrome-trace-event "^1.0.2" - enhanced-resolve "^5.10.0" - es-module-lexer "^0.9.0" + enhanced-resolve "^5.17.1" + es-module-lexer "^1.2.1" eslint-scope "5.1.1" events "^3.2.0" glob-to-regexp "^0.4.1" - graceful-fs "^4.2.9" + graceful-fs "^4.2.11" json-parse-even-better-errors "^2.3.1" loader-runner "^4.2.0" mime-types "^2.1.27" neo-async "^2.6.2" - schema-utils "^3.1.0" + schema-utils "^3.2.0" tapable "^2.1.1" - terser-webpack-plugin "^5.1.3" - watchpack "^2.4.0" + terser-webpack-plugin "^5.3.10" + watchpack "^2.4.1" webpack-sources "^3.2.3" whatwg-encoding@^2.0.0: @@ -13019,16 +13081,7 @@ workerpool@6.2.1: resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343" integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - -wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== From 5eeb2d6188469f2ad4f5377b37ef5d3f92017bdc Mon Sep 17 00:00:00 2001 From: whitemoshui <139415706+whitemoshui@users.noreply.github.com> Date: Tue, 19 Nov 2024 17:50:33 +0800 Subject: [PATCH 12/21] chore: fix 0 kwei bug (#7387) --- CHANGELOG.md | 4 ++++ packages/web3-utils/CHANGELOG.md | 4 ++++ packages/web3-utils/src/converters.ts | 2 +- packages/web3-utils/test/fixtures/converters.ts | 3 +++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c97c573755..7ea32551380 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2809,3 +2809,7 @@ If there are any bugs, improvements, optimizations or any new feature proposal f #### web3 - Export Web3Account, Wallet and signature related types. (#7374) + +#### web3-utils + +- Make `fromWei` return "0" when input is `0` (#7387) diff --git a/packages/web3-utils/CHANGELOG.md b/packages/web3-utils/CHANGELOG.md index 940059963d8..b698fcf51ba 100644 --- a/packages/web3-utils/CHANGELOG.md +++ b/packages/web3-utils/CHANGELOG.md @@ -241,3 +241,7 @@ Documentation: - fix `padRight` validation failure on large `uint` (#7265) ## [Unreleased] + +### Fixed + +- Make `fromWei` return "0" when input is `0` (#7387) diff --git a/packages/web3-utils/src/converters.ts b/packages/web3-utils/src/converters.ts index 9c94a4332b0..dce6ce78871 100644 --- a/packages/web3-utils/src/converters.ts +++ b/packages/web3-utils/src/converters.ts @@ -546,7 +546,7 @@ export const fromWei = (number: Numbers, unit: EtherUnits | number): string => { const fraction = zeroPaddedValue.slice(-numberOfZerosInDenomination).replace(/\.?0+$/, ''); if (integer === '') { - return `0.${fraction}`; + return fraction ? `0.${fraction}` : '0'; } if (fraction === '') { diff --git a/packages/web3-utils/test/fixtures/converters.ts b/packages/web3-utils/test/fixtures/converters.ts index cecb0b3fafb..025f9f7a987 100644 --- a/packages/web3-utils/test/fixtures/converters.ts +++ b/packages/web3-utils/test/fixtures/converters.ts @@ -328,6 +328,9 @@ export const fromWeiValidData: [[Numbers, EtherUnits | number], Numbers][] = [ [['1123', 'kwei'], '1.123'], [['1234100', 'kwei'], '1234.1'], [['3308685546611893', 'ether'], '0.003308685546611893'], + [['0', 'wei'], '0'], + [['0', 'kwei'], '0'], + [['0', 'ether'], '0'], ]; export const toWeiValidData: [[Numbers, EtherUnits | number], Numbers][] = [ From e79ace2900e19a089a04ae47727125e68da46501 Mon Sep 17 00:00:00 2001 From: Muhammad Altabba <24407834+Muhammad-Altabba@users.noreply.github.com> Date: Tue, 19 Nov 2024 11:06:22 +0100 Subject: [PATCH 13/21] fix: upgrade docusaurus-lunr-search from 3.4.0 to 3.5.0 (#7396) --- docs/package.json | 2 +- docs/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/package.json b/docs/package.json index f8b1958d25f..620dcb1938a 100644 --- a/docs/package.json +++ b/docs/package.json @@ -22,7 +22,7 @@ "@mdx-js/react": "^3.0.0", "classnames": "^2.3.2", "clsx": "^2.0.0", - "docusaurus-lunr-search": "^3.3.1", + "docusaurus-lunr-search": "^3.5.0", "prism-react-renderer": "^2.4.0", "react": "^18.2.0", "react-dom": "^18.2.0" diff --git a/docs/yarn.lock b/docs/yarn.lock index dc1815d39a5..be41e52be84 100644 --- a/docs/yarn.lock +++ b/docs/yarn.lock @@ -5106,10 +5106,10 @@ dns-packet@^5.2.2: dependencies: "@leichtgewicht/ip-codec" "^2.0.1" -docusaurus-lunr-search@^3.3.1: - version "3.4.0" - resolved "https://registry.yarnpkg.com/docusaurus-lunr-search/-/docusaurus-lunr-search-3.4.0.tgz#cefb0f8628f629e780451ae042d3cc35f078826f" - integrity sha512-GfllnNXCLgTSPH9TAKWmbn8VMfwpdOAZ1xl3T2GgX8Pm26qSDLfrrdVwjguaLfMJfzciFL97RKrAJlgrFM48yw== +docusaurus-lunr-search@^3.5.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/docusaurus-lunr-search/-/docusaurus-lunr-search-3.5.0.tgz#52832d7bdd858ed093e98a743ee7bd4df596cfbf" + integrity sha512-k3zN4jYMi/prWInJILGKOxE+BVcgYinwj9+gcECsYm52tS+4ZKzXQzbPnVJAEXmvKOfFMcDFvS3MSmm6cEaxIQ== dependencies: autocomplete.js "^0.37.0" clsx "^1.2.1" From 079c558bd20a1bb2269b6b929c4d5872fcdfddc6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Nov 2024 11:25:47 +0100 Subject: [PATCH 14/21] Bump cross-spawn from 7.0.3 to 7.0.6 in /docs (#7399) --- docs/yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/yarn.lock b/docs/yarn.lock index be41e52be84..1809f741bb4 100644 --- a/docs/yarn.lock +++ b/docs/yarn.lock @@ -4679,9 +4679,9 @@ cosmiconfig@^8.0.0, cosmiconfig@^8.1.3, cosmiconfig@^8.3.5: path-type "^4.0.0" cross-spawn@^7.0.0, cross-spawn@^7.0.3: - version "7.0.3" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" - integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== + version "7.0.6" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f" + integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA== dependencies: path-key "^3.1.0" shebang-command "^2.0.0" From 5437fbc90395bfe4b15d14d8eed37e2f70a4e4b8 Mon Sep 17 00:00:00 2001 From: Muhammad Altabba <24407834+Muhammad-Altabba@users.noreply.github.com> Date: Tue, 19 Nov 2024 11:29:56 +0100 Subject: [PATCH 15/21] fix: upgrade @mdx-js/react from 3.0.1 to 3.1.0 (#7395) --- docs/package.json | 2 +- docs/yarn.lock | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/package.json b/docs/package.json index 620dcb1938a..5f7dff66c8a 100644 --- a/docs/package.json +++ b/docs/package.json @@ -19,7 +19,7 @@ "@docusaurus/core": "^3.5.2", "@docusaurus/preset-classic": "^3.5.2", "@docusaurus/theme-live-codeblock": "^3.5.2", - "@mdx-js/react": "^3.0.0", + "@mdx-js/react": "^3.1.0", "classnames": "^2.3.2", "clsx": "^2.0.0", "docusaurus-lunr-search": "^3.5.0", diff --git a/docs/yarn.lock b/docs/yarn.lock index 1809f741bb4..79d5fb6d6f5 100644 --- a/docs/yarn.lock +++ b/docs/yarn.lock @@ -2083,6 +2083,13 @@ dependencies: "@types/mdx" "^2.0.0" +"@mdx-js/react@^3.1.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@mdx-js/react/-/react-3.1.0.tgz#c4522e335b3897b9a845db1dbdd2f966ae8fb0ed" + integrity sha512-QjHtSaoameoalGnKDT3FoIl4+9RwyTmo9ZJGBdLOks/YOiWHoRDI3PUwEzOE7kEmGcV3AFcp9K6dYu9rEuKLAQ== + dependencies: + "@types/mdx" "^2.0.0" + "@messageformat/parser@^5.0.0": version "5.1.0" resolved "https://registry.yarnpkg.com/@messageformat/parser/-/parser-5.1.0.tgz#05e4851c782d633ad735791dd0a68ee65d2a7201" From 6379aa8afaf22b497c0d960f1a8462bcb1aeff91 Mon Sep 17 00:00:00 2001 From: Kris <605420+krzysu@users.noreply.github.com> Date: Tue, 19 Nov 2024 16:13:59 +0100 Subject: [PATCH 16/21] fix: remove force exit from blackbox tests (#7397) --- packages/web3/test/cjs_black_box/package.json | 4 ++-- packages/web3/test/esm_black_box/package.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/web3/test/cjs_black_box/package.json b/packages/web3/test/cjs_black_box/package.json index e5041d08c1d..a0fcd9a4d7b 100644 --- a/packages/web3/test/cjs_black_box/package.json +++ b/packages/web3/test/cjs_black_box/package.json @@ -7,9 +7,9 @@ "type": "commonjs", "scripts": { "test:geth:http": "WEB3_SYSTEM_TEST_BACKEND=geth WEB3_SYSTEM_TEST_PROVIDER=http://localhost:8545 jest", - "test:geth:ws": "WEB3_SYSTEM_TEST_BACKEND=geth WEB3_SYSTEM_TEST_PROVIDER=ws://localhost:8545 jest --forceExit", + "test:geth:ws": "WEB3_SYSTEM_TEST_BACKEND=geth WEB3_SYSTEM_TEST_PROVIDER=ws://localhost:8545 jest", "test:infura:http": "WEB3_SYSTEM_TEST_BACKEND=infura jest", - "test:infura:ws": "WEB3_SYSTEM_TEST_BACKEND=infura jest --forceExit" + "test:infura:ws": "WEB3_SYSTEM_TEST_BACKEND=infura jest" }, "dependencies": { "web3": "5.0.0" diff --git a/packages/web3/test/esm_black_box/package.json b/packages/web3/test/esm_black_box/package.json index 252793ca6cc..095ac51eb27 100644 --- a/packages/web3/test/esm_black_box/package.json +++ b/packages/web3/test/esm_black_box/package.json @@ -8,9 +8,9 @@ "scripts": { "test:hardhat:http": "WEB3_SYSTEM_TEST_BACKEND=hardhat WEB3_SYSTEM_TEST_PROVIDER=http://localhost:8545 jest", "test:geth:http": "WEB3_SYSTEM_TEST_BACKEND=geth WEB3_SYSTEM_TEST_PROVIDER=http://localhost:8545 jest", - "test:geth:ws": "WEB3_SYSTEM_TEST_BACKEND=geth WEB3_SYSTEM_TEST_PROVIDER=ws://localhost:8545 jest --forceExit", + "test:geth:ws": "WEB3_SYSTEM_TEST_BACKEND=geth WEB3_SYSTEM_TEST_PROVIDER=ws://localhost:8545 jest", "test:infura:http": "WEB3_SYSTEM_TEST_BACKEND=infura jest", - "test:infura:ws": "WEB3_SYSTEM_TEST_BACKEND=infura jest --forceExit" + "test:infura:ws": "WEB3_SYSTEM_TEST_BACKEND=infura jest" }, "dependencies": { "web3": "5.0.0" From 56d4aec22972320bb1a4ac2ce2a9cb88a569a12a Mon Sep 17 00:00:00 2001 From: Dan Forbes Date: Tue, 19 Nov 2024 07:27:24 -0800 Subject: [PATCH 17/21] Replaces #7390, #7391, & #7400 (#7401) --- RELEASE.md | 17 +++++----- docs/docs/glossary/index.md | 2 +- .../events_listening.md | 2 +- .../05_smart_contracts/tips_and_tricks.md | 4 +-- .../guides/06_events_subscriptions/index.md | 34 +++++++++---------- 5 files changed, 30 insertions(+), 29 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index 5e2182e995f..1fdcfc3de47 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -36,8 +36,8 @@ Further details about versioning can be found in the [semver 2.0.0 specification - `bumped-version` of release branch should be of main web3 package. 3. `yarn`: Verify all dependencies have been installed 4. Bump packages version numbers using `lerna version --no-push --no-private --no-git-tag-version` . This will update package versions and also run lifecycle scripts. - - It will prompt for new version , modify package metadata and run life cycle scripts (in our case `version`), for bootstrapping lerna will use underlying yarn. -5. Update each package's and also root `CHANGELOG.md`: + - It will prompt for new version , modify package metadata and run lifecycle scripts (in our case `version`), for bootstrapping lerna will use underlying yarn. +5. Update each package's and also root `CHANGELOG.md`: 5.A. If there are any changes in package during release PR e.g. dependency updated that effects package, add entry in changelog under `## [Unreleased]` of that package's changelog. @@ -61,19 +61,20 @@ Further details about versioning can be found in the [semver 2.0.0 specification - In the release description, copy all entries in `CHANGELOG.md` for the version being released - Click `Save draft` - + 12. Open pull request to merge branch created in `Step 2` (`release/bumped-version`) into `4.x` 13. Wait for all tests to pass in github CI/CD , If there are any unusual warnings or errors in logs, discuss with team 14. When sufficient approvals have been met, publish draft release created in `Step 11` 15. Publish on NPM. + - login in NPM and verify you are logged in with right user and in right dir - + - If you want to publish `latest` tag release, run `npx lerna publish from-package --ignore-scripts` in the root directory to publish packages to NPM. - - - If you want to publish any other tag, run `npx lerna publish from-package --ignore-scripts --dist-tag <>` in the root directory e.g. `rc` - + + - If you want to publish any other tag, run `npx lerna publish from-package --ignore-scripts --dist-tag <>` in the root directory e.g. `rc` + IMPORTANT: Replace `<>` with required tag in above command, e.g. if publishing `RC`, use following command: - `npx lerna publish from-package --ignore-scripts --dist-tag rc` + `npx lerna publish from-package --ignore-scripts --dist-tag rc` - lerna will not invoke life cycle scripts before publishing and this will publish all packages to NPM public registry. diff --git a/docs/docs/glossary/index.md b/docs/docs/glossary/index.md index 7af367af75b..4f67ceaa4f6 100644 --- a/docs/docs/glossary/index.md +++ b/docs/docs/glossary/index.md @@ -24,7 +24,7 @@ The `Contract` class is an important class in the `web3-eth-contract` package, a The JSON interface is a `JSON` object describing the [Application Binary Interface (ABI)](https://docs.soliditylang.org/en/develop/abi-spec.html) for an Ethereum smart contract. -Using this JSON interface, web3.js is able to create a JavaScript object representing the smart contract , its methods and events using the `web3.eth.Contract` object. +Using this JSON interface, web3.js is able to create a JavaScript object representing the smart contract, its methods and events using the `web3.eth.Contract` object. ### Functions diff --git a/docs/docs/guides/02_web3_providers_guide/events_listening.md b/docs/docs/guides/02_web3_providers_guide/events_listening.md index ae0b809d4a5..9b84fa7dcac 100644 --- a/docs/docs/guides/02_web3_providers_guide/events_listening.md +++ b/docs/docs/guides/02_web3_providers_guide/events_listening.md @@ -5,7 +5,7 @@ sidebar_label: 'Providers Events Listening' # Providers Events Listening -Some providers are, by design, always connected. Therefor, they can communicate changes with the user through events. Actually, among the 3 providers, `HttpProvider` is the only one that does not support event. And the other 2: +Some providers are, by design, always connected. Therefore, they can communicate changes with the user through events. Actually, among the 3 providers, `HttpProvider` is the only one that does not support event. And the other 2: [WebSocketProvider](/api/web3-providers-ws/class/WebSocketProvider) and [IpcProvider](/api/web3-providers-ipc/class/IpcProvider) enable the user to listen to emitted events. Actually, the events can be categorized as follows ([according to EIP 1193](https://eips.ethereum.org/EIPS/eip-1193#rationale)): diff --git a/docs/docs/guides/05_smart_contracts/tips_and_tricks.md b/docs/docs/guides/05_smart_contracts/tips_and_tricks.md index 35964550ca5..911dccaa5f0 100644 --- a/docs/docs/guides/05_smart_contracts/tips_and_tricks.md +++ b/docs/docs/guides/05_smart_contracts/tips_and_tricks.md @@ -39,7 +39,7 @@ The Solidity code: pragma solidity >=0.8.20 <0.9.0; -contract TestOverlading { +contract TestOverloading { function funcWithParamsOverloading(uint256 userId) public pure returns (string memory) { return "called for the parameter with the type 'uint256'"; } @@ -138,6 +138,6 @@ Multiple methods found that are compatible with the given inputs. Found 2 compat Future releases of web3.js, specifically version 5.x, will replace the warning with an error whenever multiple methods match a call without explicit overloading. This aims to foster greater precision in method invocation. -### Key Takeaway for function overlading: Method Specification +### Key Takeaway for function overloading: Method Specification When working with overloaded smart contract methods, it's imperative to specify the intended method by appending its parameter types within parentheses, such as `funcWithParamsOverloading(address)` versus `funcWithParamsOverloading(uint256)`. This ensures the accuracy of method invocation, leading to more efficient and clearer contract interactions. diff --git a/docs/docs/guides/06_events_subscriptions/index.md b/docs/docs/guides/06_events_subscriptions/index.md index 80a1457874d..4ecaaafed52 100644 --- a/docs/docs/guides/06_events_subscriptions/index.md +++ b/docs/docs/guides/06_events_subscriptions/index.md @@ -1,6 +1,6 @@ --- sidebar_position: 1 -sidebar_label: 'Mastering Events Subcriptions' +sidebar_label: 'Mastering Events Subscriptions' --- # Events Subscription @@ -46,25 +46,25 @@ If you are the developer who provides custom subscriptions to users. We encourag - `on("data")` - Fires on each incoming log with the log object as argument. ```ts -subcription.on('data', data => console.log(data)); +subscription.on('data', data => console.log(data)); ``` - `on("changed")` - Fires on each log which was removed from the blockchain. The log will have the additional property "removed: true". ```ts -subcription.on('changed', changed => console.log(changed)); +subscription.on('changed', changed => console.log(changed)); ``` - `on("error")` - Fires when an error in the subscription occurs. ```ts -subcription.on('error', error => console.log(error)); +subscription.on('error', error => console.log(error)); ``` - `on("connected")` - Fires once after the subscription successfully connected. Returns the subscription id. ```ts -subcription.on('connected', connected => console.log(connected)); +subscription.on('connected', connected => console.log(connected)); ``` ### Logs @@ -77,11 +77,11 @@ import { Web3 } from 'web3'; const web3 = new Web3('wss://ethereum-rpc.publicnode.com'); async function subscribe() { - //create subcription - const subcription = await web3.eth.subscribe('logs'); + //create subscription + const subscription = await web3.eth.subscribe('logs'); //print logs of the latest mined block - subcription.on('data', data => console.log(data)); + subscription.on('data', data => console.log(data)); } // function to unsubscribe from a subscription @@ -104,11 +104,11 @@ import { Web3 } from 'web3'; const web3 = new Web3('wss://ethereum-rpc.publicnode.com'); async function subscribe() { - //create subcription - const subcription = await web3.eth.subscribe('pendingTransactions'); //or ("newPendingTransactions") + //create subscription + const subscription = await web3.eth.subscribe('pendingTransactions'); //or ("newPendingTransactions") //print tx hashs of pending transactions - subcription.on('data', data => console.log(data)); + subscription.on('data', data => console.log(data)); } // function to unsubscribe from a subscription @@ -131,11 +131,11 @@ import { Web3 } from 'web3'; const web3 = new Web3('wss://ethereum-rpc.publicnode.com'); async function subscribe() { - //create subcription - const subcription = await web3.eth.subscribe('newBlockHeaders'); //or ("newHeads") + //create subscription + const subscription = await web3.eth.subscribe('newBlockHeaders'); //or ("newHeads") //print block header everytime a block is mined - subcription.on('data', data => console.log(data)); + subscription.on('data', data => console.log(data)); } // function to unsubscribe from a subscription @@ -157,12 +157,12 @@ import { Web3 } from 'web3'; const web3 = new Web3('wss://ethereum-rpc.publicnode.com'); async function subscribe() { - //create subcription - const subcription = await web3.eth.subscribe('syncing'); + //create subscription + const subscription = await web3.eth.subscribe('syncing'); //this will return `true` when the node is syncing //when it’s finished syncing will return `false`, for the `changed` event. - subcription.on('data', data => console.log(data)); + subscription.on('data', data => console.log(data)); } // function to unsubscribe from a subscription From 3b122a214a4c16225bbce37c493449fc6d536da1 Mon Sep 17 00:00:00 2001 From: Oleksii Kosynskyi Date: Fri, 22 Nov 2024 03:59:36 +0700 Subject: [PATCH 18/21] fix: upgrade @cookbookdev/docsbot from 4.24.0 to 4.24.4 (#7403) --- docs/package.json | 2 +- docs/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/package.json b/docs/package.json index 5f7dff66c8a..78b14ce26a8 100644 --- a/docs/package.json +++ b/docs/package.json @@ -15,7 +15,7 @@ "typecheck": "tsc" }, "dependencies": { - "@cookbookdev/docsbot": "^4.21.23", + "@cookbookdev/docsbot": "^4.24.4", "@docusaurus/core": "^3.5.2", "@docusaurus/preset-classic": "^3.5.2", "@docusaurus/theme-live-codeblock": "^3.5.2", diff --git a/docs/yarn.lock b/docs/yarn.lock index 79d5fb6d6f5..af39624b139 100644 --- a/docs/yarn.lock +++ b/docs/yarn.lock @@ -1271,10 +1271,10 @@ resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9" integrity sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ== -"@cookbookdev/docsbot@^4.21.23": - version "4.24.0" - resolved "https://registry.yarnpkg.com/@cookbookdev/docsbot/-/docsbot-4.24.0.tgz#3537bd6e6c5e48152b6f15fa956fb2cb7caab4ec" - integrity sha512-8v62HNLzAKPVu1NjSI/o0bkR67GCz5WSlNXCOvBs4jJktny4s+XvrfXgG9wo/m8UyKuPky63skAWaKTE3I+M6g== +"@cookbookdev/docsbot@^4.24.4": + version "4.24.7" + resolved "https://registry.yarnpkg.com/@cookbookdev/docsbot/-/docsbot-4.24.7.tgz#98288b5018e068b1b41a3913fc09c2e48447418c" + integrity sha512-XqEaIBX3iFRQoM5dNm06UVYnBZ19BiV2mw3DWj4RcHtViGuOtRw943/Ab6IJc9cN+tJqE5OV9vb6OQUSttVmiw== dependencies: "@cookbookdev/sonner" "1.5.1" "@headlessui/react" "^1.7.18" From 984cb7cc3649f5aaca498921f4a40f20efde7c08 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 22 Nov 2024 12:22:18 +0100 Subject: [PATCH 19/21] chore(deps): bump cross-spawn from 7.0.3 to 7.0.6 (#7404) --- yarn.lock | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/yarn.lock b/yarn.lock index a6973e86251..23b071c7071 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4587,9 +4587,9 @@ cross-fetch@^4.0.0: node-fetch "^2.6.12" cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3: - version "7.0.3" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" - integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== + version "7.0.6" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f" + integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA== dependencies: path-key "^3.1.0" shebang-command "^2.0.0" @@ -11882,7 +11882,7 @@ string-length@^4.0.1: char-regex "^1.0.2" strip-ansi "^6.0.0" -"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0": version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -11900,6 +11900,15 @@ string-width@^1.0.1: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" +"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + string-width@^5.0.1, string-width@^5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" @@ -11955,7 +11964,7 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -11969,6 +11978,13 @@ strip-ansi@^3.0.0, strip-ansi@^3.0.1: dependencies: ansi-regex "^2.0.0" +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + strip-ansi@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.0.1.tgz#61740a08ce36b61e50e65653f07060d000975fb2" @@ -13081,7 +13097,16 @@ workerpool@6.2.1: resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343" integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== From 7a8df69b8aca8718d4e862955a12c6944a701f6b Mon Sep 17 00:00:00 2001 From: Muhammad Altabba <24407834+Muhammad-Altabba@users.noreply.github.com> Date: Mon, 25 Nov 2024 07:42:57 +0100 Subject: [PATCH 20/21] update typescript version to 5 (#7272) * upgrade typescript to v5 * fix some issues detected by typescript v5 * fix lint issues after the typescript version upgrade --- .gitignore | 3 +- fixtures/utils.ts | 1 + package.json | 2 +- .../web3-account-abstraction/package.json | 2 +- packages/web3-core/package.json | 2 +- .../src/web3_subscription_manager.ts | 1 + .../test/unit/web3_promi_event.test.ts | 2 +- packages/web3-errors/package.json | 2 +- .../web3-errors/src/errors/contract_errors.ts | 1 + packages/web3-eth-abi/package.json | 2 +- packages/web3-eth-abi/src/coders/encode.ts | 2 +- packages/web3-eth-abi/src/utils.ts | 1 + packages/web3-eth-accounts/package.json | 2 +- .../web3-eth-accounts/src/common/common.ts | 13 ++++---- .../web3-eth-accounts/src/common/utils.ts | 11 ++++--- .../src/tx/baseTransaction.ts | 14 ++++---- .../src/tx/eip1559Transaction.ts | 7 ++-- .../src/tx/eip2930Transaction.ts | 7 ++-- .../src/tx/legacyTransaction.ts | 2 +- .../src/tx/transactionFactory.ts | 2 +- packages/web3-eth-accounts/src/tx/types.ts | 2 +- packages/web3-eth-accounts/src/tx/utils.ts | 9 +++--- .../test/unit/common/hardforks.test.ts | 2 +- .../test/unit/common/mergePOS.test.ts | 2 +- .../test/unit/common/timestamp.test.ts | 4 +-- .../test/unit/tx/inputValue.test.ts | 2 +- packages/web3-eth-contract/package.json | 2 +- packages/web3-eth-contract/src/contract.ts | 26 ++++++++------- .../src/contract_log_subscription.ts | 6 ++-- packages/web3-eth-ens/package.json | 2 +- packages/web3-eth-iban/package.json | 2 +- packages/web3-eth-personal/package.json | 2 +- packages/web3-eth/package.json | 2 +- packages/web3-eth/src/rpc_method_wrappers.ts | 12 ++++--- packages/web3-eth/src/utils/decoding.ts | 6 ++-- .../src/utils/reject_if_block_timeout.ts | 2 ++ packages/web3-eth/src/utils/send_tx_helper.ts | 19 ++++++++--- .../web3-eth/src/utils/transaction_builder.ts | 3 +- .../watch_transaction_for_confirmations.ts | 2 +- packages/web3-eth/src/web3_eth.ts | 7 ++-- .../validate_transaction_for_signing.ts | 4 +++ .../web3-eth/test/integration/rpc.test.ts | 4 +-- .../send_transaction.test.ts | 1 + packages/web3-net/package.json | 2 +- packages/web3-providers-http/package.json | 2 +- packages/web3-providers-ipc/package.json | 2 +- packages/web3-providers-ws/package.json | 2 +- packages/web3-rpc-methods/package.json | 2 +- packages/web3-rpc-providers/package.json | 2 +- .../web3-rpc-providers/src/web3_provider.ts | 25 ++++++++++++--- packages/web3-types/package.json | 2 +- packages/web3-types/src/primitives_types.ts | 1 + packages/web3-utils/package.json | 2 +- packages/web3-utils/src/objects.ts | 5 +-- packages/web3-utils/src/validation.ts | 4 +-- .../test/unit/socket_provider.test.ts | 2 +- packages/web3-validator/package.json | 2 +- .../web3-validator/test/unit/utils.test.ts | 2 +- packages/web3/package.json | 2 +- packages/web3/src/web3_eip6963.ts | 32 ++++++++++--------- .../web3/test/benchmark/processingContract.ts | 4 +-- packages/web3/test/e2e/get_block.test.ts | 4 +-- .../web3/test/fixtures/tx-type-15/index.ts | 2 +- scripts/system_tests_utils.ts | 3 +- tools/eslint-config-base-web3/package.json | 2 +- tools/web3-packagetemplate/package.json | 2 +- tools/web3-plugin-example/package.json | 2 +- yarn.lock | 10 +++--- 68 files changed, 191 insertions(+), 131 deletions(-) diff --git a/.gitignore b/.gitignore index 72f88324900..b0c480e7c8f 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,7 @@ tmp lib/ dist/ tsconfig.tsbuildinfo +tsconfig.types.tsbuildinfo # Unsupported lock files package-lock.json @@ -48,4 +49,4 @@ benchmark-data.txt .eslintcache -.history \ No newline at end of file +.history diff --git a/fixtures/utils.ts b/fixtures/utils.ts index 191aed2138e..18d2a766861 100644 --- a/fixtures/utils.ts +++ b/fixtures/utils.ts @@ -18,6 +18,7 @@ export const processAsync = async ( processFunc: ( resolver: (value: unknown) => void, reject: (value: unknown) => void, + // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents ) => Promise | unknown, ) => new Promise((resolve, reject) => { diff --git a/package.json b/package.json index 8e741afb9f6..a484b558aca 100644 --- a/package.json +++ b/package.json @@ -137,7 +137,7 @@ "typedoc-plugin-markdown": "^3.17.0", "typedoc-plugin-mdn-links": "^2.0.0", "typedoc-plugin-merge-modules": "^5.1.0", - "typescript": "^4.7.4", + "typescript": "^5.5.4", "utf-8-validate": "^5.0.9", "web3-hardhat-plugin": "^1.0.0", "webpack": "^5.73.0", diff --git a/packages/web3-account-abstraction/package.json b/packages/web3-account-abstraction/package.json index a63d42985b6..530f0a09476 100644 --- a/packages/web3-account-abstraction/package.json +++ b/packages/web3-account-abstraction/package.json @@ -53,7 +53,7 @@ "jest-extended": "^3.0.1", "prettier": "^2.7.1", "ts-jest": "^29.1.1", - "typescript": "^4.7.4" + "typescript": "^5.5.4" }, "dependencies": { "web3-core": "^4.7.0", diff --git a/packages/web3-core/package.json b/packages/web3-core/package.json index 67cebb09009..856baa3b5b5 100644 --- a/packages/web3-core/package.json +++ b/packages/web3-core/package.json @@ -68,6 +68,6 @@ "jest-when": "^3.5.1", "prettier": "^2.7.1", "ts-jest": "^29.1.1", - "typescript": "^4.7.4" + "typescript": "^5.5.4" } } diff --git a/packages/web3-core/src/web3_subscription_manager.ts b/packages/web3-core/src/web3_subscription_manager.ts index 8e76498e3c2..754d8e93553 100644 --- a/packages/web3-core/src/web3_subscription_manager.ts +++ b/packages/web3-core/src/web3_subscription_manager.ts @@ -163,6 +163,7 @@ export class Web3SubscriptionManager< const subscription = new Klass(args ?? undefined, { subscriptionManager: this as Web3SubscriptionManager, returnFormat, + // eslint.disable-next-line @typescript-eslint/no-unsafe-any } as any) as InstanceType; await this.addSubscription(subscription); diff --git a/packages/web3-core/test/unit/web3_promi_event.test.ts b/packages/web3-core/test/unit/web3_promi_event.test.ts index 1f597505939..ac4e8b5646f 100644 --- a/packages/web3-core/test/unit/web3_promi_event.test.ts +++ b/packages/web3-core/test/unit/web3_promi_event.test.ts @@ -134,7 +134,7 @@ describe('Web3PromiEvent', () => { }); const f = jest.fn(); - p.finally(f); + await p.finally(f); await p; expect(f).toHaveBeenCalled(); }); diff --git a/packages/web3-errors/package.json b/packages/web3-errors/package.json index c20818ca8a2..17496f4d2cb 100644 --- a/packages/web3-errors/package.json +++ b/packages/web3-errors/package.json @@ -55,6 +55,6 @@ "jest-extended": "^3.0.1", "prettier": "^2.7.1", "ts-jest": "^29.1.1", - "typescript": "^4.7.4" + "typescript": "^5.5.4" } } diff --git a/packages/web3-errors/src/errors/contract_errors.ts b/packages/web3-errors/src/errors/contract_errors.ts index ccd2b7dd46a..85fa96bb43f 100644 --- a/packages/web3-errors/src/errors/contract_errors.ts +++ b/packages/web3-errors/src/errors/contract_errors.ts @@ -150,6 +150,7 @@ export class Eip838ExecutionError extends Web3ContractError { super(error.message || 'Error'); this.name = ('name' in error && error.name) || this.constructor.name; + // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing this.stack = ('stack' in error && error.stack) || undefined; this.code = error.code; diff --git a/packages/web3-eth-abi/package.json b/packages/web3-eth-abi/package.json index 02bead98645..8423b96294f 100644 --- a/packages/web3-eth-abi/package.json +++ b/packages/web3-eth-abi/package.json @@ -63,6 +63,6 @@ "jest-when": "^3.5.1", "prettier": "^2.7.1", "ts-jest": "^29.1.1", - "typescript": "^4.7.4" + "typescript": "^5.5.4" } } diff --git a/packages/web3-eth-abi/src/coders/encode.ts b/packages/web3-eth-abi/src/coders/encode.ts index 791c86c827d..1bfb4529220 100644 --- a/packages/web3-eth-abi/src/coders/encode.ts +++ b/packages/web3-eth-abi/src/coders/encode.ts @@ -44,7 +44,7 @@ function inferParamsAbi(params: unknown[]): ReadonlyArray { } as AbiParameter); } else { // eslint-disable-next-line @typescript-eslint/no-unsafe-argument - abi.push({ type: toHex(param as any, true) } as AbiParameter); + abi.push({ type: toHex(param as object, true) } as AbiParameter); } }); return abi; diff --git a/packages/web3-eth-abi/src/utils.ts b/packages/web3-eth-abi/src/utils.ts index 79c15b78d78..df8be81995d 100644 --- a/packages/web3-eth-abi/src/utils.ts +++ b/packages/web3-eth-abi/src/utils.ts @@ -253,6 +253,7 @@ export const flattenTypes = ( * returns a string */ export const jsonInterfaceMethodToString = (json: AbiFragment): string => { + // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing if (isAbiErrorFragment(json) || isAbiEventFragment(json) || isAbiFunctionFragment(json)) { if (json.name?.includes('(')) { return json.name; diff --git a/packages/web3-eth-accounts/package.json b/packages/web3-eth-accounts/package.json index afd61cf1549..5efdc5d2547 100644 --- a/packages/web3-eth-accounts/package.json +++ b/packages/web3-eth-accounts/package.json @@ -54,7 +54,7 @@ "jest-when": "^3.5.1", "prettier": "^2.7.1", "ts-jest": "^29.1.1", - "typescript": "^4.7.4", + "typescript": "^5.5.4", "web3-providers-ipc": "^4.0.7" }, "dependencies": { diff --git a/packages/web3-eth-accounts/src/common/common.ts b/packages/web3-eth-accounts/src/common/common.ts index 1569050d2f6..7f1b6aee61e 100644 --- a/packages/web3-eth-accounts/src/common/common.ts +++ b/packages/web3-eth-accounts/src/common/common.ts @@ -190,6 +190,7 @@ export class Common extends EventEmitter { * @returns Common */ public static fromGethGenesis( + // eslint-disable-next-line @typescript-eslint/no-explicit-any genesisJson: any, { chain, eips, genesisHash, hardfork, mergeForkIdPostMerge }: GethConfigOpts, ): Common { @@ -811,9 +812,9 @@ export class Common extends EventEmitter { */ // eslint-disable-next-line @typescript-eslint/ban-types public nextHardforkBlockOrTimestamp(_hardfork?: string | Hardfork): bigint | null { - const hardfork = _hardfork ?? this._hardfork; + const hardfork = (_hardfork as Hardfork) ?? this._hardfork; const hfs = this.hardforks(); - let hfIndex = hfs.findIndex(hf => hf.name === hardfork); + let hfIndex = hfs.findIndex(hf => (hf.name as Hardfork) === hardfork); // If the current hardfork is merge, go one behind as merge hf is not part of these // calcs even if the merge hf block is set if (hardfork === Hardfork.Merge) { @@ -842,7 +843,7 @@ export class Common extends EventEmitter { : // eslint-disable-next-line no-null/no-null null; return ( - hf.name !== Hardfork.Merge && + (hf.name as Hardfork) !== Hardfork.Merge && // eslint-disable-next-line no-null/no-null hfTimeOrBlock !== null && hfTimeOrBlock !== undefined && @@ -873,7 +874,7 @@ export class Common extends EventEmitter { */ // eslint-disable-next-line @typescript-eslint/ban-types public nextHardforkBlock(_hardfork?: string | Hardfork): bigint | null { - const hardfork = _hardfork ?? this._hardfork; + const hardfork = (_hardfork as Hardfork) ?? this._hardfork; let hfBlock = this.hardforkBlock(hardfork); // If this is a merge hardfork with block not set, then we fallback to previous hardfork // to find the nextHardforkBlock @@ -905,7 +906,7 @@ export class Common extends EventEmitter { ); // TypeScript can't seem to follow that the hfBlock is not null at this point // eslint-disable-next-line no-null/no-null - return block > hfBlock! && acc === null ? block : acc; + return block > hfBlock && acc === null ? block : acc; // eslint-disable-next-line no-null/no-null }, null); return nextHfBlock; @@ -951,7 +952,7 @@ export class Common extends EventEmitter { typeof blockOrTime === 'number' && blockOrTime !== 0 && blockOrTime !== prevBlockOrTime && - name !== Hardfork.Merge + (name as Hardfork) !== Hardfork.Merge ) { const hfBlockUint8Array = hexToBytes(blockOrTime.toString(16).padStart(16, '0')); hfUint8Array = uint8ArrayConcat(hfUint8Array, hfBlockUint8Array); diff --git a/packages/web3-eth-accounts/src/common/utils.ts b/packages/web3-eth-accounts/src/common/utils.ts index a1d46c36140..44fcadd9154 100644 --- a/packages/web3-eth-accounts/src/common/utils.ts +++ b/packages/web3-eth-accounts/src/common/utils.ts @@ -71,6 +71,7 @@ const intToHex = function (i: number) { * before merge like in kiln genesis * @returns genesis parameters in a `CommonOpts` compliant object */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any function parseGethParams(json: any, mergeForkIdPostMerge = true) { // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment const { @@ -83,6 +84,7 @@ function parseGethParams(json: any, mergeForkIdPostMerge = true) { baseFeePerGas, }: { name: string; + // eslint-disable-next-line @typescript-eslint/no-explicit-any config: any; difficulty: string; mixHash: string; @@ -194,7 +196,7 @@ function parseGethParams(json: any, mergeForkIdPostMerge = true) { }, {}); // eslint-disable-next-line @typescript-eslint/no-unsafe-argument const configHardforkNames = Object.keys(config).filter( - // eslint-disable-next-line no-null/no-null, @typescript-eslint/no-unsafe-member-access + // eslint-disable-next-line no-null/no-null, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/prefer-optional-chain key => forkMapRev[key] !== undefined && config[key] !== undefined && config[key] !== null, ); @@ -250,7 +252,7 @@ function parseGethParams(json: any, mergeForkIdPostMerge = true) { // Merge hardfork has to be placed before first hardfork that is dependent on merge const postMergeIndex = params.hardforks.findIndex( // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access - (hf: any) => forkMap[hf.name]?.postMerge === true, + hf => forkMap[hf.name]?.postMerge === true, ); if (postMergeIndex !== -1) { params.hardforks.splice(postMergeIndex, 0, mergeConfig as unknown as ConfigHardfork); @@ -272,6 +274,7 @@ function parseGethParams(json: any, mergeForkIdPostMerge = true) { * @param name optional chain name * @returns parsed params */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any export function parseGethGenesis(json: any, name?: string, mergeForkIdPostMerge?: boolean) { try { if (['config', 'difficulty', 'gasLimit', 'alloc'].some(field => !(field in json))) { @@ -282,9 +285,9 @@ export function parseGethGenesis(json: any, name?: string, mergeForkIdPostMerge? json.name = name; } return parseGethParams(json, mergeForkIdPostMerge); - } catch (e: any) { + } catch (e) { // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/restrict-template-expressions - throw new Error(`Error parsing parameters file: ${e.message}`); + throw new Error(`Error parsing parameters file: ${(e as { message: string }).message}`); } } diff --git a/packages/web3-eth-accounts/src/tx/baseTransaction.ts b/packages/web3-eth-accounts/src/tx/baseTransaction.ts index 5762b8889e9..a39b3cd1ffe 100644 --- a/packages/web3-eth-accounts/src/tx/baseTransaction.ts +++ b/packages/web3-eth-accounts/src/tx/baseTransaction.ts @@ -307,7 +307,7 @@ export abstract class BaseTransaction { // Main signature verification is done in `getSenderPublicKey()` const publicKey = this.getSenderPublicKey(); return unpadUint8Array(publicKey).length !== 0; - } catch (e: any) { + } catch (e) { return false; } } @@ -510,6 +510,7 @@ export abstract class BaseTransaction { } } + // eslint-disable-next-line @typescript-eslint/no-explicit-any protected static _validateNotArray(values: { [key: string]: any }) { const txDataKeys = [ 'nonce', @@ -556,19 +557,19 @@ export abstract class BaseTransaction { let hash = ''; try { hash = this.isSigned() ? bytesToHex(this.hash()) : 'not available (unsigned)'; - } catch (e: any) { + } catch (e) { hash = 'error'; } let isSigned = ''; try { isSigned = this.isSigned().toString(); - } catch (e: any) { + } catch (e) { hash = 'error'; } let hf = ''; try { hf = this.common.hardfork(); - } catch (e: any) { + } catch (e) { hf = 'error'; } @@ -603,15 +604,16 @@ export abstract class BaseTransaction { serialized: Uint8Array, // @ts-expect-error unused variable opts: TxOptions = {}, - // eslint-disable-next-line @typescript-eslint/no-empty-function + // eslint-disable-next-line @typescript-eslint/no-empty-function, @typescript-eslint/no-explicit-any ): any {} // eslint-disable-next-line @typescript-eslint/no-explicit-any public static fromTxData( // @ts-expect-error unused variable + // eslint-disable-next-line @typescript-eslint/no-explicit-any txData: any, // @ts-expect-error unused variable opts: TxOptions = {}, - // eslint-disable-next-line @typescript-eslint/no-empty-function + // eslint-disable-next-line @typescript-eslint/no-empty-function, @typescript-eslint/no-explicit-any ): any {} } diff --git a/packages/web3-eth-accounts/src/tx/eip1559Transaction.ts b/packages/web3-eth-accounts/src/tx/eip1559Transaction.ts index eafb889220a..6b1b3dd3258 100644 --- a/packages/web3-eth-accounts/src/tx/eip1559Transaction.ts +++ b/packages/web3-eth-accounts/src/tx/eip1559Transaction.ts @@ -104,7 +104,10 @@ export class FeeMarketEIP1559Transaction extends BaseTransaction { ? this.common.chainId() : undefined, ); - } catch (e: any) { + } catch (e) { const msg = this._errorMsg('Invalid Signature'); throw new Error(msg); } diff --git a/packages/web3-eth-accounts/src/tx/transactionFactory.ts b/packages/web3-eth-accounts/src/tx/transactionFactory.ts index 7d3305ec59a..c19e512baa8 100644 --- a/packages/web3-eth-accounts/src/tx/transactionFactory.ts +++ b/packages/web3-eth-accounts/src/tx/transactionFactory.ts @@ -36,7 +36,7 @@ const extraTxTypes: Map> = new Map(); // eslint-disable-next-line @typescript-eslint/no-extraneous-class export class TransactionFactory { // It is not possible to instantiate a TransactionFactory object. - // eslint-disable-next-line @typescript-eslint/no-empty-function, no-useless-constructor + // eslint-disable-next-line no-useless-constructor, @typescript-eslint/no-empty-function private constructor() {} public static typeToInt(txType: Numbers) { diff --git a/packages/web3-eth-accounts/src/tx/types.ts b/packages/web3-eth-accounts/src/tx/types.ts index 830c9e7582f..80bf24d757e 100644 --- a/packages/web3-eth-accounts/src/tx/types.ts +++ b/packages/web3-eth-accounts/src/tx/types.ts @@ -206,7 +206,7 @@ export interface FeeMarketEIP1559TxData extends AccessListEIP2930TxData { * The transaction's gas price, inherited from {@link Transaction}. This property is not used for EIP1559 * transactions and should always be undefined for this specific transaction type. */ - // eslint-disable-next-line @typescript-eslint/ban-types + // eslint-disable-next-line @typescript-eslint/ban-types, @typescript-eslint/no-redundant-type-constituents gasPrice?: never | null; /** * The maximum inclusion fee per gas (this fee is given to the miner) diff --git a/packages/web3-eth-accounts/src/tx/utils.ts b/packages/web3-eth-accounts/src/tx/utils.ts index 3b2fabbe4ed..d61350d82fa 100644 --- a/packages/web3-eth-accounts/src/tx/utils.ts +++ b/packages/web3-eth-accounts/src/tx/utils.ts @@ -87,7 +87,7 @@ export const verifyAccessList = (accessList: AccessListUint8Array) => { const address = accessListItem[0]; const storageSlots = accessListItem[1]; // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/consistent-type-assertions - if ((accessListItem)[2] !== undefined) { + if ((>accessListItem)[2] !== undefined) { throw new Error( 'Access list item cannot have 3 elements. It can only have an address, and an array of storage slots.', ); @@ -115,13 +115,12 @@ export const getAccessListJSON = ( const accessListJSON: { address: HexString; storageKeys: HexString[] }[] = []; // eslint-disable-next-line @typescript-eslint/prefer-for-of for (let index = 0; index < accessList.length; index += 1) { - const item: any = accessList[index]; + const item = accessList[index]; const JSONItem: { address: HexString; storageKeys: HexString[] } = { - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/consistent-type-assertions - address: bytesToHex(setLengthLeft(item[0], 20)), + address: bytesToHex(setLengthLeft(item[0], 20)), storageKeys: [], }; - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/prefer-optional-chain + // eslint-disable-next-line @typescript-eslint/prefer-optional-chain const storageSlots: Uint8Array[] = item && item[1]; // eslint-disable-next-line @typescript-eslint/prefer-for-of for (let slot = 0; slot < storageSlots.length; slot += 1) { diff --git a/packages/web3-eth-accounts/test/unit/common/hardforks.test.ts b/packages/web3-eth-accounts/test/unit/common/hardforks.test.ts index 78229bf8d4e..aff6e445c78 100644 --- a/packages/web3-eth-accounts/test/unit/common/hardforks.test.ts +++ b/packages/web3-eth-accounts/test/unit/common/hardforks.test.ts @@ -263,7 +263,7 @@ describe('[Common]: Hardfork logic', () => { c = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Shanghai }); // unschedule shanghai on it to test c.hardforks() - .filter(hf => hf.name === Hardfork.Shanghai) + .filter(hf => (hf.name as Hardfork) === Hardfork.Shanghai) // eslint-disable-next-line array-callback-return .map(hf => { // eslint-disable-next-line no-null/no-null, no-param-reassign diff --git a/packages/web3-eth-accounts/test/unit/common/mergePOS.test.ts b/packages/web3-eth-accounts/test/unit/common/mergePOS.test.ts index a2337c58c32..02882a635ca 100644 --- a/packages/web3-eth-accounts/test/unit/common/mergePOS.test.ts +++ b/packages/web3-eth-accounts/test/unit/common/mergePOS.test.ts @@ -247,7 +247,7 @@ describe('[Common]: Merge/POS specific logic', () => { it('should throw if encounters a double ttd hardfork specification', () => { const c = new Common({ chain: Chain.Sepolia }); // Add the ttd to mergeForkIdTransition which occurs post merge in sepolia - c.hardforks().filter(hf => hf.name === 'mergeForkIdTransition')[0]!['ttd'] = + c.hardforks().filter(hf => hf.name === 'mergeForkIdTransition')[0]['ttd'] = '17000000000000000'; expect(() => { c.setHardforkByBlockNumber(1735371); diff --git a/packages/web3-eth-accounts/test/unit/common/timestamp.test.ts b/packages/web3-eth-accounts/test/unit/common/timestamp.test.ts index 6718119c349..47e262adf13 100644 --- a/packages/web3-eth-accounts/test/unit/common/timestamp.test.ts +++ b/packages/web3-eth-accounts/test/unit/common/timestamp.test.ts @@ -60,7 +60,7 @@ describe('[Common]: Timestamp Hardfork logic', () => { it('forkHash', () => { const mainnet = new Common({ chain: Chain.Mainnet }); const hfs = mainnet.hardforks(); - const mergeIndex = hfs.findIndex(hf => hf.name === Hardfork.Merge); + const mergeIndex = hfs.findIndex(hf => (hf.name as Hardfork) === Hardfork.Merge); const hardforks = hfs.slice(0, mergeIndex + 1).concat([ // Add these hardforks as specified here: // https://github.com/ethereum/EIPs/pull/6122/files @@ -100,7 +100,7 @@ describe('[Common]: Timestamp Hardfork logic', () => { it('setForkHashes', () => { const mainnet = new Common({ chain: Chain.Mainnet }); const hfs = mainnet.hardforks(); - const mergeIndex = hfs.findIndex(hf => hf.name === Hardfork.Merge); + const mergeIndex = hfs.findIndex(hf => (hf.name as Hardfork) === Hardfork.Merge); const hardforks = hfs.slice(0, mergeIndex + 1).concat([ // Add these hardforks as specified here: // https://github.com/ethereum/EIPs/pull/6122/files diff --git a/packages/web3-eth-accounts/test/unit/tx/inputValue.test.ts b/packages/web3-eth-accounts/test/unit/tx/inputValue.test.ts index e39ba839775..c5c2b2b80b1 100644 --- a/packages/web3-eth-accounts/test/unit/tx/inputValue.test.ts +++ b/packages/web3-eth-accounts/test/unit/tx/inputValue.test.ts @@ -248,7 +248,7 @@ test('[Invalid Access Lists]', () => { // eslint-disable-next-line @typescript-eslint/no-unsafe-call tx = tx.sign(hexToBytes('42'.repeat(32))); } - } catch (e: any) { + } catch (e) { tx = TransactionFactory.fromTxData({ type: txType }); if (signed) { // eslint-disable-next-line @typescript-eslint/no-unsafe-call diff --git a/packages/web3-eth-contract/package.json b/packages/web3-eth-contract/package.json index 30db5ffc723..3133720681f 100644 --- a/packages/web3-eth-contract/package.json +++ b/packages/web3-eth-contract/package.json @@ -68,7 +68,7 @@ "jest-extended": "^3.0.1", "prettier": "^2.7.1", "ts-jest": "^29.1.1", - "typescript": "^4.7.4", + "typescript": "^5.5.4", "web3-eth-accounts": "^4.3.0", "web3-providers-ws": "^4.0.8" } diff --git a/packages/web3-eth-contract/src/contract.ts b/packages/web3-eth-contract/src/contract.ts index cff3a440bfe..bc0cde9022a 100644 --- a/packages/web3-eth-contract/src/contract.ts +++ b/packages/web3-eth-contract/src/contract.ts @@ -21,6 +21,7 @@ import { Web3PromiEvent, Web3ConfigEvent, Web3SubscriptionManager, + Web3SubscriptionConstructor, } from 'web3-core'; import { ContractExecutionError, @@ -128,9 +129,11 @@ type ContractBoundMethod< Method extends ContractMethod = ContractMethod, > = ( ...args: Abi extends undefined - ? any[] + ? // eslint-disable-next-line @typescript-eslint/no-explicit-any + any[] : Method['Inputs'] extends never - ? any[] + ? // eslint-disable-next-line @typescript-eslint/no-explicit-any + any[] : Method['Inputs'] ) => Method['Abi']['stateMutability'] extends 'payable' | 'pure' ? PayableMethodObject @@ -737,7 +740,7 @@ export class Contract * ``` */ public clone() { - let newContract: Contract; + let newContract: Contract; if (this.options.address) { newContract = new Contract( [...this._jsonInterface, ...this._errorsInterface] as unknown as Abi, @@ -930,12 +933,12 @@ export class Contract param2?: Omit | ReturnFormat, param3?: ReturnFormat, ): Promise<(string | EventLog)[]> { - const eventName = typeof param1 === 'string' ? param1 : ALL_EVENTS; + const eventName: string = typeof param1 === 'string' ? param1 : ALL_EVENTS; const options = // eslint-disable-next-line no-nested-ternary typeof param1 !== 'string' && !isDataFormat(param1) - ? param1 + ? (param1 as Omit) : !isDataFormat(param2) ? param2 : {}; @@ -955,7 +958,7 @@ export class Contract ) as AbiEventFragment & { signature: string }); if (!abi) { - throw new Web3ContractError(`Event ${eventName} not found.`); + throw new Web3ContractError(`Event ${String(eventName)} not found.`); } const { fromBlock, toBlock, topics, address } = encodeEventABI( @@ -1059,11 +1062,11 @@ export class Contract // make constant and payable backwards compatible abi.constant = - abi.stateMutability === 'view' ?? - abi.stateMutability === 'pure' ?? + abi.stateMutability === 'view' || + abi.stateMutability === 'pure' || abi.constant; - abi.payable = abi.stateMutability === 'payable' ?? abi.payable; + abi.payable = abi.stateMutability === 'payable' || abi.payable; this._overloadedMethodAbis.set(abi.name, [ ...(this._overloadedMethodAbis.get(abi.name) ?? []), abi, @@ -1438,10 +1441,11 @@ export class Contract jsonInterface: this._jsonInterface, }, { - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment subscriptionManager: this.subscriptionManager as Web3SubscriptionManager< unknown, - any + { + [key: string]: Web3SubscriptionConstructor; + } >, returnFormat, }, diff --git a/packages/web3-eth-contract/src/contract_log_subscription.ts b/packages/web3-eth-contract/src/contract_log_subscription.ts index 8010309c7cb..b1994a81af8 100644 --- a/packages/web3-eth-contract/src/contract_log_subscription.ts +++ b/packages/web3-eth-contract/src/contract_log_subscription.ts @@ -145,8 +145,10 @@ export class ContractLogsSubscription extends Web3Subscription< returnFormat?: DataFormat; }, ) { - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument - super(args, options as any); + super( + args, + options as { subscriptionManager: Web3SubscriptionManager; returnFormat?: DataFormat }, + ); this.address = args.address; this.topics = args.topics; diff --git a/packages/web3-eth-ens/package.json b/packages/web3-eth-ens/package.json index e18474e0140..b509be62457 100644 --- a/packages/web3-eth-ens/package.json +++ b/packages/web3-eth-ens/package.json @@ -55,7 +55,7 @@ "jest-extended": "^3.0.1", "prettier": "^2.7.1", "ts-jest": "^29.1.1", - "typescript": "^4.7.4" + "typescript": "^5.5.4" }, "dependencies": { "@adraffy/ens-normalize": "^1.8.8", diff --git a/packages/web3-eth-iban/package.json b/packages/web3-eth-iban/package.json index 81e65c298b1..b5d1013c396 100644 --- a/packages/web3-eth-iban/package.json +++ b/packages/web3-eth-iban/package.json @@ -53,7 +53,7 @@ "jest-extended": "^3.0.1", "prettier": "^2.7.1", "ts-jest": "^29.1.1", - "typescript": "^4.7.4" + "typescript": "^5.5.4" }, "dependencies": { "web3-errors": "^1.1.3", diff --git a/packages/web3-eth-personal/package.json b/packages/web3-eth-personal/package.json index 2a1f3000308..cee759d16af 100644 --- a/packages/web3-eth-personal/package.json +++ b/packages/web3-eth-personal/package.json @@ -61,7 +61,7 @@ "jest-extended": "^3.0.1", "prettier": "^2.7.1", "ts-jest": "^29.1.1", - "typescript": "^4.7.4", + "typescript": "^5.5.4", "web3-providers-ws": "^4.0.8" } } diff --git a/packages/web3-eth/package.json b/packages/web3-eth/package.json index 6c598d767e7..536bb91aee4 100644 --- a/packages/web3-eth/package.json +++ b/packages/web3-eth/package.json @@ -58,7 +58,7 @@ "jest-extended": "^3.0.1", "prettier": "^2.7.1", "ts-jest": "^29.1.1", - "typescript": "^4.7.4", + "typescript": "^5.5.4", "web3-providers-http": "^4.2.0" }, "dependencies": { diff --git a/packages/web3-eth/src/rpc_method_wrappers.ts b/packages/web3-eth/src/rpc_method_wrappers.ts index 9931c56364f..b8dddb70589 100644 --- a/packages/web3-eth/src/rpc_method_wrappers.ts +++ b/packages/web3-eth/src/rpc_method_wrappers.ts @@ -598,11 +598,13 @@ export function sendTransaction< transaction = await transactionMiddleware.processTransaction(transaction); } - let transactionFormatted: + let transactionFormatted: FormatType< | Transaction | TransactionWithFromLocalWalletIndex | TransactionWithToLocalWalletIndex - | TransactionWithFromAndToLocalWalletIndex = formatTransaction( + | TransactionWithFromAndToLocalWalletIndex, + ReturnFormat + > = formatTransaction( { ...transaction, from: getTransactionFromOrToAttr('from', web3Context, transaction), @@ -612,13 +614,13 @@ export function sendTransaction< { transactionSchema: web3Context.config.customTransactionSchema, }, - ); + ) as FormatType; try { - transactionFormatted = await sendTxHelper.populateGasPrice({ + transactionFormatted = (await sendTxHelper.populateGasPrice({ transaction, transactionFormatted, - }); + })) as FormatType; await sendTxHelper.checkRevertBeforeSending( transactionFormatted as TransactionCall, diff --git a/packages/web3-eth/src/utils/decoding.ts b/packages/web3-eth/src/utils/decoding.ts index f4b61c0a5ac..1f8c33c19ec 100644 --- a/packages/web3-eth/src/utils/decoding.ts +++ b/packages/web3-eth/src/utils/decoding.ts @@ -83,9 +83,9 @@ export const decodeEventABI = ( returnValues: decodeLog([...(modifiedEvent.inputs ?? [])], data.data, argTopics), event: modifiedEvent.name, signature: - modifiedEvent.anonymous || !data.topics || data.topics.length === 0 || !data.topics[0] - ? undefined - : data.topics[0], + !modifiedEvent.anonymous && data.topics?.length > 0 && data.topics[0] + ? data.topics[0] + : undefined, raw: { data: data.data, diff --git a/packages/web3-eth/src/utils/reject_if_block_timeout.ts b/packages/web3-eth/src/utils/reject_if_block_timeout.ts index e3563ca2a1a..72ef1a3bd02 100644 --- a/packages/web3-eth/src/utils/reject_if_block_timeout.ts +++ b/packages/web3-eth/src/utils/reject_if_block_timeout.ts @@ -168,8 +168,10 @@ export async function rejectIfBlockTimeout( (provider as Web3BaseProvider).supportsSubscriptions?.() && web3Context.enableExperimentalFeatures.useSubscriptionWhenCheckingBlockTimeout ) { + // eslint-disable-next-line @typescript-eslint/no-floating-promises callingRes = await resolveBySubscription(web3Context, starterBlockNumber, transactionHash); } else { + // eslint-disable-next-line @typescript-eslint/no-floating-promises callingRes = resolveByPolling(web3Context, starterBlockNumber, transactionHash); } return callingRes; diff --git a/packages/web3-eth/src/utils/send_tx_helper.ts b/packages/web3-eth/src/utils/send_tx_helper.ts index e28b353cda1..75f69ddb0f2 100644 --- a/packages/web3-eth/src/utils/send_tx_helper.ts +++ b/packages/web3-eth/src/utils/send_tx_helper.ts @@ -45,6 +45,7 @@ import { import { ethRpcMethods } from 'web3-rpc-methods'; import { + InternalTransaction, SendSignedTransactionEvents, SendTransactionEvents, SendTransactionOptions, @@ -150,7 +151,12 @@ export class SendTxHelper< public emitSending(tx: TxType | HexString) { if (this.promiEvent.listenerCount('sending') > 0) { - this.promiEvent.emit('sending', tx); + this.promiEvent.emit( + 'sending', + tx as + | SendSignedTransactionEvents['sending'] + | SendTransactionEvents['sending'], + ); } } @@ -174,7 +180,7 @@ export class SendTxHelper< // @TODO gasPrice, maxPriorityFeePerGas, maxFeePerGas // should not be included if undefined, but currently are ...(await getTransactionGasPricing( - transactionFormatted, + transactionFormatted as InternalTransaction, this.web3Context, ETH_DATA_FORMAT, )), @@ -192,7 +198,7 @@ export class SendTxHelper< tx: TxType; }) { if (wallet) { - const signedTransaction = await wallet.signTransaction(tx); + const signedTransaction = await wallet.signTransaction(tx as Transaction); return trySendTransaction( this.web3Context, @@ -216,7 +222,12 @@ export class SendTxHelper< public emitSent(tx: TxType | HexString) { if (this.promiEvent.listenerCount('sent') > 0) { - this.promiEvent.emit('sent', tx); + this.promiEvent.emit( + 'sent', + tx as + | SendSignedTransactionEvents['sent'] + | SendTransactionEvents['sent'], + ); } } public emitTransactionHash(hash: string & Uint8Array) { diff --git a/packages/web3-eth/src/utils/transaction_builder.ts b/packages/web3-eth/src/utils/transaction_builder.ts index 0d459017b4a..c4bc2d88fb4 100644 --- a/packages/web3-eth/src/utils/transaction_builder.ts +++ b/packages/web3-eth/src/utils/transaction_builder.ts @@ -64,7 +64,8 @@ export const getTransactionFromOrToAttr = ( privateKey?: HexString | Uint8Array, ): Address | undefined => { if (transaction !== undefined && attr in transaction && transaction[attr] !== undefined) { - if (typeof transaction[attr] === 'string' && isAddress(transaction[attr] as string)) { + if (typeof transaction[attr] === 'string' && isAddress(transaction[attr])) { + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion return transaction[attr] as Address; } if (!isHexStrict(transaction[attr] as string) && isNumber(transaction[attr] as Numbers)) { diff --git a/packages/web3-eth/src/utils/watch_transaction_for_confirmations.ts b/packages/web3-eth/src/utils/watch_transaction_for_confirmations.ts index 01ca39f8894..4dd94dd3394 100644 --- a/packages/web3-eth/src/utils/watch_transaction_for_confirmations.ts +++ b/packages/web3-eth/src/utils/watch_transaction_for_confirmations.ts @@ -62,7 +62,7 @@ export function watchTransactionForConfirmations< returnFormat, ), latestBlockHash: format({ format: 'bytes32' }, transactionReceipt.blockHash, returnFormat), - }); + } as Web3PromiEventEventType['confirmation']); // so a subscription for newBlockHeaders can be made instead of polling const provider: Web3BaseProvider = web3Context.requestManager.provider as Web3BaseProvider; diff --git a/packages/web3-eth/src/web3_eth.ts b/packages/web3-eth/src/web3_eth.ts index 6320ff4f524..89d4f1450b4 100644 --- a/packages/web3-eth/src/web3_eth.ts +++ b/packages/web3-eth/src/web3_eth.ts @@ -104,14 +104,17 @@ export class Web3Eth extends Web3Context | Web3ContextInitOptions | string, ) { if ( typeof providerOrContext === 'string' || + // eslint-disable-next-line @typescript-eslint/no-explicit-any isSupportedProvider(providerOrContext as SupportedProviders) ) { // @ts-expect-error disable the error: "A 'super' call must be a root-level statement within a constructor of a derived class that contains initialized properties, parameter properties, or private identifiers." super({ + // eslint-disable-next-line @typescript-eslint/no-explicit-any provider: providerOrContext as SupportedProviders, registeredSubscriptions, }); @@ -1921,8 +1924,8 @@ export class Web3Eth extends Web3Context { this.getPastLogs(args) diff --git a/packages/web3-eth/test/fixtures/validate_transaction_for_signing.ts b/packages/web3-eth/test/fixtures/validate_transaction_for_signing.ts index f22d5ac60cc..3e341cbcc3b 100644 --- a/packages/web3-eth/test/fixtures/validate_transaction_for_signing.ts +++ b/packages/web3-eth/test/fixtures/validate_transaction_for_signing.ts @@ -35,6 +35,7 @@ import { export const invalidTransactionObject: any[] = ['42', false, '0x0', BigInt(42), () => {}]; export const validateCustomChainInfoData: [ + // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents FormatType | any, undefined | MissingCustomChainError | MissingCustomChainIdError | ChainIdMismatchError, ][] = [ @@ -178,6 +179,7 @@ export const validateCustomChainInfoData: [ ]; export const validateChainInfoData: [ + // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents FormatType | any, undefined | CommonOrChainAndHardforkError | MissingChainOrHardforkError, ][] = [ @@ -304,6 +306,7 @@ export const validateChainInfoData: [ ]; export const validateGasData: [ + // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents FormatType | any, ( | undefined @@ -727,6 +730,7 @@ export const validateGasData: [ ]; export const invalidNonceOrChainIdData: [ + // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents FormatType | any, undefined | InvalidNonceOrChainIdError, ][] = [ diff --git a/packages/web3-eth/test/integration/rpc.test.ts b/packages/web3-eth/test/integration/rpc.test.ts index eba6792a2f8..cc4fa2a76f4 100644 --- a/packages/web3-eth/test/integration/rpc.test.ts +++ b/packages/web3-eth/test/integration/rpc.test.ts @@ -380,10 +380,10 @@ describe('rpc', () => { times: 1, }); // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - const res: TransactionReceipt = (await web3Eth.getTransactionReceipt( + const res: TransactionReceipt = await web3Eth.getTransactionReceipt( // TODO: add more scenarios in future release with block number receipt.transactionHash as string, - ))!; + ); validateReceipt(res); expect(res?.transactionHash).toBe(receipt.transactionHash); }); diff --git a/packages/web3-eth/test/unit/rpc_method_wrappers/send_transaction.test.ts b/packages/web3-eth/test/unit/rpc_method_wrappers/send_transaction.test.ts index e9b60f97e74..134910f19f7 100644 --- a/packages/web3-eth/test/unit/rpc_method_wrappers/send_transaction.test.ts +++ b/packages/web3-eth/test/unit/rpc_method_wrappers/send_transaction.test.ts @@ -66,6 +66,7 @@ describe('sendTransaction', () => { ); if ( + // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing sendTransactionOptions?.ignoreGasPricing || !isNullish(inputTransaction.gasPrice) || (!isNullish(inputTransaction.maxPriorityFeePerGas) && diff --git a/packages/web3-net/package.json b/packages/web3-net/package.json index 952457f72be..c1670f15f9f 100644 --- a/packages/web3-net/package.json +++ b/packages/web3-net/package.json @@ -53,7 +53,7 @@ "jest-extended": "^3.0.1", "prettier": "^2.7.1", "ts-jest": "^29.1.1", - "typescript": "^4.7.4" + "typescript": "^5.5.4" }, "dependencies": { "web3-core": "^4.4.0", diff --git a/packages/web3-providers-http/package.json b/packages/web3-providers-http/package.json index c94d24177e8..9e9631108f1 100644 --- a/packages/web3-providers-http/package.json +++ b/packages/web3-providers-http/package.json @@ -57,7 +57,7 @@ "jest-fetch-mock": "^3.0.3", "prettier": "^2.7.1", "ts-jest": "^29.1.1", - "typescript": "^4.7.4" + "typescript": "^5.5.4" }, "dependencies": { "cross-fetch": "^4.0.0", diff --git a/packages/web3-providers-ipc/package.json b/packages/web3-providers-ipc/package.json index 395156d6598..82b2d9aada2 100644 --- a/packages/web3-providers-ipc/package.json +++ b/packages/web3-providers-ipc/package.json @@ -53,7 +53,7 @@ "jest-extended": "^3.0.1", "prettier": "^2.7.1", "ts-jest": "^29.1.1", - "typescript": "^4.7.4" + "typescript": "^5.5.4" }, "dependencies": { "web3-errors": "^1.1.3", diff --git a/packages/web3-providers-ws/package.json b/packages/web3-providers-ws/package.json index 49595cc21df..da21e8db8bb 100644 --- a/packages/web3-providers-ws/package.json +++ b/packages/web3-providers-ws/package.json @@ -58,7 +58,7 @@ "jest-extended": "^3.0.1", "prettier": "^2.7.1", "ts-jest": "^29.1.1", - "typescript": "^4.7.4", + "typescript": "^5.5.4", "web3-providers-http": "^4.1.0" }, "dependencies": { diff --git a/packages/web3-rpc-methods/package.json b/packages/web3-rpc-methods/package.json index 3a05060f2c2..6931807ee1c 100644 --- a/packages/web3-rpc-methods/package.json +++ b/packages/web3-rpc-methods/package.json @@ -53,7 +53,7 @@ "jest-extended": "^3.0.1", "prettier": "^2.7.1", "ts-jest": "^29.1.1", - "typescript": "^4.7.4" + "typescript": "^5.5.4" }, "dependencies": { "web3-core": "^4.4.0", diff --git a/packages/web3-rpc-providers/package.json b/packages/web3-rpc-providers/package.json index 9339d4a3fb3..028c7f49050 100644 --- a/packages/web3-rpc-providers/package.json +++ b/packages/web3-rpc-providers/package.json @@ -54,7 +54,7 @@ "jest-extended": "^3.0.1", "prettier": "^2.7.1", "ts-jest": "^29.1.1", - "typescript": "^4.7.4" + "typescript": "^5.5.4" }, "dependencies": { "web3-errors": "^1.3.0", diff --git a/packages/web3-rpc-providers/src/web3_provider.ts b/packages/web3-rpc-providers/src/web3_provider.ts index 922d8217256..41c5513bbb7 100644 --- a/packages/web3-rpc-providers/src/web3_provider.ts +++ b/packages/web3-rpc-providers/src/web3_provider.ts @@ -141,9 +141,15 @@ export abstract class Web3ExternalProvider< listener: Web3Eip1193ProviderEventCallback, ): void; public once(_type: string, _listener: unknown): void { - if (this.provider?.once) + if (this.provider?.once) { // eslint-disable-next-line @typescript-eslint/no-unsafe-argument - this.provider.once(_type, _listener as any); + this.provider.once( + _type, + _listener as + | Web3Eip1193ProviderEventCallback + | Web3ProviderEventCallback, + ); + } } public removeAllListeners?(_type: string): void { if (this.provider?.removeAllListeners) this.provider.removeAllListeners(_type); @@ -183,7 +189,12 @@ export abstract class Web3ExternalProvider< public on(_type: unknown, _listener: unknown): void { if (this.provider) // eslint-disable-next-line @typescript-eslint/no-unsafe-argument - this.provider.on(_type as any, _listener as any); + this.provider.on( + _type as string, + _listener as + | Web3Eip1193ProviderEventCallback + | Web3ProviderMessageEventCallback, + ); } public removeListener( type: 'disconnect', @@ -207,7 +218,11 @@ export abstract class Web3ExternalProvider< ): void; public removeListener(_type: unknown, _listener: unknown): void { if (this.provider) - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument - this.provider.removeListener(_type as any, _listener as any); + this.provider.removeListener( + _type as string, + _listener as + | Web3Eip1193ProviderEventCallback + | Web3ProviderEventCallback, + ); } } diff --git a/packages/web3-types/package.json b/packages/web3-types/package.json index 31c8f217726..5fa5b7e1da7 100644 --- a/packages/web3-types/package.json +++ b/packages/web3-types/package.json @@ -54,6 +54,6 @@ "jest-extended": "^3.0.1", "prettier": "^2.7.1", "ts-jest": "^29.1.1", - "typescript": "^4.7.4" + "typescript": "^5.5.4" } } diff --git a/packages/web3-types/src/primitives_types.ts b/packages/web3-types/src/primitives_types.ts index 387900e7b66..1150994906b 100644 --- a/packages/web3-types/src/primitives_types.ts +++ b/packages/web3-types/src/primitives_types.ts @@ -15,6 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with web3.js. If not, see . */ +// TODO: consider using `0x${string}` instead of `string` for HexString export type HexString = string; export type Bytes = Uint8Array | HexString; export type Numbers = number | bigint | string | HexString; diff --git a/packages/web3-utils/package.json b/packages/web3-utils/package.json index d9c12c25ac8..c49a2929bf6 100644 --- a/packages/web3-utils/package.json +++ b/packages/web3-utils/package.json @@ -60,7 +60,7 @@ "js-sha3": "^0.8.0", "prettier": "^2.7.1", "ts-jest": "^29.1.1", - "typescript": "^4.7.4" + "typescript": "^5.5.4" }, "dependencies": { "ethereum-cryptography": "^2.0.0", diff --git a/packages/web3-utils/src/objects.ts b/packages/web3-utils/src/objects.ts index feda5510e4f..75fe0e81187 100644 --- a/packages/web3-utils/src/objects.ts +++ b/packages/web3-utils/src/objects.ts @@ -48,10 +48,7 @@ export const mergeDeep = ( if (!result[key]) { result[key] = {}; } - result[key] = mergeDeep( - result[key] as Record, - src[key] as Record, - ); + result[key] = mergeDeep(result[key] as Record, src[key]); } else if (!isNullish(src[key]) && Object.hasOwnProperty.call(src, key)) { if (Array.isArray(src[key]) || src[key] instanceof TypedArray) { result[key] = (src[key] as unknown[]).slice(0); diff --git a/packages/web3-utils/src/validation.ts b/packages/web3-utils/src/validation.ts index 57e91aae76d..1cfd4615ea4 100644 --- a/packages/web3-utils/src/validation.ts +++ b/packages/web3-utils/src/validation.ts @@ -134,10 +134,10 @@ export const compareBlockNumbers = (blockA: BlockNumberOrTag, blockB: BlockNumbe ) { return 0; } - if (blockA === 'earliest' && blockB > 0) { + if (blockA === 'earliest') { return -1; } - if (blockB === 'earliest' && blockA > 0) { + if (blockB === 'earliest') { return 1; } diff --git a/packages/web3-utils/test/unit/socket_provider.test.ts b/packages/web3-utils/test/unit/socket_provider.test.ts index 19529f4181a..f65fa4c3a79 100644 --- a/packages/web3-utils/test/unit/socket_provider.test.ts +++ b/packages/web3-utils/test/unit/socket_provider.test.ts @@ -48,7 +48,7 @@ class TestProvider extends SocketProvider { protected _sendToSocket(_payload: Web3APIPayload): void {} // eslint-disable-next-line protected _parseResponses(_event: { data: string } | undefined): JsonRpcResponse[] { - if (!_event || !_event.data) { + if (!_event?.data) { return []; } const returnValues: JsonRpcResponse[] = []; diff --git a/packages/web3-validator/package.json b/packages/web3-validator/package.json index 4a12b604981..bff4e5a7c59 100644 --- a/packages/web3-validator/package.json +++ b/packages/web3-validator/package.json @@ -62,6 +62,6 @@ "jest-extended": "^3.0.1", "prettier": "^2.7.1", "ts-jest": "^29.1.1", - "typescript": "^4.7.4" + "typescript": "^5.5.4" } } diff --git a/packages/web3-validator/test/unit/utils.test.ts b/packages/web3-validator/test/unit/utils.test.ts index eac7d652bbf..fb61c9da776 100644 --- a/packages/web3-validator/test/unit/utils.test.ts +++ b/packages/web3-validator/test/unit/utils.test.ts @@ -107,7 +107,7 @@ describe('utils', () => { it.each(validHexStrictDataWithNumber.map(tuple => [tuple[1], tuple[0]]))( 'valid numbers and bigints', (input, res) => { - expect(numberToHex(input)).toEqual((res as string).toLowerCase()); + expect(numberToHex(input)).toEqual(res.toLowerCase()); }, ); diff --git a/packages/web3/package.json b/packages/web3/package.json index 7e4be7ba12d..8669034a092 100644 --- a/packages/web3/package.json +++ b/packages/web3/package.json @@ -82,7 +82,7 @@ "jest-extended": "^3.0.1", "prettier": "^2.7.1", "ts-jest": "^29.1.1", - "typescript": "^4.7.4", + "typescript": "^5.5.4", "web3-providers-ipc": "^4.0.7" }, "dependencies": { diff --git a/packages/web3/src/web3_eip6963.ts b/packages/web3/src/web3_eip6963.ts index 2e9a2a391f8..368b075d4ec 100644 --- a/packages/web3/src/web3_eip6963.ts +++ b/packages/web3/src/web3_eip6963.ts @@ -63,20 +63,19 @@ export const requestEIP6963Providers = async (): Promise { - eip6963ProvidersMap.set(event.detail.info.uuid, event.detail); - - const newEvent: EIP6963ProvidersMapUpdateEvent = new CustomEvent( - web3ProvidersMapUpdated, - { detail: eip6963ProvidersMap }, - ); - - window.dispatchEvent(newEvent); - resolve(eip6963ProvidersMap); - }, - ); + window.addEventListener(Eip6963EventName.eip6963announceProvider, (( + event: EIP6963AnnounceProviderEvent, + ) => { + eip6963ProvidersMap.set(event.detail.info.uuid, event.detail); + + const newEvent: EIP6963ProvidersMapUpdateEvent = new CustomEvent( + web3ProvidersMapUpdated, + { detail: eip6963ProvidersMap }, + ); + + window.dispatchEvent(newEvent); + resolve(eip6963ProvidersMap); + }) as EventListenerOrEventListenerObject); window.dispatchEvent(new Event(Eip6963EventName.eip6963requestProvider)); }); @@ -89,5 +88,8 @@ export const onNewProviderDiscovered = ( 'window object not available, EIP-6963 is intended to be used within a browser', ); } - window.addEventListener(web3ProvidersMapUpdated as any, callback); + window.addEventListener( + web3ProvidersMapUpdated, + callback as EventListenerOrEventListenerObject, + ); }; diff --git a/packages/web3/test/benchmark/processingContract.ts b/packages/web3/test/benchmark/processingContract.ts index 2f1966cdf04..60311fcc46e 100644 --- a/packages/web3/test/benchmark/processingContract.ts +++ b/packages/web3/test/benchmark/processingContract.ts @@ -14,13 +14,13 @@ GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with web3.js. If not, see . */ -import { AbiFunctionFragment, ContractOptions } from 'web3-types'; +import { AbiConstructorFragment, AbiFunctionFragment, ContractOptions } from 'web3-types'; // eslint-disable-next-line import { getSendTxParams, getEthTxCallParams } from 'web3-eth-contract'; import { BasicAbi, BasicBytecode } from '../shared_fixtures/build/Basic'; import accounts from '../shared_fixtures/accounts.json'; -const abiConstructor = BasicAbi.find(j => j.type === 'constructor') as AbiFunctionFragment; +const abiConstructor = BasicAbi.find(j => j.type === 'constructor') as AbiConstructorFragment; const abiSendMethod = BasicAbi.find( j => j.type === 'function' && j.name === 'firesMultiValueEvent', ) as AbiFunctionFragment; diff --git a/packages/web3/test/e2e/get_block.test.ts b/packages/web3/test/e2e/get_block.test.ts index 33d78291b36..eb9cd09a50a 100644 --- a/packages/web3/test/e2e/get_block.test.ts +++ b/packages/web3/test/e2e/get_block.test.ts @@ -57,7 +57,7 @@ describe(`${getSystemTestBackend()} tests - getBlock`, () => { | 'blockHash' | 'blockNumber'; hydrated: boolean; - format: string; + format: FMT_NUMBER; }>({ block: ['earliest', 'latest', 'safe', 'finalized', 'blockHash', 'blockNumber'], hydrated: [true, false], @@ -66,7 +66,7 @@ describe(`${getSystemTestBackend()} tests - getBlock`, () => { )('getBlock', async ({ hydrated, block, format }) => { const result = { ...(await web3.eth.getBlock(blockData[block], hydrated, { - number: format as FMT_NUMBER, + number: format, bytes: FMT_BYTES.HEX, })), }; diff --git a/packages/web3/test/fixtures/tx-type-15/index.ts b/packages/web3/test/fixtures/tx-type-15/index.ts index 1d7dd778067..479a5badfab 100644 --- a/packages/web3/test/fixtures/tx-type-15/index.ts +++ b/packages/web3/test/fixtures/tx-type-15/index.ts @@ -400,7 +400,7 @@ export class SomeNewTxTypeTransaction extends BaseTransaction Date: Tue, 26 Nov 2024 09:32:15 +0100 Subject: [PATCH 21/21] chore(deps-dev): bump http-proxy-middleware from 2.0.6 to 2.0.7 (#7407) --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 995a41a404d..e7a13c95870 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7091,9 +7091,9 @@ http-proxy-agent@^5.0.0: debug "4" http-proxy-middleware@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/http-proxy-middleware/-/http-proxy-middleware-2.0.6.tgz#e1a4dd6979572c7ab5a4e4b55095d1f32a74963f" - integrity sha512-ya/UeJ6HVBYxrgYotAZo1KvPWlgB48kUJLDePFeneHsVujFaW5WNj2NgWCAE//B1Dl02BIfYlpNgBy8Kf8Rjmw== + version "2.0.7" + resolved "https://registry.yarnpkg.com/http-proxy-middleware/-/http-proxy-middleware-2.0.7.tgz#915f236d92ae98ef48278a95dedf17e991936ec6" + integrity sha512-fgVY8AV7qU7z/MmXJ/rxwbrtQH4jBQ9m7kp3llF0liB7glmFeVZFBepQb32T3y8n8k2+AEYuMPCpinYW+/CuRA== dependencies: "@types/http-proxy" "^1.17.8" http-proxy "^1.18.1"