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

Commit 13a2edc

Browse files
jdevcsin74mzAlexspacesailor24
authored
Remove the unnecessary chainId parameter (#5888) (#6057)
* refactor: Remove the unnecessary chainId parameter (#5888) Co-authored-by: Alex <[email protected]> Co-authored-by: Wyatt Barnes <[email protected]> Co-authored-by: Junaid <[email protected]> * changelog update --------- Co-authored-by: in74mz <[email protected]> Co-authored-by: Alex <[email protected]> Co-authored-by: Wyatt Barnes <[email protected]>
1 parent 7b3ce91 commit 13a2edc

File tree

3 files changed

+4
-20
lines changed

3 files changed

+4
-20
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ Released with 1.0.0-beta.37 code base.
672672

673673
- `transaction.type` is now formatted to a hex string before being send to provider (#5979)
674674
- When sending a transaction, if `transaction.type === '0x1' && transaction.accessList === undefined`, then `transaction.accessList` is set to `[]` (#5979)
675-
675+
- Removed an unnecessary `chainId` parameter from `toChecksumAddress()` function types (#5888)
676676
### Added
677677
- Added support for `getPastEvents` method to filter `allEvents` and specific event (#6015)
678678

packages/web3-utils/types/index.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export function hexToAscii(string: string): string;
8080
export function toAscii(string: string): string;
8181
export function bytesToHex(bytes: number[]): string;
8282
export function numberToHex(value: number | string | BN): string;
83-
export function checkAddressChecksum(address: string, chainId?: number): boolean;
83+
export function checkAddressChecksum(address: string): boolean;
8484
export function fromAscii(string: string): string;
8585
export function fromDecimal(value: string | number): string;
8686
export function fromUtf8(string: string): string;
@@ -100,7 +100,7 @@ export function sha3Raw(value: string | BN | Buffer): string;
100100
export function randomHex(bytesSize: number): string;
101101
export function utf8ToHex(string: string): string;
102102
export function stringToHex(string: string): string;
103-
export function toChecksumAddress(address: string, chainId?: number): string;
103+
export function toChecksumAddress(address: string): string;
104104
export function toDecimal(hex: Hex): number;
105105
export function toHex(value: number | string | BN): string;
106106
export function toUtf8(string: string): string;
@@ -157,7 +157,7 @@ export interface Utils {
157157
randomHex(bytesSize: number): string;
158158
utf8ToHex(string: string): string;
159159
stringToHex(string: string): string;
160-
toChecksumAddress(address: string, chainId?: number): string;
160+
toChecksumAddress(address: string): string;
161161
toDecimal(hex: Hex): number;
162162
toHex(value: number | string | BN): string;
163163
toUtf8(string: string): string;

packages/web3-utils/types/tests/to-check-sum-address-test.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ import {toChecksumAddress} from 'web3-utils';
2525

2626
// $ExpectType string
2727
toChecksumAddress('0x8ee7f17bb3f88b01247c21ab6603880b64ae53e811f5e01138822e558cf1ab51');
28-
// $ExpectType string
29-
toChecksumAddress('0x8ee7f17bb3f88b01247c21ab6603880b64ae53e811f5e01138822e558cf1ab51', 31);
30-
// $ExpectType string
31-
toChecksumAddress('0x8ee7f17bb3f88b01247c21ab6603880b64ae53e811f5e01138822e558cf1ab51', undefined);
3228

3329
// $ExpectError
3430
toChecksumAddress([4]);
@@ -46,15 +42,3 @@ toChecksumAddress(true);
4642
toChecksumAddress(null);
4743
// $ExpectError
4844
toChecksumAddress(undefined);
49-
// $ExpectError
50-
toChecksumAddress('0x8ee7f17bb3f88b01247c21ab6603880b64ae53e811f5e01138822e558cf1ab51', [4]);
51-
// $ExpectError
52-
toChecksumAddress('0x8ee7f17bb3f88b01247c21ab6603880b64ae53e811f5e01138822e558cf1ab51', ['string']);
53-
// $ExpectError
54-
toChecksumAddress('0x8ee7f17bb3f88b01247c21ab6603880b64ae53e811f5e01138822e558cf1ab51', new BN(3));
55-
// $ExpectError
56-
toChecksumAddress('0x8ee7f17bb3f88b01247c21ab6603880b64ae53e811f5e01138822e558cf1ab51', {});
57-
// $ExpectError
58-
toChecksumAddress('0x8ee7f17bb3f88b01247c21ab6603880b64ae53e811f5e01138822e558cf1ab51', true);
59-
// $ExpectError
60-
toChecksumAddress('0x8ee7f17bb3f88b01247c21ab6603880b64ae53e811f5e01138822e558cf1ab51', null);

0 commit comments

Comments
 (0)