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

Commit 4de49db

Browse files
authored
Merge branch '4.x' into dependabot/npm_and_yarn/babel/traverse-7.23.2
2 parents 59e61b5 + 6791e60 commit 4de49db

File tree

55 files changed

+401
-235
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+401
-235
lines changed

CHANGELOG.md

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2081,10 +2081,14 @@ If there are any bugs, improvements, optimizations or any new feature proposal f
20812081

20822082
- Dependencies updated
20832083

2084-
## [Unreleased]
2084+
## [4.2.0]
20852085

20862086
### Added
20872087

2088+
#### web3
2089+
2090+
- Various web3 sub packages has new functions details are in root changelog
2091+
20882092
#### web3-eth
20892093

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

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

2116+
#### web3-errors
2117+
2118+
- Added new SchemaFormatError (#6434)
2119+
21122120
#### web3-eth
21132121

21142122
- Ensure provider.supportsSubscriptions exists before watching by subscription (#6440)
21152123
- Fixed param sent to `checkRevertBeforeSending` in `sendSignedTransaction`
2124+
- Fixed `defaultTransactionBuilder` for value issue (#6509)
2125+
2126+
#### web3-eth-abi
2127+
2128+
- Fix issue with default config with babel (and React): "TypeError: Cannot convert a BigInt value to a number #6187" (#6506)
21162129

21172130
#### web3-eth-accounts
21182131

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

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

2138+
#### web3-providers-ipc
2139+
2140+
- Fixed bug in chunks processing logic (#6496)
2141+
2142+
#### web3-providers-ws
2143+
2144+
- Fixed bug in chunks processing logic (#6496)
2145+
2146+
#### web3-utils
2147+
2148+
- Fix issue with default config with babel (and React): "TypeError: Cannot convert a BigInt value to a number #6187" (#6506)
2149+
- Fixed bug in chunks processing logic (#6496)
2150+
21252151
#### web3-validator
21262152

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

21292158
### Changed
21302159

2160+
#### web3
2161+
2162+
- Dependencies updated
2163+
21312164
#### web3-core
21322165

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

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

2178+
#### web3-eth-ens
2179+
2180+
- Dependencies updated
2181+
2182+
#### web3-eth-iban
2183+
2184+
- Dependencies updated
2185+
2186+
#### web3-eth-personal
2187+
2188+
- Dependencies updated
2189+
2190+
#### web3-net
2191+
2192+
- Dependencies updated
2193+
21452194
#### web3-providers-http
21462195

21472196
- Bump cross-fetch to version 4 (#6463).
2197+
2198+
#### web3-rpc-methods
2199+
2200+
- Dependencies updated
2201+
2202+
## [Unreleased]

packages/web3-core/CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ Documentation:
179179

180180
- 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)
181181

182-
## [Unreleased]
182+
## [4.3.0]
183183

184184
### Changed
185185

@@ -190,3 +190,5 @@ Documentation:
190190
### Fixed
191191

192192
- Fix the issue: "Uncaught TypeError: Class extends value undefined is not a constructor or null #6371". (#6398)
193+
194+
## [Unreleased]

packages/web3-core/package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "web3-core",
3-
"version": "4.2.0",
3+
"version": "4.3.0",
44
"description": "Web3 core tools for sub-packages. This is an internal package.",
55
"main": "./lib/commonjs/index.js",
66
"module": "./lib/esm/index.js",
@@ -42,16 +42,16 @@
4242
"test:integration": "jest --config=./test/integration/jest.config.js --passWithNoTests"
4343
},
4444
"dependencies": {
45-
"web3-errors": "^1.1.2",
46-
"web3-eth-iban": "^4.0.6",
47-
"web3-providers-http": "^4.0.6",
48-
"web3-providers-ws": "^4.0.6",
49-
"web3-types": "^1.2.0",
50-
"web3-utils": "^4.0.6",
51-
"web3-validator": "^2.0.2"
45+
"web3-errors": "^1.1.3",
46+
"web3-eth-iban": "^4.0.7",
47+
"web3-providers-http": "^4.1.0",
48+
"web3-providers-ws": "^4.0.7",
49+
"web3-types": "^1.3.0",
50+
"web3-utils": "^4.0.7",
51+
"web3-validator": "^2.0.3"
5252
},
5353
"optionalDependencies": {
54-
"web3-providers-ipc": "^4.0.6"
54+
"web3-providers-ipc": "^4.0.7"
5555
},
5656
"devDependencies": {
5757
"@types/jest": "^28.1.6",

packages/web3-errors/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,4 +154,10 @@ Documentation:
154154

155155
- Dependencies updated
156156

157+
## [1.1.3]
158+
159+
### Fixed
160+
161+
- Added new SchemaFormatError (#6434)
162+
157163
## [Unreleased]

packages/web3-errors/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "web3-errors",
3-
"version": "1.1.2",
3+
"version": "1.1.3",
44
"description": "This package has web3 error classes",
55
"main": "./lib/commonjs/index.js",
66
"module": "./lib/esm/index.js",
@@ -41,7 +41,7 @@
4141
"test:integration": "jest --config=./test/integration/jest.config.js --passWithNoTests"
4242
},
4343
"dependencies": {
44-
"web3-types": "^1.2.0"
44+
"web3-types": "^1.3.0"
4545
},
4646
"devDependencies": {
4747
"@types/jest": "^28.1.6",

packages/web3-errors/src/error_codes.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,14 @@ export const ERR_INVALID_NIBBLE_WIDTH = 1014;
158158
// Validation error codes
159159
export const ERR_VALIDATION = 1100;
160160

161+
161162
// Core error codes
162163
export const ERR_CORE_HARDFORK_MISMATCH = 1101;
163164
export const ERR_CORE_CHAIN_MISMATCH = 1102;
164165

166+
// Schema error codes
167+
export const ERR_SCHEMA_FORMAT = 1200;
168+
165169
// RPC error codes (EIP-1474)
166170
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1474.md
167171
export const ERR_RPC_INVALID_JSON = -32700;
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
This file is part of web3.js.
3+
4+
web3.js is free software: you can redistribute it and/or modify
5+
it under the terms of the GNU Lesser General Public License as published by
6+
the Free Software Foundation, either version 3 of the License, or
7+
(at your option) any later version.
8+
9+
web3.js is distributed in the hope that it will be useful,
10+
but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
GNU Lesser General Public License for more details.
13+
14+
You should have received a copy of the GNU Lesser General Public License
15+
along with web3.js. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
import { ERR_SCHEMA_FORMAT } from '../error_codes.js';
19+
import { BaseWeb3Error } from '../web3_error_base.js';
20+
21+
export class SchemaFormatError extends BaseWeb3Error {
22+
public code = ERR_SCHEMA_FORMAT;
23+
24+
public constructor(public type: string) {
25+
super(`Format for the type ${type} is unsupported`);
26+
}
27+
28+
public toJSON() {
29+
return { ...super.toJSON(), type: this.type };
30+
}
31+
32+
}

packages/web3-errors/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@ export * from './errors/response_errors.js';
3030
export * from './errors/core_errors.js';
3131
export * from './errors/rpc_errors.js';
3232
export * from './errors/rpc_error_messages.js';
33+
export * from './errors/schema_errors.js';

packages/web3-errors/test/unit/__snapshots__/errors.test.ts.snap

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,16 @@ Object {
333333
}
334334
`;
335335

336+
exports[`errors SchemaFormatError should have valid json structure 1`] = `
337+
Object {
338+
"code": 1200,
339+
"innerError": undefined,
340+
"message": "Format for the type unsupported is unsupported",
341+
"name": "SchemaFormatError",
342+
"type": "unsupported",
343+
}
344+
`;
345+
336346
exports[`errors TransactionError should have valid json structure 1`] = `
337347
Object {
338348
"code": 400,

packages/web3-errors/test/unit/errors.test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import * as signatureErrors from '../../src/errors/signature_errors';
2626
import * as transactionErrors from '../../src/errors/transaction_errors';
2727
import * as utilsErrors from '../../src/errors/utils_errors';
2828
import * as responseErrors from '../../src/errors/response_errors';
29+
import * as schemaErrors from '../../src/errors/schema_errors';
2930

3031
import { ConvertValueToString } from '../fixtures/errors';
3132
import { BaseWeb3Error } from '../../src/web3_error_base';
@@ -50,6 +51,7 @@ describe('errors', () => {
5051
...signatureErrors,
5152
...transactionErrors,
5253
...utilsErrors,
54+
...schemaErrors,
5355
})) {
5456
if (ErrorClass === transactionErrors.InvalidPropertiesForTransactionTypeError) break;
5557
// To disable error for the abstract class
@@ -379,4 +381,13 @@ describe('errors', () => {
379381
).toMatchSnapshot();
380382
});
381383
});
384+
385+
describe('SchemaFormatError', () => {
386+
it('should have valid json structure', () => {
387+
expect(
388+
new schemaErrors.SchemaFormatError("unsupported"
389+
).toJSON(),
390+
).toMatchSnapshot();
391+
});
392+
});
382393
});

0 commit comments

Comments
 (0)