Skip to content

Split out TokensController and CollectiblesController from AssetsController - #518

Merged
adonesky1 merged 4 commits into
mainfrom
split-assets-controller
Jul 12, 2021
Merged

adonesky1 merged 4 commits into
mainfrom
split-assets-controller

Conversation

@adonesky1

@adonesky1 adonesky1 commented Jul 8, 2021 •

Copy link
Copy Markdown
Contributor

Addresses part 1 of #516

Objective
Split AssetsController into two new controllers (Tokens and Collectibles) that manage state these separate asset classes without introducing any functional changes.

Tested in mobile for regressions with changes in metamask-mobile #2881

@adonesky1
adonesky1 force-pushed the split-assets-controller branch from ac06752 to d87b0fa Compare July 9, 2021 15:28
@adonesky1
adonesky1 requested a review from danjm July 9, 2021 18:42

@Gudahtt Gudahtt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks great! Very clean and easy to review - I'm glad to see the split was as easy as I had hoped. The only thing I found was a leftover comment.

Comment thread src/assets/TokenRatesController.ts Outdated

import type { NetworkState } from '../network/NetworkController';
import type { AssetsState } from './AssetsController';
import { TokensState } from './TokensController';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: the type keyword can be preserved here, since we're just importing this to use it as a type

Suggested change
import { TokensState } from './TokensController';
import type { TokensState } from './TokensController';

import { createSandbox, stub } from 'sinon';
import { BN } from 'ethereumjs-util';
import HttpProvider from 'ethjs-provider-http';
// import HttpProvider from 'ethjs-provider-http';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This comment can be removed. I see that it was only used for the MAINNET_PROVIDER, which was itself removed.

Suggested change
// import HttpProvider from 'ethjs-provider-http';

@adonesky1
adonesky1 requested a review from Gudahtt July 12, 2021 14:28
@adonesky1

Copy link
Copy Markdown
Contributor Author

@Gudahtt thanks for the quick review! Pushed requested changes!

@Gudahtt Gudahtt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

@adonesky1
adonesky1 merged commit d916ebe into main Jul 12, 2021
@adonesky1
adonesky1 deleted the split-assets-controller branch July 12, 2021 14:35
@adonesky1 adonesky1 mentioned this pull request Jul 12, 2021
amitabh94 pushed a commit to amitabh94/core that referenced this pull request Jun 16, 2026
* 16.5.0

* Update CHANGELOG.md

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Daniel <80175477+dan437@users.noreply.github.com>
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