Skip to content

fix: fix invalid character error #5490

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

Merged
merged 2 commits into from
Mar 18, 2025
Merged

fix: fix invalid character error #5490

merged 2 commits into from
Mar 18, 2025

Conversation

salimtb
Copy link
Contributor

@salimtb salimtb commented Mar 17, 2025

Explanation

The root problem is that an uppercase hex string is being passed into new BN(..., 10), causing it to be interpreted as a decimal value. To fix this, avoid calling toHex on addresses that are already in 0x format.

References

Changelog

@metamask/assets-controllers

  • FIXED: Resolved the issue that was causing an invalid character error.

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

@salimtb salimtb marked this pull request as ready for review March 17, 2025 15:11
@salimtb salimtb requested a review from a team as a code owner March 17, 2025 15:11
@salimtb salimtb merged commit 34c2324 into main Mar 18, 2025
182 checks passed
@salimtb salimtb deleted the fix/fix-invalid-character branch March 18, 2025 09:28
matthiasgeihs added a commit that referenced this pull request Jun 20, 2025
## Explanation

For testing envelope encryption
(#5940), we need a more versatile
mock encryptor. (I.e., one that can handle multiple ciphertexts at the
same time.)

Hence, here we upgrade the mock encryptor as a preparation for #5490.

## References

<!--
Are there any issues that this pull request is tied to?
Are there other links that reviewers should consult to understand these
changes better?
Are there client or consumer pull requests to adopt any breaking
changes?

For example:

* Fixes #12345
* Related to #67890
-->

## Changelog

<!--
THIS SECTION IS NO LONGER NEEDED.

The process for updating changelogs has changed. Please consult the
"Updating changelogs" section of the Contributing doc for more.
-->

## 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 communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs),
highlighting breaking changes as necessary
- [x] I've prepared draft pull requests for clients and consumer
packages to resolve any breaking changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Sentry] Error: Invalid character
2 participants