Skip to content

Commit

Permalink
Merge branch '4.x' into dependabot/npm_and_yarn/docs/babel/traverse-7…
Browse files Browse the repository at this point in the history
….23.2
  • Loading branch information
jdevcs authored Oct 23, 2023
2 parents 87491dc + a0d6730 commit be05977
Show file tree
Hide file tree
Showing 58 changed files with 528 additions and 262 deletions.
65 changes: 63 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2081,10 +2081,14 @@ If there are any bugs, improvements, optimizations or any new feature proposal f

- Dependencies updated

## [Unreleased]
## [4.2.0]

### Added

#### web3

- Various web3 sub packages has new functions details are in root changelog

#### web3-eth

- Added `ALL_EVENTS` and `ALL_EVENTS_ABI` constants, `SendTransactionEventsBase` type, `decodeEventABI` method (#6410)
Expand All @@ -2109,10 +2113,19 @@ If there are any bugs, improvements, optimizations or any new feature proposal f

- Fix the issue: "Uncaught TypeError: Class extends value undefined is not a constructor or null #6371". (#6398)

#### web3-errors

- Added new SchemaFormatError (#6434)

#### web3-eth

- Ensure provider.supportsSubscriptions exists before watching by subscription (#6440)
- Fixed param sent to `checkRevertBeforeSending` in `sendSignedTransaction`
- Fixed `defaultTransactionBuilder` for value issue (#6509)

#### web3-eth-abi

- Fix issue with default config with babel (and React): "TypeError: Cannot convert a BigInt value to a number #6187" (#6506)

#### web3-eth-accounts

Expand All @@ -2122,12 +2135,32 @@ If there are any bugs, improvements, optimizations or any new feature proposal f

- Fix issue lquixada/cross-fetch#78, enabling to run web3.js in service worker (#6463)

#### web3-providers-ipc

- Fixed bug in chunks processing logic (#6496)

#### web3-providers-ws

- Fixed bug in chunks processing logic (#6496)

#### web3-utils

- Fix issue with default config with babel (and React): "TypeError: Cannot convert a BigInt value to a number #6187" (#6506)
- Fixed bug in chunks processing logic (#6496)

#### web3-validator

- Multi-dimensional arrays are now handled properly when parsing ABIs
- Multi-dimensional arrays are now handled properly when parsing ABIs (#6435)
- Fix issue with default config with babel (and React): "TypeError: Cannot convert a BigInt value to a number #6187" (#6506)
- Validator will now properly handle all valid numeric type sizes: intN / uintN where 8 <= N <= 256 and N % 8 == 0 (#6434)
- Will now throw SchemaFormatError when unsupported format is passed to `convertToZod` method (#6434)

### Changed

#### web3

- Dependencies updated

#### web3-core

- defaultTransactionType is now type 0x2 instead of 0x0 (#6282)
Expand All @@ -2142,6 +2175,34 @@ If there are any bugs, improvements, optimizations or any new feature proposal f

- The `events` property was added to the `receipt` object (#6410)

#### web3-eth-ens

- Dependencies updated

#### web3-eth-iban

- Dependencies updated

#### web3-eth-personal

- Dependencies updated

#### web3-net

- Dependencies updated

#### web3-providers-http

- Bump cross-fetch to version 4 (#6463).

#### web3-rpc-methods

- Dependencies updated

## [Unreleased]

### Fixed

#### web3-eth-abi

- Bug fix of `ERR_UNSUPPORTED_DIR_IMPORT` in ABI (#6535)
4 changes: 3 additions & 1 deletion packages/web3-core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ Documentation:

- Added to `Web3Config` property `contractDataInputFill` allowing users to have the choice using property `data`, `input` or `both` for contract methods to be sent to the RPC provider when creating contracts. (#6377) (#6400)

## [Unreleased]
## [4.3.0]

### Changed

Expand All @@ -190,3 +190,5 @@ Documentation:
### Fixed

- Fix the issue: "Uncaught TypeError: Class extends value undefined is not a constructor or null #6371". (#6398)

## [Unreleased]
18 changes: 9 additions & 9 deletions packages/web3-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "web3-core",
"version": "4.2.0",
"version": "4.3.0",
"description": "Web3 core tools for sub-packages. This is an internal package.",
"main": "./lib/commonjs/index.js",
"module": "./lib/esm/index.js",
Expand Down Expand Up @@ -42,16 +42,16 @@
"test:integration": "jest --config=./test/integration/jest.config.js --passWithNoTests"
},
"dependencies": {
"web3-errors": "^1.1.2",
"web3-eth-iban": "^4.0.6",
"web3-providers-http": "^4.0.6",
"web3-providers-ws": "^4.0.6",
"web3-types": "^1.2.0",
"web3-utils": "^4.0.6",
"web3-validator": "^2.0.2"
"web3-errors": "^1.1.3",
"web3-eth-iban": "^4.0.7",
"web3-providers-http": "^4.1.0",
"web3-providers-ws": "^4.0.7",
"web3-types": "^1.3.0",
"web3-utils": "^4.0.7",
"web3-validator": "^2.0.3"
},
"optionalDependencies": {
"web3-providers-ipc": "^4.0.6"
"web3-providers-ipc": "^4.0.7"
},
"devDependencies": {
"@types/jest": "^28.1.6",
Expand Down
6 changes: 6 additions & 0 deletions packages/web3-errors/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,10 @@ Documentation:

- Dependencies updated

## [1.1.3]

### Fixed

- Added new SchemaFormatError (#6434)

## [Unreleased]
4 changes: 2 additions & 2 deletions packages/web3-errors/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "web3-errors",
"version": "1.1.2",
"version": "1.1.3",
"description": "This package has web3 error classes",
"main": "./lib/commonjs/index.js",
"module": "./lib/esm/index.js",
Expand Down Expand Up @@ -41,7 +41,7 @@
"test:integration": "jest --config=./test/integration/jest.config.js --passWithNoTests"
},
"dependencies": {
"web3-types": "^1.2.0"
"web3-types": "^1.3.0"
},
"devDependencies": {
"@types/jest": "^28.1.6",
Expand Down
4 changes: 4 additions & 0 deletions packages/web3-errors/src/error_codes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,14 @@ export const ERR_INVALID_NIBBLE_WIDTH = 1014;
// Validation error codes
export const ERR_VALIDATION = 1100;


// Core error codes
export const ERR_CORE_HARDFORK_MISMATCH = 1101;
export const ERR_CORE_CHAIN_MISMATCH = 1102;

// Schema error codes
export const ERR_SCHEMA_FORMAT = 1200;

// RPC error codes (EIP-1474)
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1474.md
export const ERR_RPC_INVALID_JSON = -32700;
Expand Down
32 changes: 32 additions & 0 deletions packages/web3-errors/src/errors/schema_errors.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
This file is part of web3.js.
web3.js is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
web3.js is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
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 <http://www.gnu.org/licenses/>.
*/

import { ERR_SCHEMA_FORMAT } from '../error_codes.js';
import { BaseWeb3Error } from '../web3_error_base.js';

export class SchemaFormatError extends BaseWeb3Error {
public code = ERR_SCHEMA_FORMAT;

public constructor(public type: string) {
super(`Format for the type ${type} is unsupported`);
}

public toJSON() {
return { ...super.toJSON(), type: this.type };
}

}
1 change: 1 addition & 0 deletions packages/web3-errors/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ export * from './errors/response_errors.js';
export * from './errors/core_errors.js';
export * from './errors/rpc_errors.js';
export * from './errors/rpc_error_messages.js';
export * from './errors/schema_errors.js';
10 changes: 10 additions & 0 deletions packages/web3-errors/test/unit/__snapshots__/errors.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,16 @@ Object {
}
`;

exports[`errors SchemaFormatError should have valid json structure 1`] = `
Object {
"code": 1200,
"innerError": undefined,
"message": "Format for the type unsupported is unsupported",
"name": "SchemaFormatError",
"type": "unsupported",
}
`;

exports[`errors TransactionError should have valid json structure 1`] = `
Object {
"code": 400,
Expand Down
11 changes: 11 additions & 0 deletions packages/web3-errors/test/unit/errors.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import * as signatureErrors from '../../src/errors/signature_errors';
import * as transactionErrors from '../../src/errors/transaction_errors';
import * as utilsErrors from '../../src/errors/utils_errors';
import * as responseErrors from '../../src/errors/response_errors';
import * as schemaErrors from '../../src/errors/schema_errors';

import { ConvertValueToString } from '../fixtures/errors';
import { BaseWeb3Error } from '../../src/web3_error_base';
Expand All @@ -50,6 +51,7 @@ describe('errors', () => {
...signatureErrors,
...transactionErrors,
...utilsErrors,
...schemaErrors,
})) {
if (ErrorClass === transactionErrors.InvalidPropertiesForTransactionTypeError) break;
// To disable error for the abstract class
Expand Down Expand Up @@ -379,4 +381,13 @@ describe('errors', () => {
).toMatchSnapshot();
});
});

describe('SchemaFormatError', () => {
it('should have valid json structure', () => {
expect(
new schemaErrors.SchemaFormatError("unsupported"
).toJSON(),
).toMatchSnapshot();
});
});
});
8 changes: 7 additions & 1 deletion packages/web3-eth-abi/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,14 @@ Documentation:

- Dependencies updated

## [Unreleased]
## [4.1.3]

### Fixed

- Fix issue with default config with babel (and React): "TypeError: Cannot convert a BigInt value to a number #6187" (#6506)

## [Unreleased]

### Fixed

- Bug fix of `ERR_UNSUPPORTED_DIR_IMPORT` in ABI (#6535)
10 changes: 5 additions & 5 deletions packages/web3-eth-abi/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "web3-eth-abi",
"version": "4.1.2",
"version": "4.1.3",
"description": "Web3 module encode and decode EVM in/output.",
"main": "./lib/commonjs/index.js",
"module": "./lib/esm/index.js",
Expand Down Expand Up @@ -43,10 +43,10 @@
},
"dependencies": {
"abitype": "0.7.1",
"web3-validator": "^2.0.2",
"web3-errors": "^1.1.2",
"web3-types": "^1.2.0",
"web3-utils": "^4.0.6"
"web3-errors": "^1.1.3",
"web3-types": "^1.3.0",
"web3-utils": "^4.0.7",
"web3-validator": "^2.0.3"
},
"devDependencies": {
"@humeris/espresso-shot": "^4.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/web3-eth-abi/src/coders/base/array.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { AbiError } from 'web3-errors';
import { AbiParameter } from 'web3-types';
import { uint8ArrayConcat } from 'web3-utils';
// eslint-disable-next-line import/no-cycle
import { decodeParamFromAbiParameter, encodeNumber, encodeParamFromAbiParameter } from '.';
import { decodeParamFromAbiParameter, encodeNumber, encodeParamFromAbiParameter } from './index.js';
import { DecoderResult, EncoderResult } from '../types.js';
import { extractArrayType, isDynamic, WORD_SIZE } from '../utils.js';
import { decodeNumber } from './number.js';
Expand Down
2 changes: 1 addition & 1 deletion packages/web3-eth-abi/src/coders/base/tuple.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { AbiParameter } from 'web3-types';
import { uint8ArrayConcat } from 'web3-utils';
import { DecoderResult, EncoderResult } from '../types.js';
// eslint-disable-next-line import/no-cycle
import { decodeParamFromAbiParameter, encodeParamFromAbiParameter } from '.';
import { decodeParamFromAbiParameter, encodeParamFromAbiParameter } from './index.js';
import { encodeDynamicParams } from './utils.js';
import { isDynamic } from '../utils.js';
import { decodeNumber } from './number.js';
Expand Down
2 changes: 1 addition & 1 deletion packages/web3-eth-abi/src/coders/encode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ along with web3.js. If not, see <http://www.gnu.org/licenses/>.
import { AbiError } from 'web3-errors';
import { AbiInput } from 'web3-types';
import { utils } from 'web3-validator';
import { encodeTuple } from './base';
import { encodeTuple } from './base/index.js';
import { toAbiParams } from './utils.js';

export function encodeParameters(abi: ReadonlyArray<AbiInput>, params: unknown[]): string {
Expand Down
4 changes: 3 additions & 1 deletion packages/web3-eth-accounts/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ Documentation:
- Fixed "The `r` and `s` returned by `sign` to does not always consist of 64 characters" (#6411)


## [Unreleased]
## [4.1.0]

### Added

Expand All @@ -148,3 +148,5 @@ Documentation:
### Fixed

- Fixed `recover` function, `v` will be normalized to value 0,1 (#6344)

## [Unreleased]
12 changes: 6 additions & 6 deletions packages/web3-eth-accounts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "web3-eth-accounts",
"version": "4.0.6",
"version": "4.1.0",
"description": "Package for managing Ethereum accounts and signing",
"main": "./lib/commonjs/index.js",
"module": "./lib/esm/index.js",
Expand Down Expand Up @@ -55,15 +55,15 @@
"prettier": "^2.7.1",
"ts-jest": "^28.0.7",
"typescript": "^4.7.4",
"web3-providers-ipc": "^4.0.6"
"web3-providers-ipc": "^4.0.7"
},
"dependencies": {
"@ethereumjs/rlp": "^4.0.1",
"crc-32": "^1.2.2",
"ethereum-cryptography": "^2.0.0",
"web3-errors": "^1.1.2",
"web3-types": "^1.2.0",
"web3-utils": "^4.0.6",
"web3-validator": "^2.0.2"
"web3-errors": "^1.1.3",
"web3-types": "^1.3.0",
"web3-utils": "^4.0.7",
"web3-validator": "^2.0.3"
}
}
Loading

0 comments on commit be05977

Please sign in to comment.