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

[token-detection-controller] Refactor detectTokens method #3928

Conversation

MajorLift
Copy link
Contributor

@MajorLift MajorLift commented Feb 17, 2024

Explanation

  • Extracts three methods from TokenDetectionController's detectTokens method:

    • #getCorrectChainIdAndNetworkClientId
    • #getTokenListAndSlicesOfTokensToDetect
    • #addDetectedTokens
  • Maintains distinction between private class fields #{chainId,selectedAddress,networkClientId}{,AgainstWhichToDetect}, so that detectTokens method can be used independently of polling/passive detection.

    • This may not be expected behavior?

References

Changelog

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

@MajorLift MajorLift force-pushed the 240216-TokenDetectionController-detectTokens-refactor branch from d4ff106 to 04634b4 Compare February 18, 2024 02:12
…IdAndNetworkClientId`, `#getTokenListAndSlicesOfTokensToDetect`, `#addDetectedTokens`

- Fixes #1614
- Maintains distinction between private class fields `#{chainId,selectedAddress,networkClientId}{,AgainstWhichToDetect}`, so that `detectTokens` method can be used independently of polling/passive detection (convert to static method?). Is this expected behavior?
@MajorLift MajorLift force-pushed the 240216-TokenDetectionController-detectTokens-refactor branch from 0189811 to 18fc929 Compare February 18, 2024 02:16
@MajorLift MajorLift closed this Feb 20, 2024
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.

1 participant