Repository navigation
BREAKING: Split AssetsDetectionController - #619
Conversation
88b0985 to
e0df4b0
Compare
gantunesr
left a comment
There was a problem hiding this comment.
Left a non-blocker comment to have in mind
There was a problem hiding this comment.
For a future development, this method could be moved to a utils file
There was a problem hiding this comment.
Should this.disabled be factored in to the mainnet check?
There was a problem hiding this comment.
It could be refactored outside the method, something like !(isMainnet()) || this.disabled
There was a problem hiding this comment.
and isMainnet could be simplified to
const isMainnet = (network: string): boolean => networkType === MAINNET;There was a problem hiding this comment.
Sure! I copied this over from what existed on AssetsDetectionController but happy to make this change.
59fa76b to
05864f9
Compare
05864f9 to
b7bceca
Compare
5bc8053 to
7d9aff8
Compare
7d9aff8 to
4170508
Compare
|
@gantunesr @ryanml feedback addressed and rebased on Gustavo's recently merged changes. |
|
@Gudahtt if you have some bandwidth too. |
| sliceOfTokensToDetect[1] = tokensToDetect.slice( | ||
| 1000, | ||
| tokensToDetect.length - 1, | ||
| ); |
There was a problem hiding this comment.
[NIT]: Can we update this to the following code? This is the pattern we use in the extension detect-token.
const sliceOfTokensToDetect = [
tokensToDetect.slice(0, 1000),
tokensToDetect.slice(1000, tokensToDetect.length - 1),
];
There was a problem hiding this comment.
This is a tiny semantic change and we can make the change in a followup PR to clean up code. We also will want to do an audit of difference between the extension token-detection controller and this one so we can handle that when we switch the extension to use of the controllers repo version.
Split AssetsDetectionController into TokenDetectionController and CollectibleDetectionController
This splits the AssetsDetectionController into a TokenDetectionController and CollectibleDetectionController in the same way we split AssetController into TokensController and CollectiblesController without any functional changes to the API exposed by the original controller.
The immediate purpose of this PR is to enable integration of collectibles detection into the extension (part 1 found here) without introducing duplicate token detection functionality (the extension has its own TokenDetectionController atm)
However a fast follow should be to make the TokenDetectionController shared code (merge the two controllers adding any missing functionality from either into the merged version).
yarn build && yarn packin controllers and thenyarn addthe tarball to mobile repo.