This repository was archived by the owner on Mar 5, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Change default return type for integer values to BigInt #5137
Merged
+432
−442
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
1261545
:art: Update the code for small fixes
nazarhussain 24b54df
Merge branch '4.x' into nh/5125-4.x-refactor
nazarhussain 2e8eb6e
:white_check_mark: Update failing tests
nazarhussain b527ca8
:white_check_mark: Fix failing tests
nazarhussain 57e6755
:art: Add version attribute to 'Web3' class
nazarhussain c0757de
:truck: Rename the misused promievent names
nazarhussain f785298
:pencil2: Fix the typos in tests
nazarhussain da0e926
Merge branch '4.x' into nh/5125-4.x-refactor
nazarhussain ed1708c
:pencil2: Fix some typo in tests files
nazarhussain 6e74b6c
:art: Improve the code as per feedback
nazarhussain c9f593a
:art: Improve code with feedback
nazarhussain 257f127
:art: Fix some typo in refactoring
nazarhussain 15b8640
:building_construction: Update the default return format to bigint
nazarhussain ec3716c
:test_tube: Fix few eth tests
nazarhussain 3321461
:white_check_mark: Fix all tests for web3-eth
nazarhussain 3bfa8a5
:art: Add more test cases for the validator
nazarhussain d080142
:white_check_mark: Fix tests for eth-personal
nazarhussain baed875
:white_check_mark: Fix contracts tests
nazarhussain b715ff4
Merge branch '4.x' into nh/5128-default-return-type
nazarhussain 7acc2e6
:test_tube: Fix failing tests for 'web3-eth'
nazarhussain 61e5dd3
:rotating_light: Fix linter warnings
nazarhussain 6143933
:white_check_mark: Fix integration tests for 'web3-eth'
nazarhussain 78cdf04
:white_check_mark: Fix failing tests
nazarhussain 8b9b140
:white_check_mark: Fix ws tests
nazarhussain 090cee7
:white_check_mark: Fix some expecations for the integration tests
nazarhussain af331a5
Merge branch '4.x' into nh/5128-default-return-type
nazarhussain dd08f8b
:art: Improve validation logic
nazarhussain 79d7411
:art: Update few expectations
nazarhussain a0846c5
:white_check_mark: Update contracts integration tests
nazarhussain File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ import { | |
import { Web3Context, SupportedProviders, Web3ContextObject } from 'web3-core'; | ||
import { getId, Web3NetAPI } from 'web3-net'; | ||
import { Address } from 'web3-utils'; | ||
import { EthExecutionAPI, DEFAULT_RETURN_FORMAT } from 'web3-common'; | ||
import { EthExecutionAPI, DEFAULT_RETURN_FORMAT, FormatType, FMT_NUMBER } from 'web3-common'; | ||
import { NonPayableCallOptions, Contract } from 'web3-eth-contract'; | ||
import { RESOLVER } from './abi/resolver'; | ||
import { Registry } from './registry'; | ||
|
@@ -71,7 +71,10 @@ export class ENS extends Web3Context<EthExecutionAPI & Web3NetAPI> { | |
name: string, | ||
address: Address, | ||
txConfig: NonPayableCallOptions, | ||
): Promise<ReceiptInfo | RevertInstructionError> { | ||
): Promise< | ||
| FormatType<ReceiptInfo, typeof DEFAULT_RETURN_FORMAT> | ||
| FormatType<RevertInstructionError, typeof DEFAULT_RETURN_FORMAT> | ||
> { | ||
return this._registry.setResolver(name, address, txConfig); | ||
} | ||
|
||
|
@@ -289,7 +292,10 @@ export class ENS extends Web3Context<EthExecutionAPI & Web3NetAPI> { | |
if (this._detectedAddress) { | ||
return this._detectedAddress; | ||
} | ||
const networkType = await getId(this, DEFAULT_RETURN_FORMAT); // get the network from provider | ||
const networkType = await getId(this, { | ||
...DEFAULT_RETURN_FORMAT, | ||
number: FMT_NUMBER.HEX, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we always want to have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To not redefine |
||
}); // get the network from provider | ||
const addr = registryAddresses[networkType]; | ||
|
||
if (typeof addr === 'undefined') { | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
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 { FMT_BYTES, FMT_NUMBER } from 'web3-common'; | ||
|
||
export const NUMBER_DATA_FORMAT = { bytes: FMT_BYTES.HEX, number: FMT_NUMBER.NUMBER } as const; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think should rename its all occurrences for better readability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jdevcs As per my knowledge, Eth implementation follows the same format for input/output. In that aspect I named this value as
ETH_DATA_FORMAT
. Please suggest if you thinkETH_INPUT_DATA_FORMAT
is better usage?