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

9239 Commits

Author SHA1 Message Date
Mark Stacey
04ae92a2c0
Lint .json files (#6852)
We've been using the `eslint-plugin-json` plugin for some time, but we
haven't been visiting `.json` files in the lint script. The lint script
has now been updated to incude `.json` files, which means any invalid
JSON will result in a lint error.

Unfortunately this JSON plugin doesn't seem to apply the other eslint
rules (such as `key-spacing`) to the JSON files. I wasn't able to find a
way to get that to work. Instead I manually auto-formatted each of the
locale `message.json` files, which fixed many whitespace
inconsistencies.

The `states.json` file was deleted completely, as it appears to be
unused. It wasn't a valid JSON file anyway, it was JavaScript. It looks
like a `states.js` file is automatically generated, but an old copy was
accidentally saved as `states.json` and included in the repo.

Many duplicate key errors were found and fixed in the
`development/states/` JSON files.

`package-lock.json` was added to `.eslintignore` because it was very
slow to lint, and linting it doesn't provide much value.
2019-07-15 11:03:22 -03:00
Mark Stacey
270d1d0fa9
Add eslint dependency (#6842)
We had forgotten to add `eslint` as a dependency, even though we use it
directly. It had always worked because we have dependencies that also
depend upon it.

`eslint` has also been updated to v6, which necessitated two minor
changes.
2019-07-15 10:15:49 -03:00
Mark Stacey
0366459edd
Update version of Firefox used on CI (#6841) 2019-07-15 10:15:15 -03:00
Terry Smith
ded3dc1381 Add translation support for Learn more and All done on end-of-flow (#6847) 2019-07-14 23:22:20 -03:00
Thomas Huang
96a12a627e
Merge pull request #6832 from MetaMask/master-rebased
Master rebased
2019-07-12 10:58:19 -07:00
Erik Marks
9be7fd39ba Sync lockfile (#6833) 2019-07-12 15:22:27 -02:30
Mark Stacey
ea7ba5dd5f
Remove unused AppVeyor configuration (#6840)
The AppVeyor configuration appears to be unused - this project is not
connected to AppVeyor.

After deleting the AppVeyor config, the JSDoc config was the last thing
in the `development/tools` directory. That felt a little silly, so I
moved it up to `development`.
2019-07-12 12:42:36 -03:00
Mark Stacey
2eea388680
Remove unused expressions (#6839)
Unused expressions are generally a mistake, as they don't do anything.
The exceptions to this rule (short-circuit expressions and ternary
expressions) have been allowed.

The `webrtc-adapter` was previously ignored by eslint because it has a
side-effect upon being imported. I removed the local variable instead,
which should preserve the same side-effect without making eslint
complain.
2019-07-12 12:41:39 -03:00
Mark Stacey
1c19ce91a4 Fix changelog formatting errors
The description for one entry has also been corrected.
2019-07-11 19:05:55 -03:00
Whymarrh Whitby
830c801ec3
Add React and Redux DevTools (#6793)
* Add React and Redux DevTools

* Conditionally load react-devtools

* Add start:dev npm script to run the app with devtools

Co-Authored-By: Mark Stacey <markjstacey@gmail.com>
2019-07-11 12:27:06 -02:30
Mark Stacey
09eca3cc60
Improve auto changelog script (#6753)
* Improve auto changelog script

The auto changelog script was creating empty or invalid entries in a
number of different cases, such as when the body of a commit spanned
multiple lines. This has been fixed, and the following additional
improvements have been made:

- Error handling (it will now crash upon encountering an error)
- Commits without a PR number in the subject are listed without the PR
prefix
- Invalid shellcheck warnings ignored
- Only the first line of the commit body is shown
- Carriage returns are stripped (some commits contain them)

This script should be more reliable for helping to manually update the
changelog. It's still not sufficiently robust to use as part of an
automated process - I don't think that's feasible without maintaining
stricter control over commit messages conventions and/or merge
strategies.
2019-07-11 11:08:23 -03:00
Saxon Knight
1ca23078c4 Fix wording in readdToken message (#6837)
- Removes extra "go" in
  app/_locales/en/messages.json's readdToken
  message
2019-07-11 11:34:07 -02:30
Whymarrh Whitby
f0218bdbbb
Rename accountManager usages (#6790)
Co-Authored-By: Mark Stacey <markjstacey@gmail.com>
2019-07-10 16:31:48 -02:30
Whymarrh Whitby
564818d236
Delete unused ui/example.js file (#6831) 2019-07-10 16:01:27 -02:30
filmendless
45534d9908 [ImgBot] Optimize images (#1) (#6829)
*Total -- 5,450.78kb -> 4,473.66kb (17.93%)

/images/404.png -- 38.48kb -> 11.19kb (70.91%)
/images/deadface.png -- 8.14kb -> 4.50kb (44.67%)
/images/cancel.png -- 10.67kb -> 6.04kb (43.38%)
/app/images/key-32.png -- 1.08kb -> 0.68kb (37.66%)
/app/images/coinswitch_logo.png -- 3.06kb -> 1.94kb (36.43%)
/images/info-logo.png -- 31.80kb -> 20.43kb (35.77%)
/docs/transaction-flow.png -- 137.82kb -> 91.38kb (33.7%)
/ui/design/metamask-logo-eyes.png -- 142.65kb -> 94.94kb (33.45%)
/images/coinbase logo.png -- 9.55kb -> 6.43kb (32.64%)
/ui/design/chromeStorePics/screen_dao_accounts.png -- 505.47kb -> 347.03kb (31.34%)
/docs/architecture.png -- 136.94kb -> 94.15kb (31.25%)
/ui/design/chromeStorePics/screen_dao_locked.png -- 280.38kb -> 199.54kb (28.83%)
/app/images/logo.png -- 6.43kb -> 4.58kb (28.81%)
/ui/design/chromeStorePics/screen_wei_account.png -- 638.31kb -> 469.17kb (26.5%)
/images/pw-128x128.png -- 92.76kb -> 69.18kb (25.42%)
/app/images/pw128x128.png -- 92.76kb -> 69.18kb (25.42%)
/app/images/shapeshift logo.png -- 17.13kb -> 13.54kb (20.92%)
/ui/design/02b-metamask-AccDetails-Send.jpg -- 107.56kb -> 92.00kb (14.46%)
/images/icon-128.png -- 5.63kb -> 4.82kb (14.45%)
/ui/design/chromeStorePics/icon-128.png -- 5.63kb -> 4.82kb (14.45%)
/ui/design/02a-metamask-AccDetails.jpg -- 114.81kb -> 99.73kb (13.14%)
/ui/design/02a-metamask-AccDetails-OverTransaction.jpg -- 119.21kb -> 103.65kb (13.06%)
/ui/design/02a-metamask-AccDetails-OverToken.jpg -- 118.99kb -> 103.62kb (12.92%)
/ui/design/wireframes/metamask_wfs_jan_13.png -- 409.24kb -> 357.28kb (12.7%)
/ui/design/chromeStorePics/screen_dao_notification.png -- 289.55kb -> 254.49kb (12.11%)
/ui/design/05-metamask-Menu.jpg -- 127.21kb -> 111.93kb (12.01%)
/app/images/ethereum-metamask-chrome.png -- 58.62kb -> 51.86kb (11.52%)
/ui/design/chromeStorePics/final_screen_dao_accounts.png -- 243.86kb -> 217.46kb (10.82%)
/ui/design/chromeStorePics/promo1400560.png -- 255.51kb -> 228.52kb (10.56%)
/images/icon-512.png -- 41.09kb -> 36.95kb (10.08%)
/ui/design/chromeStorePics/promo920680.png -- 201.87kb -> 181.88kb (9.9%)
/ui/design/chromeStorePics/final_screen_wei_account.png -- 247.44kb -> 223.83kb (9.54%)
/ui/design/chromeStorePics/final_screen_dao_locked.png -- 215.13kb -> 196.06kb (8.87%)
/ui/design/chromeStorePics/final_screen_dao_notification.png -- 209.38kb -> 192.76kb (7.94%)
/ui/design/00-metamask-SignIn.jpg -- 56.49kb -> 53.22kb (5.79%)
/ui/design/03-metamask-Qr.jpg -- 64.50kb -> 60.89kb (5.6%)
/ui/design/01-metamask-SelectAcc.jpg -- 74.28kb -> 70.34kb (5.3%)
/ui/design/02-metamask-AccDetails.jpg -- 74.00kb -> 70.15kb (5.21%)
/ui/design/chromeStorePics/promo440280.png -- 56.12kb -> 53.92kb (3.93%)
/app/images/icon-64.png -- 3.49kb -> 3.40kb (2.66%)
/ui/design/chromeStorePics/icon-64.png -- 3.49kb -> 3.40kb (2.66%)
/images/pw-48x48.png -- 3.20kb -> 3.16kb (1.34%)
/ui/design/chromeStorePics/final_screen_wei_notification.png -- 189.32kb -> 187.93kb (0.73%)
/images/icon-32.png -- 1.69kb -> 1.68kb (0.46%)
2019-07-10 11:37:20 -03:00
Brian Soule
fabba27b78 Capitalized speed up label to match rest of UI (#6828) 2019-07-10 09:26:20 -03:00
ryanml
daccb06a60 Create MetaFoxLogo component (#6819) 2019-07-09 14:47:58 -02:30
Whymarrh Whitby
caa40912ac
Replace deprecated shell-parallel with concurrently (#6807)
* Replace shell-parallel with concurrently

* Update ganache-cli
2019-07-09 14:09:31 -02:30
Whymarrh Whitby
b7f3f26ebf
Remove job-screens CI job (#6823)
* Remove job-screens CI job
* Remove unused dependencies, now that job-screens is gone
2019-07-08 17:02:15 -02:30
Dan J Miller
32a3f5ad7b
Address various UI styling issues (#6744)
* Add loading spinner to pending tx status label.

* Add border around account icon in top right

* Change style of settings toggle buttons; wrap with local components

* Eliminate large space after settings labels when no description

* Remove network form from advanced tab of settings

* Keep new account container height to contents when in full screen
2019-07-08 15:28:35 -02:30
Mark Stacey
6df65069a2
Replace react-addons-css-transition-group (#6816)
This package is deprecated, and is incompatible with React v16. It has
been replaced by `react-test-renderer`, which has a drop-in replacement
for `react-addons-css-transition-group`.

Strangely, `react-test-renderer` was already listed as a dependency
despite not being used. I had to downgrade it, as the version already
listed was for React v16, and we're still using React v15.
2019-07-08 10:12:00 -03:00
Mark Stacey
7b2997dbc5
Remove husky from lockfile (#6815)
This must have been removed as a dependency at some point, but left in
the lockfile. I noticed it would install itself whenever I reinstalled
all packages.
2019-07-05 18:57:47 -03:00
Mark Stacey
47544110a2
Remove unused babel-polyfill dependency (#6814)
The lockfile hasn't changed because this package is a dependency of
`fetch-mock`.
2019-07-05 18:57:19 -03:00
Mark Stacey
7f7517b9e6
Remove unused Babel transformations (#6811)
The `stage-0` Babel preset has been replaced with the specific Babel
plugins that we depend upon. We don't use most of `stage-0`, so this
allowed us to remove many unnecessary transformations. We had to remove
this preset soon anyway, because all of the stage presets are
deprecated in Babel 7.

The `stage-0` preset consisted of these plugins:
```
"transform-do-expressions"
"transform-function-bind"
"transform-class-constructor-call"
"transform-export-extensions"
"transform-class-properties"
"transform-decorators"
"syntax-dynamic-import"
"syntax-trailing-function-commas"
"transform-async-generator-functions"
"transform-async-to-generator"
"transform-exponentiation-operator"
"transform-object-rest-spread"
```

Of that list, only 'transform-class-properties', 'transform-object-
rest-spread', and 'transform-async-to-generator' were being used.
2019-07-05 16:08:11 -03:00
Mark Stacey
7a5d0f7e7f
Remove unused gulp-uglify dependency (#6810)
The switch was made to `gulp-uglify-es` some time ago, but `gulp-uglify`
was never removed.
2019-07-05 15:30:08 -03:00
Mark Stacey
95f198550e
Declare variables before use (#6806)
While working on #6805, I noticed that many variables were being used
before they were declared. Technically this worked fine in practice
because we were using the `transform-es2015-block-scoping` Babel plugin,
which transforms `let` and `const` to `var`, which is hoisted. However,
after removing that Babel transformation, many things broke.

All instances of variables or classes being used before declared have
been fixed.

The `no-use-before-define` eslint rule has been added to catch these
cases going forward. The rule is disabled for function declarations for
the moment, because those are always hoisted. We could disable that too
if we want to, but it's purely stylistic and would require a lot more
changes.
2019-07-05 14:01:34 -03:00
Mark O'Sullivan
0311f2d28c Added visual documentation of the account menu component (#6775)
* Added visual documentation of the menu bar component

* updated CHANGELOG.md

* renamed to account menu which is the component highlighted in the screenshot

* updated contributions document
2019-07-05 10:24:30 -02:30
Mark Stacey
ec40b2a325
Check for invalid gas estimates from local storage (#6800)
* Remove unused state 'gas.basicPriceAndTimeEstimates'

* Check for invalid estimates from local storage

Gas estimates were being cached in local storage then later retrieved,
but the retrieved values were not being checked. If the data failed to
save, failed to load, or was cleared since being saved, it would result
in the gas estimates being set to undefined.

The estimates retrieved from local storage are now checked before they
are used. If they are falsy, the estimates are retrieved from the
network instead.

This should fix this Sentry issue:
[METAMASK-6W0T](https://sentry.io/share/issue/cfe470314a5741768b19050815322aa4/)

A few additional changes were made to the gas-duck tests to accommodate
the use of `sinon.restore`. `restore` is strongly recommended by the
`sinon` team, as neglecting to use it can result in memory leaks. It has
the additional benefit of ensuring you create fresh stubs/spies for each
test, which means they no longer need to be reset between tests.
2019-07-04 16:18:12 -03:00
Dan J Miller
05e2120814 Version 6.7.2 gas limit fix (#6786)
* Introduce delay for eth_estimateGas calls with in test

* Add test that fails when gas estimates of contract method calls without gas are too high.

* Get transaction gas data from unApprovedTxs instead of confirmTransaction

* Fix selection of gas data in gas-modal-page-container.container

* Lint changes related to Version-6.7.2-gasLimitFix

* Fix e2e tests on Version-6.7.2-gasLimitFix

* Fix unit and integration tests for changes from Version-6.7.2-gasLimitFix

* more e2e fixes

* Add assertions for transaction values on confirm screen

* Fix display of transaction amount on confirm screen.
2019-07-04 14:14:03 -02:30
Dan Finlay
397e0d128d Version 6.7.2 RC1 2019-07-04 14:14:03 -02:30
Mark Stacey
c7608e6fe9
Remove disc (#6801)
The `disc` gulp command no longer works. I wasn't able to fix this
easily, so instead it has been removed. We can probably find something
better to replace it with.
2019-07-04 11:54:10 -03:00
Mark Stacey
cc7bb306e2
Increase CircleCI addons-linter memory (#6802)
`addons-linter` will occasionally run out of heap space. This provides 3
GB of heap for that script rather than the default ~1.5 GB. The CircleCI
containers have 4GB of memory, so this should leave plenty of extra
space for non-heap memory.
2019-07-04 11:53:02 -03:00
Whymarrh Whitby
df17853502
Remove UiMigrationAnnouncement and associated state (#6794) 2019-07-04 12:21:21 -02:30
Mark Stacey
714cf72fc3
Omit integration tests from default test script (#6803)
The integration tests are slow, and rather inconvenient to run in
development on a regular basis (they break if you move the mouse). They
have been removed from the `test` script, to make running `test`
frequently during development less painful.
2019-07-04 11:50:24 -03:00
Dan Finlay
797f0c6ced
Reduce time to show tx "speed up" buttons to 5 seconds. (#6797) 2019-07-03 22:10:17 -07:00
Mark Stacey
a44f38e640
Fix PropType warning (#6792) 2019-07-03 22:48:22 -03:00
Dan Finlay
91cda027c9 Add Mark Stacey (Kyokan) to UI CodeOwners (#6798) 2019-07-03 22:34:44 -02:30
Whymarrh Whitby
5737df249d
Move e2e tests out of beta dir (#6785) 2019-07-02 23:19:59 -02:30
Whymarrh Whitby
8b5ef5b45e
Update eth-contract-metadata to use published registry version (#6784) 2019-07-02 22:48:23 -02:30
Mark Stacey
865321d269
Update asmcrypto.js to latest version (#6767)
This silences a warning message that was printed to the console whenever
this module was loaded during tests.

The API changes between these two versions were reviewed carefully for
differences. The only difference made was to `PBKDF2_HMAC_SHA256.bytes`,
which was replaced by `Pbkdf2HmacSha256`.

The length argument no longer has a default value, so it has been set
to match what the default value was in the previous version we used,
which is 32 (the SHA256 hash size).
2019-07-02 22:16:20 -03:00
Akshit Kr Nagpal
687984a938 Added Confirmation Modal for Delete Network (#6776) 2019-07-02 09:43:02 -02:30
Mark Stacey
9fd8a3d46e
Move Browserify transforms to gulpfile (#6768)
The flat tests also rely upon these transformations, yet invoke
browserify from the command line rather than using the gulpfile. The
transformations have been specified on the command line for those
instead.

Of course it's not ideal to have the same transformations listed in two
different places, but the plan is to delete the flat tests soon anyway,
so this should suffice until then.

Closes #4538
2019-07-01 21:26:24 -03:00
Dan Finlay
448720327b
Merge pull request #6765 from MetaMask/master
Using admin privilege to bypass code owner review because it has already [been reviewed](https://github.com/MetaMask/metamask-extension/pull/6763) and those code owners are out today.
2019-07-01 10:58:25 -07:00
Dan Finlay
743afd4e9d Fix whitespace 2019-07-01 10:32:51 -07:00
Dan Finlay
c623a8be76 Re-enable sourcemaps publishing 2019-07-01 10:30:08 -07:00
Dan Finlay
a6efa7ae8d
Merge pull request #6778 from MetaMask/DisableReleaseScript
Disable release script from CircleCI
2019-07-01 10:12:50 -07:00
Dan Finlay
07f55bc390 Disable release script from CircleCI
The MetaMask bot is currently failing to publish docs updates, and it is
[blocking our ability to release new
versions](https://github.com/MetaMask/metamask-extension/pull/6765).

While we should pursue a proper fix, I think it's worth disabling in the
meanwhile so this glitch doesn't interfere with our regular release
cadence further.
2019-07-01 09:54:49 -07:00
Akshit Kr Nagpal
d16d6f483c Validate txParams in TransactionStateManager.addTx (#6713)
* Normalize and Validate txParams in TransactionStateManager.addTx too

* Added Tests

* Updated normalizeAndValidateParams to return the new txParams
2019-06-29 00:51:51 +02:00
Dan Finlay
27a572d15a
Merge pull request #6764 from MetaMask/Version-6.7.1
Version 6.7.1
2019-06-27 22:37:36 -07:00
Mark Stacey
56088d8370 Version 6.7.1 2019-06-28 02:08:18 -03:00