-
Notifications
You must be signed in to change notification settings - Fork 407
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
refactor: update ethers to v6.1 from v5.7 #670
Conversation
🦋 Changeset detectedLatest commit: 313391d The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
fca54ac
to
feac708
Compare
// Remove right padding | ||
let hex = value.toHexString(); | ||
let hex = value.toString(16); |
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.
With BigInt, its possible that this value is an odd-length hex value. Is that going to create a problem here? Are there any additional test cases we should be adding?
cc @pfletcherhill and @deodad
be945a3
to
5c18455
Compare
5c18455
to
b12a28e
Compare
b12a28e
to
313391d
Compare
Motivation
The downside is that we may be introducing some last minute bugs here which can go undetected, so I'd like to get some second opinions from folks working in the codebase.
Change Summary
The most significant changes being made are:
JS BigInt instead of Ethers.BigNum
BigInt seems like a drop in replacement except for the fact that serialization returns odd-length hex values like 0x3e8 instead of 0x03e8. In some cases this needs to be sanitized because parts of our codebase expect even length values.
Providers are very different under the hood
The internals of Providers have been refactored significantly. Providers now inherit from an AbstractProvider class and polling logic is handled explicitly by a Subscription. Since we used to reach into providers and modify polling behavior manually, this needs to be refactored carefully.
TypedDataSigner and verifyTypedData no longer exist
TypedDataSigner is superseded by the new Signer class and verifyTypedData no longer seems to exist for EIP712 verifications, which means we must perform signature recovery using more manual steps.
There are also some minor changes:
Wallet.createRandom()
instead ofnew Wallet(utils.randomBytes(32))
which has existed since v5, not sure if there's a reason we were doing this or just an omission.Merge Checklist