Skip to content
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

feat: add networkClientId as param for func ignoreTokens #4949

Merged
merged 2 commits into from
Nov 20, 2024

Conversation

salimtb
Copy link
Contributor

@salimtb salimtb commented Nov 20, 2024

Explanation

The ignoreTokens function does not include networkClientId as a parameter, which can lead to errors when attempting to hide a token that belongs to a different chain. The function currently searches for tokens within the current chain only. To resolve this issue, the solution is to add networkClientId as a parameter, ensuring the function operates correctly across chains.

References

Changelog

@metamask/assets-controllers

  • CHANGED: the function ignore tokens can take now networkClientId as optional parameter

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 November 20, 2024 17:25
@salimtb salimtb requested a review from a team as a code owner November 20, 2024 17:25
ignoreTokens(tokenAddressesToIgnore: string[]) {
ignoreTokens(
tokenAddressesToIgnore: string[],
networkClientId?: NetworkClientId,
Copy link
Contributor

@bergeron bergeron Nov 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the future we can make more of arguments chain ids instead of network client ids. so we don't have to convert between them. Would also simplify the client code. But I'll approve this for now since you have it working.

@bergeron bergeron merged commit 70d386a into main Nov 20, 2024
120 checks passed
@bergeron bergeron deleted the salim/ignore-tokens-multichain branch November 20, 2024 18:45
@bergeron bergeron mentioned this pull request Nov 20, 2024
bergeron added a commit that referenced this pull request Nov 20, 2024
Minor release of assets controllers to include
#4949

---------

Co-authored-by: Elliot Winkler <[email protected]>
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.

2 participants