feat(controller-utils): support bn.js v4 input to BN functions#4844
Merged
legobeat merged 2 commits intoMetaMask:mainfrom Oct 25, 2024
Merged
feat(controller-utils): support bn.js v4 input to BN functions#4844legobeat merged 2 commits intoMetaMask:mainfrom
legobeat merged 2 commits intoMetaMask:mainfrom
Conversation
|
New dependencies detected. Learn more about Socket for GitHub ↗︎
|
31a26c3 to
5603e03
Compare
5603e03 to
3c66f62
Compare
legobeat
commented
Oct 24, 2024
adaf327 to
5e5dfd5
Compare
mikesposito
approved these changes
Oct 25, 2024
cryptodev-2s
approved these changes
Oct 25, 2024
5e5dfd5 to
29770a7
Compare
Affected functions: - BNToHex - fractionBN - fromHex - toHex If input is v4 instance, return as v4. Otherwise use v5, as previously.
29770a7 to
c83e1cd
Compare
7 tasks
Gudahtt
added a commit
that referenced
this pull request
Nov 1, 2024
The `@metamask/create-release-branch` package has been updated one minor version. This was done to get support for `npm:` aliases, which is needed to re-introduce #4844 (which was reverted).
4 tasks
Gudahtt
added a commit
that referenced
this pull request
Nov 1, 2024
## Explanation The `@metamask/create-release-branch` package has been updated one minor version. This was done to get support for `npm:` aliases, which is needed to re-introduce #4844 (which was reverted). ## References Unblocks the re-application of #4844 ## Changelog N/A ## Checklist - [x] I've updated the test suite for new or updated code as appropriate - [x] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [x] I've highlighted breaking changes using the "BREAKING" category above as appropriate - [x] I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes
Gudahtt
pushed a commit
that referenced
this pull request
Nov 1, 2024
4 tasks
Gudahtt
pushed a commit
that referenced
this pull request
Nov 1, 2024
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Explanation
BNToHexfractionBNfromHextoHexfractionBNnow uses the original BN implementation when passed a v4 BN instanceReferences
bn.jsis imported downstream. Making this support explicit facilitates resolving the type issue without requiring a prior full migration off bn.js v4 or resorting to peppering ts-expect-errors all over.Changelog
@metamask/controller-utilsbn.jsv4 library:BNToHexfractionBNfromHextoHexfractionToBNnow returns output using the samebn.jslibrary version that created the inputChecklist