New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix isHex
and isHexStrict
for some edge cases and enrich their tests
#5655
Fix isHex
and isHexStrict
for some edge cases and enrich their tests
#5655
Conversation
Your Render PR Server URL is https://atweb3js-docs-pr-5655.onrender.com. Follow its progress at https://dashboard.render.com/static/srv-ce0ahd1a6gdpfmh1ol20. |
isHex
and isHexStrict
for some edge cases and enrich their tests
…-isHexStrict-and-modify-test-cases
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 it'll be fine to stray away from these 1.x changes, as these results are a bit misleading and include these changes in the breaking changes |
These are the regex tests from
Because of I'm not so sure we should make the breaking change for Not that it matters too much, but this is what Ethers is returning |
@spacesailor24 agreed, I think 0x should be okay to include but -0x probably not. If we include these breaking changes apart of the 4.x utils migration doc so that theres awareness around this for the users. |
@luu-alex Yea |
@spacesailor24 The only additional changes in this MR (in addition to allow accepting
However, it seems that changing the scope of this issue created some confusion, sorry for that. And also seems to better be discussed separately. So, I will revert back to the original scope (allowing I would like also to comment on the outputs of ether.js. And for returning For this, I did not change the behavior of returning |
Okay, so I think the consensus is:
|
im good with that, |
Thanks @spacesailor24 . This is great if we all agree on that. As this is what is included in this MR 👍 . And so, could you, please, approve this MR, if you do not have other concerns? |
…s' of https://github.com/ChainSafe/web3.js into fix/5616/fix-isHex-and-isHexStrict-and-modify-test-cases
Thanks for the important suggestion. |
* Update CHANGELOG version headers * Contract call with tuple is missing param names (#5613) * call special output type * fix * fix: enable outputs to have param names (#5624) * hot fix * add type if only one param * overloaded inputs types * fix resolver tests * add type tests * simplify types * revert registry unit test * test firefox * revert firefox test * update changelogs Co-authored-by: Marin Petrunić <mpetrunic@users.noreply.github.com> * Fix `isHex` and `isHexStrict` for some edge cases and enrich their tests (#5655) * Change `isHex` to return true for negative numbers (for example `-123`) * Change both `isHex` and `isHexStrict` to return `false` for `-0x` * Change `isHex` to return `false` for empty strings ''. * Remove erroneous set provider code for Contract constructor (#5669) * Remove erroneous set provider code for Contract constructor. Add Contract constructor provider set test * Update CHANGELOGs * Debugging failing integration tests * Apply suggestions from code review * Use getSystemTestProvider instead of hardcoded string * Refactor ternaries in Contract constructor to if statements * Correct CHANGELOG entries * Remove unneeded checks in if statements * Test with injected external providers (#5652) * fix: sending tx with injected provider (#5651) Co-authored-by: Marin Petrunic <marin.petrunic@gmail.com> * adding a test for using `ganache` provider * enable the jsonrpc `id` to optionally be incremented starting from a number (Inspired by: #5373 (comment) and needed as a work around for blockchainsllc/in3#46) * test with `in3` as a provider & skip `in3` test if it takes too long * increase integration test timeout at web3 package * add a test for using `hardhat` provider * improve how legacy providers, such as hardhat, is used * implement `isPromise` that works in the browsers * refactor external providers tests * update CHANGELOG.md * Use Error ABI to parse errors when sending a transaction (#5662) * use Error ABI when sending a transaction * update CHANGELOG.md for #5587 * Remove merge conflict marker Co-authored-by: Oleksii Kosynskyi <oleksii.kosynskyi@gmail.com> Co-authored-by: Marin Petrunić <mpetrunic@users.noreply.github.com> Co-authored-by: Muhammad Altabba <24407834+Muhammad-Altabba@users.noreply.github.com> Co-authored-by: jdevcs <junaid@chainsafe.io>
* Version bump and build for v4.0.1-alpha.2 * Release/4.0.1 alpha.2 changelog update 3 (#5689) * Update CHANGELOG version headers * Update CHANGELOGs * Revert package version bump for web3-packagetemplate * Release/4.0.1 alpha.2 merge conflicts (#5692) * Update CHANGELOG version headers * Contract call with tuple is missing param names (#5613) * call special output type * fix * fix: enable outputs to have param names (#5624) * hot fix * add type if only one param * overloaded inputs types * fix resolver tests * add type tests * simplify types * revert registry unit test * test firefox * revert firefox test * update changelogs Co-authored-by: Marin Petrunić <mpetrunic@users.noreply.github.com> * Fix `isHex` and `isHexStrict` for some edge cases and enrich their tests (#5655) * Change `isHex` to return true for negative numbers (for example `-123`) * Change both `isHex` and `isHexStrict` to return `false` for `-0x` * Change `isHex` to return `false` for empty strings ''. * Remove erroneous set provider code for Contract constructor (#5669) * Remove erroneous set provider code for Contract constructor. Add Contract constructor provider set test * Update CHANGELOGs * Debugging failing integration tests * Apply suggestions from code review * Use getSystemTestProvider instead of hardcoded string * Refactor ternaries in Contract constructor to if statements * Correct CHANGELOG entries * Remove unneeded checks in if statements * Test with injected external providers (#5652) * fix: sending tx with injected provider (#5651) Co-authored-by: Marin Petrunic <marin.petrunic@gmail.com> * adding a test for using `ganache` provider * enable the jsonrpc `id` to optionally be incremented starting from a number (Inspired by: #5373 (comment) and needed as a work around for blockchainsllc/in3#46) * test with `in3` as a provider & skip `in3` test if it takes too long * increase integration test timeout at web3 package * add a test for using `hardhat` provider * improve how legacy providers, such as hardhat, is used * implement `isPromise` that works in the browsers * refactor external providers tests * update CHANGELOG.md * Use Error ABI to parse errors when sending a transaction (#5662) * use Error ABI when sending a transaction * update CHANGELOG.md for #5587 * Remove merge conflict marker Co-authored-by: Oleksii Kosynskyi <oleksii.kosynskyi@gmail.com> Co-authored-by: Marin Petrunić <mpetrunic@users.noreply.github.com> Co-authored-by: Muhammad Altabba <24407834+Muhammad-Altabba@users.noreply.github.com> Co-authored-by: jdevcs <junaid@chainsafe.io> * Release patch/4.0.1 alpha.2/solve merge conflicts (#5697) * Update CHANGELOG version headers * Remove merge conflict markers * Remove double CHANGELOG entry Co-authored-by: Oleksii Kosynskyi <oleksii.kosynskyi@gmail.com> Co-authored-by: Marin Petrunić <mpetrunic@users.noreply.github.com> Co-authored-by: Muhammad Altabba <24407834+Muhammad-Altabba@users.noreply.github.com> Co-authored-by: jdevcs <junaid@chainsafe.io>
Description
Fixes #5616 (in addition to the added comment #5616 (comment))
Type of change
Checklist for 1.x:
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.Checklist for 4.x:
yarn
successfullyyarn lint
successfullyyarn build:web
successfullyyarn test:unit
successfullyyarn test:integration
successfullycompile:contracts
successfullyCHANGELOG.md
file in the packages I have edited.