This PR re-introduces the changes that were originally merged as part of #4844. They were reverted due to an incompatibility with @metamask/create-release-branch v3, which was resolved with the update to v3.1.
Note that these functions are already used with v4 input but this was not caught due to the way bn.js is 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.
This PR re-introduces the changes that were originally merged as part of #4844. They were reverted due to an incompatibility with
@metamask/create-release-branch
v3, which was resolved with the update to v3.1.References:
@metamask/create-release-branch
support fornpm:
aliases: https://github.com/MetaMask/create-release-branch/pull/158@metamask/create-release-branch
v3.1 release with backported alias support: https://github.com/MetaMask/create-release-branch/pull/160@metamask/create-release-branch
bump to v3.1: #4884Original description of #4844:
Explanation
BNToHex
fractionBN
fromHex
toHex
fractionBN
now uses the original BN implementation when passed a v4 BN instanceReferences
bn.js
is 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.4827
Changelog
@metamask/controller-utils
bn.js
v4 library:BNToHex
fractionBN
fromHex
toHex
fractionToBN
now returns output using the samebn.js
library version that created the inputChecklist