1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-27 12:56:01 +01:00
Commit Graph

18 Commits

Author SHA1 Message Date
Mark Stacey
656dc4cf18
Cleanup detect-tokens controller and tests (#8329)
The tests for the detect-tokens controller were nearly all broken. They
have been fixed, and a few improvements were made to controller itself
to help with this.

* The core `detectNewTokens` method has been updated to be async, so
that the caller can know when the operation had completed.
* The part of the function that used `Web3` to check the token balances
has been split into a separate function, so that that part could be
stubbed out in tests. Eventually we should test this using `ganache`
instead, but this was an easier first step.
* The internal `tokenAddresses` array is now initialized on
construction, rather than upon the first Preferences controller update.
The `detectNewTokens` function would have previously failed if it ran
prior to this initialization, so it was failing if called before any
preferences state changes.

Additionally, the `detectTokenBalance` function was removed, as it was
no longer used.

The tests have been updated to ensure they're actually testing the
behavior they purport to be testing. I've simulated a test failure with
each one to check that it'd fail when it should. The preferences
controller instance was updated to set addresses correctly as well.
2020-04-13 17:14:42 -03:00
Whymarrh Whitby
4f3fc95d50
Update ESLint rules for test suite (#8023)
* Use @metamask/eslint-config@1.1.0
* Use eslint-plugin-mocha@6.2.2
* Mark root ESLint config as root
* Update Mocha ESLint rules with shared ESLint config
2020-02-11 13:21:13 -03:30
Whymarrh Whitby
92971d3c87
Migrate codebase to use ESM (#7730)
* Update eslint-plugin-import version

* Convert JS files to use ESM

* Update ESLint rules to check imports

* Fix test:unit:global command env

* Cleanup mock-dev script
2020-01-09 00:04:58 -03:30
Whymarrh Whitby
274a9ecf53 yarn lint --fix 2019-12-03 17:20:55 -03:30
Whymarrh Whitby
e61745a821
Enable no-var rule for ESLint (#7590)
* eslint: Enable no-var rule
* yarn lint --fix
2019-12-03 11:22:01 -03:30
Whymarrh Whitby
4d88e1cf86 Enable indent linting via ESLint (#6936)
* Enable indent linting via ESLint

* yarn run lint:fix
2019-07-31 10:17:11 -10:00
bitpshr
36dd0354e7 Implement latest EIP-712 protocol 2018-09-13 15:40:57 -04:00
Thomas
ce645561fb Remove commented out code for detect-token-test 2018-08-14 12:29:57 -07:00
Thomas
96d789d2cf Merge branch 'develop' into network-remove-provider-engine
Override package-lock and fix merge conflicts
2018-08-14 10:44:42 -07:00
Thomas
fb5e357998 Detect Tokens are weird 2018-07-30 06:26:34 -07:00
Esteban MIno
f79a249bcc modify tests according to tokens by network 2018-07-26 20:04:57 -04:00
Esteban MIno
9c95554933 fix detection on submit password 2018-07-20 19:58:03 -04:00
Esteban MIno
009b1cefbe keyring unlocked detect and unit tests 2018-07-19 19:46:46 -04:00
Esteban MIno
3b97d816ff detect tokens when submit password and new account selected 2018-07-19 15:56:38 -04:00
Esteban MIno
2fffe09873 detect tokens through infura 2018-07-12 20:43:43 -04:00
Esteban MIno
910713c6b3 improve tests 2018-07-11 15:59:05 -04:00
Esteban MIno
63b9c8796b fix lint 2018-07-03 15:24:23 -04:00
Esteban MIno
6284e66481 tests for spec 2018-06-27 22:18:06 -04:00