-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Change default return type for integer values to BigInt #5137
Conversation
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.
Some of the tests are not passing. it will be great to fix it
@@ -60,9 +60,9 @@ export type DataFormat = { | |||
readonly bytes: FMT_BYTES; | |||
}; | |||
|
|||
export const DEFAULT_RETURN_FORMAT = { number: FMT_NUMBER.HEX, bytes: FMT_BYTES.HEX } as const; | |||
export const DEFAULT_RETURN_FORMAT = { number: FMT_NUMBER.BIGINT, bytes: FMT_BYTES.HEX } as const; | |||
export const ETH_DATA_FORMAT = { number: FMT_NUMBER.HEX, bytes: FMT_BYTES.HEX } as const; |
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.
export const ETH_DATA_FORMAT = { number: FMT_NUMBER.HEX, bytes: FMT_BYTES.HEX } as const; | |
export const ETH_INPUT_DATA_FORMAT = { number: FMT_NUMBER.HEX, bytes: FMT_BYTES.HEX } as const; |
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 think ETH_INPUT_DATA_FORMAT
is better usage?
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 comment
The reason will be displayed to describe this comment to others. Learn more.
If we always want to have number:FMT_NUMBER.HEX
here why we are using default format?
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.
To not redefine bytes
format. You can't define just one format while declaring one data format.
packages/web3-eth/test/integration/web3_eth/send_signed_transaction.test.ts
Show resolved
Hide resolved
@JDevC Need to merge this PR as another PR is based on it. If you think we still need to make further changes, we can do it with a separate issue.
@jdevcs Need to merge this PR as another PR is based on it. If you think we still need to make further changes, we can do it with a separate issue. |
Description
Fixes #5128
Type of change
Checklist:
npm run dtslint
with success and extended the tests and types if necessary.npm run test:cov
and my test cases cover all the lines and branches of the added code.npm run build
with success.dist/web3.min.js
in a browser.CHANGELOG.md
file in the root folder.