1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 19:26:13 +02:00
Commit Graph

989 Commits

Author SHA1 Message Date
Mark Stacey
48bf2f8731
Remove unused locale messages (#7190)
* Switch to using string literals for locale keys

Various message keys were being specified with a string template
instead of a string literal. They have been switched to use string
literals so that the script for detecting unused messages can find
them.

* Remove unused locale messages

A number of unused locale messages have been removed - probably
leftover from old UI elements that have since been removed.

The `verify_locale_strings` script has been augmented to search the UI
for string literals, and match those against the locale message keys in
the `en` locale. Any messages without a corresponding string literal
are assumed to be unused.

The script has also been updated with an optional `--fix` parameter,
which will automatically delete any unused messages from locales.

148 unused messages were found in this case, out of a total of about
650 messages. Another 70 messages are _potentially_ unused and require
further investigation, but weren't as easy to rule out because they
were found in string literals.

* Remove additional unused locale messages

The following messages were more difficult to rule out because they
were present as string literals in the UI. They do appear to be
unused as locale keys though.
2019-09-18 20:29:46 -03:00
Sergej Müller
ef7d0192c1 Performance: Delivery optimized images (#7176) 2019-09-17 19:01:48 -03:00
Dan J Miller
7985f4f4f8
3box integration 2.0 (#6972)
* Adds threebox controller

* Adds threebox approval modal

* Fix unit tests and lint after addition of threebox

* Correct threebox behaviour after rejecting request for backup; fixes e2e tests.

* Update threebox controller for automatic syncing

* Ensure frontend locale updates when preferences are changed via direct update within controller

* Add toggle in settings for 3box syncing

* Update threebox controller for latest 3box version

* Delete unnecessary frontend changes for threebox integration

* Backing up address book contacts with threebox

* Update unit tests for 3box-integration additions

* Only enable threebox by default for new wallets

* Mock globals for correct unit tests

* 3box '1.10.2' -> '^1.10.2'

* Correct capilalization on 3Box

* Use log.debug instead of console.log in threebox controller

* Update yarn.lock

* Remove edge build

* Split 3box module into background deps js file

* extra bundle opts for bg-libs

* sync yarn.lock

* new3Box logic

* Show confirm threebox restore after import

* Remove bg-libs.js from manifest file for dev builds

* Switch 3Box controller to using the spaces api (instead of the profile api)

* Finalize switching to spaces api and only restoring from 3box after import

* Update metamask-controller-test.js for threebox controller changes

* Make threebox modal style consistent with others and update success button wording

* Use mock 3box when in test

* Correct 3box modal header

* Remove unnecessary property of threebox controller provider

* Remove unnecessary method calls after restoration from 3box in the threebox-restore-confirm modal.

* Replace setThreeBoxSyncingPermission calls in routes/index.js with turnThreeBoxSyncingOn

* Replace erroneous use of  with

* Replace erroneous use of threeboxSyncing with threeBoxSyncingAllowed in advancted-tab directory

* Lint fixes for 3box changes

* Log errors encountered when updating 3Box

* Remove unnecessary parameter from state update

* Add timeout to initial 3Box sync

The initial 3Box sync will now timeout after 1 minute. If the timeout
is triggered, 3Box is disabled and cannot be re-enabled unless the
initial sync does finally finish. If it never finishes, 3Box cannot
be enabled unless the extension is reinstalled.

The Advanced Settings page was updated to show this option as disabled
in that circumstance, with a new discription explaining why it's
disabled. The UI here could certainly be improved.

Additionally, "on" and "off" labels were added to the toggle to match
the other toggles on the Advanced Settings page.

* Use non-minified 3Box module

We had previously used the minified 3Box module to avoid a build error
encountered when `envify` was processing the `libp2p` module (which is
used by 3Box). The build would fail because `esprima` (used by `envify`)
is incompatible with the object spread/rest operator (which is used in
`libp2p`).

That issue has been solved by adding a global Babelify transformation
specifically for transpiling out the object rest/spread operator from
dependencies. It has been targetted to only affect `libp2p` to avoid
extending the build time too much. This workaround can be used until
a new version of `esprima` is released that includes this bug fix.

* Use app key addresses for threebox

* Replace use of modal for confirming 3box restoration with a home notification

* Adds e2e tests for restoring from threebox

* Update eth-keyring-controller to 5.1.0

* Correct parameters passed to getAppKeyAddress in threebox.js

* Add prefix to origin passed to getAppKeyAddress in threebox.js

* Remove unused locale message.

* Prevent CORS errors in firefox e2e tests

* Ensure extraneous scripts are excluded from the local test dev build

* Move threeBoxLastUpdate state from home.component to redux

* Threebox PR code cleanup

* Always use first address when initializing threebox

* Replace setRestoredFromThreeBox api with setRestoredFromThreeBoxToFalse and setRestoredFromThreeBoxToTrue

* Update development/metamaskbot-build-announce.js to include ui-libs and bg-libs in hard coded bundle list

* Update test/e2e/threebox.spec.js to use new helpers added with pull #7144

* Make setFeatureFlag available on the ui window during testing

* Hide threebox feature behind a feature flag that can only be activated via dev console

* Remove unnecessary migration of threebox feature flag

* Prevent this.init() call in threebox constructor if feature flag is not turned on

* Prevent threebox notification from showing if feature flag is falsy

* http://localhost/8889 -> http://localhost/* in gulp manifest:testing tasks
2019-09-16 14:41:01 -02:30
Mark Stacey
95b4d91116
Replace undefined selectedAddress with null (#7161)
* Replace `undefined` selectedAddress with `null`

The `runtime.Port.postMessage` API will drop keys with a value of
`undefined` on Chrome, but not on Firefox. This was a problem for the
`publicConfig` stream, which passed the key `selectedAddress` with the
value of `undefined` to communicate to dapps that the user had logged
out.

Instead a `null` is now passed for `selectedAddress` upon logout, which
is correctly sent by the `runtime.Port.postMessage` API on both Chrome
and Firefox.

closes #7101
closes #7109

* Update `metamask-inpage-provider` to v3.0.0

The v3.0.0 update includes a change to the `accountsChanged` event. The
event will now emit an empty array instead of an array with `undefined`
or `null`.

The previous behavior was to emit `[undefined]`. The previous commit
would have changed that to `[null]` anyway, so we figured if we're
going to make a public-facing change to the event anyway we should
change it to be correct. `[undefined]` was never intended, and it
technically violates EIP-1193, which states that the `accountsChanged`
event should emit an array of strings.
2019-09-13 11:32:55 -03:00
Mark Stacey
50e9c4e5ad
Add polyfill for AbortController (#7157)
The AbortController is used in both the background and the UI. Support
for AbortController was added to Chrome in version 66, which is above
our minimum supported version.

I did consider increasing the minimum Chrome version to 66, but we have
a decent number of users still on Chrome 65 unfortunately.
2019-09-12 17:07:27 -03:00
kumavis
629f5ef221
ci - create source-map-explorer build-artifacts (#7141)
* ci - create source-map-explorer build-artifacts

* ci - add source-map-explorer builds to metamaskbot comment

* lint fix

* ci - source-map-explorer - include all bundles
2019-09-11 23:35:30 +08:00
kumavis
0985e8f012
ci - build-artifacts - generate sesify-viz for inspecting deps (#7151)
* ci - build-artifacts - generate sesify-viz for inspecting deps

* lint fix
2019-09-11 22:47:21 +08:00
kumavis
86e69b6a22 deps - move gulp-terser-js to devDeps 2019-09-11 01:02:48 +08:00
kumavis
72fd15e828 build - replace gulp-uglify-es with gulp-terser-js 2019-09-10 16:48:09 +08:00
Dan J Miller
7af902e500
Make chainId available in the metamask-inpage-provider (#7110)
* Make chainId available in the metamask-inpage-provider

* Update metamask-inpage-provider to 2.1.0

* Add e2e tests for ethereum.on events

* Move chainId constants to lib/enums.js

* Don't use new chainId enums in createInfuraClient

* Fix app/scripts/lib/select-chain-id.js
2019-09-09 22:01:34 -02:30
Whymarrh Whitby
0422930575
Bump eth-json-rpc-middleware dependency (#7128)
* Update eth-json-rpc-middleware to @^4.2.0

* Resolve all eth-json-rpc-middleware to 4.2.0
2019-09-09 14:53:13 -04:00
Nick Doiron
d589d2dec0 Right-to-left CSS (using module for conversion) (#7072)
* Create RTL stylesheets using `gulp-rtl`

* Handle RTL stylesheet special cases

Certain blocks of Sass  were set to bypass "rtlcss" using ignore
comments. Certain icons had to be flipped 180 degrees.

* Switch stylesheets when locale changes

A second stylesheet has been added to each HTML page for use with
right-to-left locales. It is disabled by default. It is enabled on
startup if a RTL locale is set, and when switching to a RTL locale.
Similarly the LTR stylesheet is disabled when a RTL locale is used.

Unfortunately there is an unpleasant flash of unstyled content when
switching between a LTR and a RTL locale. There is also a slightly
longer page load time when using a RTL locale (<1s difference). We
couldn't think of an easy way to avoid these problems.

* Set `dir="auto"` as default on `TextFields`
2019-09-03 14:47:54 -03:00
Erik Marks
4e29fb97d6
Remove Babel 6 from internal dependencies (#7037)
remove babel@6 from internal deps

update internal deps to latest published versions
2019-08-26 10:07:44 -06:00
Whymarrh Whitby
6dfc16f0fc
Add lint:changed script entry to lint only changed files (#7055) 2019-08-22 09:21:16 -02:30
Whymarrh Whitby
6bc1077880
Make Coveralls its own optional CI job (#7002)
* ci: Move Coveralls into optional step

* Split Coveralls step out of test:coverage npm script
2019-08-13 13:29:10 -02:30
Bruno Barbieri
835d4fbb13
Update mobile sync (#6967)
* update mobile sync

* update lockfile
2019-08-06 15:33:41 -04:00
Mark Stacey
6a0dbcdb31
Upgrade to Babel 7 (#6942)
Babel 7 moved to a new configuration format, and they've scoped all of
their packages under `@babel/`. This brings MetaMask in-line with
dependencies we use that _already_ use Babel 7, and it eliminates a
few unfortunate edge cases that can prevent dependencies from being
correctly transpiled.
2019-08-02 13:17:20 -02:30
Dan J Miller
3eff478775
I5849 incremental account security (#6874)
* Implements ability to defer seed phrase backup to later

* Adds incremental-security.spec.js, including test dapp that sends signed tx with stand alone localhost provider

* Update metamask-responsive-ui for incremental account security changes

* Update backup-notification style and fix responsiveness of seed phrase screen

* Remove uneeded files from send-eth-with-private-key-test/

* Apply linguist flags in .gitattributes for send-eth-with-private-key-test/ethereumjs-tx.js

* Improve docs in controllers/onboarding.js

* Clean up metamask-extension/test/e2e/send-eth-with-private-key-test/index.html

* Remove unnecessary newlines in a couple first-time-flow/ files

* Fix import of backup-notification in home.component

* Fix git attrs file
2019-08-02 01:27:26 -02:30
Whymarrh Whitby
e9a63d5d5b
Default Privacy Mode to ON, allow force sharing address (#6904) 2019-08-01 10:54:33 -02:30
Dan J Miller
e9c7df28ed
Address book send plus contact list (#6914)
* Style Send Header

* Move Send to-row to send view and restyle

* Add "Recents" group to select recipient view

* Rename SendToRow to AddRecipient

* Basic UI and Layout

* New ENSInput component

* wip - fuzzy search for input

* small refactor

* Add Dialog

* contact list initial

* initial error on invalid address

* clean up edit

* Click to open modal

* Create AddToAddressBookModal component

* Modal styling and layout

* modal i18n

* Add to Addressbook

* ens wip

* ens wip

* ENS Resolution

* Reset input

* Send to explicit address

* Happy Path Complete

* Add back error checking

* Reset send-to when emptying input

* Add back warning object

* Fix linter

* Fix unit test #1 - fix import paths

* Remove dead tests

* One more to go

* Fix all unit tests

* add unit test for reducers and actions

* test rendering AddRecipient

* Add tests for dialog boxes in AddRecipient

* Add test for validating

* Fix linter

* Fix e2e tests

* Token send e2e fix

* Style View Contact

* Style edit-contact

* Fix e2e

* Fix from-import-beta-ui e2e spec

* Make section header say "add recipient” by default

* Auto-focus add recipient input

* Update placeholder text

* Update input title font size

* Auto advance to next step if user paste a valid address

* Ellipsify address when recipient is selected

* Fix app header background color on desktop

* Give each form row a margin of 16px

* Use .container/.component naming pattern for ens-input

* Auto-focus on input when add to addressbook modal is opened; Save on Enter

* Fix and add unit test

* Fix selectors name in e2e tests

* Correct e2e test token amount for address-book-send changes

* Adds e2e test for editing a transaction

* Delete test/integration/lib/send-new-ui.js

* Add tests for amount max button and high value error on send screen to test/e2e/metamask-ui.spec.js

* lint and revert to address as object keys

* add chainId based on current network to address book entry

* fix test

* only display contacts for the current network

* Improve ENS message when not found on current network

* Add error to indicate when network does not support ENS

* bump gaba

* address book, resolve comments

* Move contact-list to its own component

* De-duplicate getaddressbook selector and refactor name selection logic in contact-list-tab/

* Use contact-list component in contact-list-tab.component (i.e. in settings)

* Improve/fix settings headers for popup and browser views

* Lint fixes related to address book updates

* Add 'My accounts' page to settings address book

* Update add new contact button in settings to match floating circular design

* Improve styles of view contact page

* Improve styles and labels of the add-contact.component

* Further lint fixes related to address book updates

* Update unit tests as per address book updates

* Ensure that contact list groups are sorted alphabetically

* Refactor settings component to use a container for connection to redux; allow display of addressbook name in settings header

* Decouple ens-input.component from send context

* Add ens resolution to add contact screen in settings

* Switching networks when an ens address is shown on send form removes the ens address.

* Resolve send screen search for ensAddress to matching address book entry if it exists

* Show resolved ens icon and address if exists (settings: add-contact.component)

* Make the displayed and copied address in view-contact.component the checksummed address

* Default alias state prop in AddToAddressBookModal to empty string

* Use keyCode to detect enter key in AddToAddressBookModal

* Ensure add-contact component properly updates after QR code detection

* Fix display of all recents after clicking 'Load More' in contact list

* Fix send screen contact searching after network switching

* Code cleanup related to address book changes

* Update unit tests for address book changes

* Update ENS name not found on network message

* Add ens registration error message

* Cancel on edit mode takes user back to view screen

* Adds support for memo to settings contact list view and edit screens

* Modify designs of edit and view contact in popup environment

* Update settings content list UX to show split columns in fullscreen and proper internal navigation

* Correct background address book API usages in UI
2019-07-31 17:26:44 -02:30
Mark Stacey
1fd3dc9ecf
Switch from npm to yarn (#6843)
As a solution to the constant lockfile churn issues we've had with
`npm`, the project now uses `yarn` to manage dependencies.

The `package-lock.json` file has been replaced with `yarn.lock`, which
was created using `yarn import`. It should approximate the contents of
`package-lock.json` fairly well, though there may be some changes due to
deduplication. The codeowners file has been updated to reference this
new lockfile.

All documentation and npm scripts have been updated to reference `yarn`
rather than `npm`. Note that running scripts using `npm run` still works
fine, but it seemed better to switch those to `yarn` as well to avoid
confusion.

The `npm-audit` Bash script has been replaced with `yarn-audit`. The
output of `yarn audit` is a bit different than `npm audit` in that it
returns a bitmask to describe which severity issues were found. This
made it simpler to check the results directly from the Bash script, so
the associated `npm-audit-check.js` script was no longer required. The
output should be exactly the same, and the information is still sourced
from the same place (the npm registry).

The new `yarn-audit` script does have an external dependency: `jq`.
However, `jq` is already assumed to be present by another CI script, and
is present on all CI images we use. `jq` was not added to `package.json`
as a dependency because there is no official package on the npm
registry, just wrapper scripts. We don't need it anywhere exept on CI
anyway.

The section in `CONTRIBUTING` about how to develop inside the
`node_modules` folder was removed, as the advice was a bit dated, and
wasn't specific to this project anyway.
2019-07-30 15:36:23 -03:00
Alessandro Ricottone
e81aa6073d Resolve onion addresses (#6869)
* Resolve onion address
* npm i content-hash@latest
2019-07-23 16:59:20 -02:30
Whymarrh Whitby
2788a9463f Bump eth-sig-util to 2.3.0 (#6896)
* Bump eth-sig-util to 2.3.0

* Bump eth-keyring-controller to 4.x
2019-07-23 12:23:42 -07:00
Mark Stacey
0f8a9a5d49
Serve CSS as an external file (#6894)
The CSS is now served as an external file instead of being injected.
This was done to improve performance. Ideally we would come to a middle
ground between this and the former behaviour by injecting only the CSS
that was required for the initial page load, then lazily loading the
rest. However that change would be more complex. The hope was that
making all CSS external would at least be a slight improvement.

Performance metrics were collected before and after this change to
determine whether this change actually helped. The metrics collected
were the timing events provided by Chrome DevTools:

* DOM Content Loaded (DCL) [1]
* Load (L) [2]
* First Paint (FP) [3]
* First Contentful Paint (FCP) [3]
* First Meaningful Paint (FMP) [3]

Here are the results (units in milliseconds):

Injected CSS:

| Run | DCL | L | FP | FCP | FMP |
| :--- | ---: | ---: | ---: | ---: | ---: |
| 1 | 1569.45 | 1570.97 | 1700.36 | 1700.36 | 1700.36 |
| 2 | 1517.37 | 1518.84 | 1630.98 | 1630.98 | 1630.98 |
| 3 | 1603.71 | 1605.31 | 1712.56 | 1712.56 | 1712.56 |
| 4 | 1522.15 | 1523.72 | 1629.3 | 1629.3 | 1629.3 |
| **Min** | 1517.37 | 1518.84 | 1629.3 | 1629.3 | 1629.3 |
| **Max** | 1603.71 | 1605.31 | 1712.56 | 1712.56 | 1712.56 |
| **Mean** | 1553.17 | 1554.71 | 1668.3 | 1668.3 | 1668.3 |
| **Std. dev.** | 33.41 | 33.43 | 38.16 | 38.16 | 38.16 |

External CSS:

| Run | DCL | L | FP | FCP | FMP |
| :--- | ---: | ---: | ---: | ---: | ---: |
| 1 | 1595.4 | 1598.91 | 284.97 | 1712.86 | 1712.86 |
| 2 | 1537.55 | 1538.99 | 199.38 | 1633.5 | 1633.5 |
| 3 | 1571.28 | 1572.74 | 268.65 | 1677.03 | 1677.03 |
| 4 | 1510.98 | 1512.33 | 206.72 | 1607.03 | 1607.03 |
| **Min** | 1510.98 | 1512.33 | 199.38 | 1607.03 | 1607.03 |
| **Max** | 1595.4 | 1598.91 | 284.97 | 1712.86 | 1712.86 |
| **Mean** | 1553.8025 | 1555.7425 | 239.93 | 1657.605 | 1657.605 |
| **Std. dev.** | 29.5375 | 30.0825 | 36.88 | 37.34 | 37.34 |

Unfortunately, using an external CSS file made no discernible improvement
to the overall page load time. DCM and L were practically identical, and
FCP and FMP were marginally better (well within error margins).

However, the first paint time was _dramatically_ improved. This change
seems worthwhile for the first paint time improvement alone. It also
allows us to delete some code and remove a dependency.

The old `css.js` module included two third-party CSS files as well, so
those have been imported into the main Sass file. This was easier than
bundling them in the gulpfile.

The resulting CSS bundle needs to be served from the root because we're
using a few `@include` rules that make this assumption. We could move
this under `/css/` if desired, but we'd need to update each of these
`@include` rules.

Relates to #6646

[1]: https://developer.mozilla.org/en-US/docs/Web/Events/DOMContentLoaded
[2]: https://developer.mozilla.org/en-US/docs/Web/Events/load
[3]: https://developers.google.com/web/fundamentals/performance/user-centric-performance-metrics
2019-07-23 14:10:13 -03:00
Mark Stacey
2a7278eb7e
Remove Babel transformations for older browser versions (#6812)
The Babel config had previously supported all browsers with greater than
0.25% global usage (according to `browserlist`). This resulted in
`babel-preset-env` including plugins sufficient to support the following
minimum browser versions:

```
{
  "chrome": "49",
  "android": "4.4",
  "edge": "16",
  "firefox": "52",
  "ios": "9.3",
  "safari": "11"
}
```

Instead, the babel config now explicitly supports chrome >= 58 and
firefox >= 53. Chrome and Firefox are the only browsers we currently
publish to, and these were the minimum versions with no additional Babel
transformations.

The minimum browser versions we support should be re-evaluated later,
when we have added tests and documentation.

The plugin 'transform-async-to-generator' has also been removed. It was
used to translate async/await, but our browser targets all support
async/await.

Removing some of these transformations exposed bugs in `uglify-es` that
only presented themselves in the production build. `gulp-uglify-es` has
been updated to a version that uses `terser` instead of `uglify-es`,
which has resolved these issues.

Relates to #6805
2019-07-18 18:17:20 -03:00
Mark Stacey
32fffe53f5
Remove Drizzle tests (#6855)
The Drizzle tests have not been used for some time. They were used to
ensure compatibility with newer versions of `web3` v1. If we want to
re-add tests to ensure compatibility with newer `web3` versions, we
should find some way of doing that more reliably than was done here -
these tests were somewhat flaky and unreliable.
2019-07-15 17:10:46 -03:00
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
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
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
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
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
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
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
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
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
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
Mark Stacey
b9f69b535f
Generate complete source maps (#6756)
The source maps generated previously were mapping the bundled files to
the post-Babel files - they weren't showing mapping to the source files
as written.

It looks like this was a result of `reactify` being used in addition to
babel - that transformation must have dropped the source maps.

`reactify` still needs to be listed as a dependency because it is
an unlisted requirement of the `boron` package, which we use. We don't
need to use it to create our bundles though, as Babel already performs
the transformations we need.
2019-06-27 11:28:29 -03:00
Whymarrh Whitby
a6246f38f5
Merge pull request #6736 from whymarrh/unused-deps
Remove unused dependencies
2019-06-24 18:09:36 -02:30
Mark Stacey
225eaa65cc Fix 'watch' npm script
The `watch` npm script did not work - it must have gone unused for some
time. The following changes were required for it to work:
* Use the `--watch` flag, rather than the `watch` command (which appears
to not exist)
* Set the `METAMASK_ENV` environment variable to "test"
* Include the tests in the `ui` directory
* require the `test/setup.js` file before running the tests

The reporter was also changed to `min`, which is generally recommended
for use with the `--watch` flag.
2019-06-24 17:11:50 -03:00
Whymarrh Whitby
487508276e Uninstall unused jshint-stylish 2019-06-20 21:28:01 -02:30
Whymarrh Whitby
13c40eb1eb Uninstall unused prompt 2019-06-20 21:28:01 -02:30
Whymarrh Whitby
8039c8edc9 Sort deps correctly 2019-06-20 21:27:47 -02:30
Whymarrh Whitby
1994f33913 Uninstall unused react-addons-test-utils & react-testutils-additions 2019-06-20 21:27:47 -02:30
Whymarrh Whitby
7acc6d991c Uninstall unused sandwich-expando, semaphore, semver, & shallow-copy 2019-06-20 21:27:47 -02:30
Whymarrh Whitby
579f491e55 Uninstall unused react-markdown dependency 2019-06-20 21:27:47 -02:30
Whymarrh Whitby
7574f3df1e Uninstall unused pumpify 2019-06-20 21:27:47 -02:30
Whymarrh Whitby
35e2b7a1de Uninstall unused pojo-migrator 2019-06-20 21:27:47 -02:30
Whymarrh Whitby
5236fb733e Uninstall unused multiplex 2019-06-20 21:27:47 -02:30
Whymarrh Whitby
1866f4b4af Uninstall unused fast-levenshtein 2019-06-20 21:27:47 -02:30
Whymarrh Whitby
4d4ce8a2a5 Uninstall unused lodash.uniqby 2019-06-20 21:27:47 -02:30
Whymarrh Whitby
6c511f8fd0 Uninstall unused eth-hd-keyring 2019-06-20 21:27:47 -02:30
Whymarrh Whitby
5821e8e16b Uninstall unused lodash.memoize 2019-06-20 21:27:47 -02:30
Whymarrh Whitby
c8d3c39383 Uninstall unused hat 2019-06-20 21:27:47 -02:30
Whymarrh Whitby
9c13d74e7e Uninstall unused identicon.js 2019-06-20 21:27:47 -02:30
Whymarrh Whitby
77a515fbc4 Uninstall unused extension-link-enabler 2019-06-20 21:27:47 -02:30
Whymarrh Whitby
d2711513c0 Uninstall unused eth-bin-to-ops 2019-06-20 21:27:47 -02:30
Whymarrh Whitby
61d75bedea Uninstall unused ensnare 2019-06-20 21:27:47 -02:30
Whymarrh Whitby
748801f417 4byte fallback (#6551)
* Adds 4byte registry fallback to getMethodData() (#6435)

* Adds fetchWithCache to guard against unnecessary API calls

* Add custom fetch wrapper with abort on timeout

* Use opts and cacheRefreshTime in fetch-with-cache util

* Use custom fetch wrapper with timeout for fetch-with-cache

* Improve contract method data fetching (#6623)

* Remove async call from getTransactionActionKey()

* Stop blocking confirm screen rendering on method data loading, and base screen route on transactionCategory

* Remove use of withMethodData, fix use of knownMethodData, in relation to transaction-list-item.component

* Load data contract method data progressively, making it non-blocking; requires simplifying conf-tx-base lifecycle logic.

* Allow editing of gas price while loading on the confirm screen.

* Fix transactionAction component and its unit tests.

* Fix confirm transaction components for cases of route transitions within metamask.

* Only call toString on id if truthy in getNavigateTxData()

* Fix knownMethodData retrieval and data fetching from fourbyte
2019-06-18 09:47:14 -02:30
Thomas Huang
f897f414fe pin ethereumjs-tx (#6706) 2019-06-11 17:24:47 +02:00
Whymarrh Whitby
569a8e5945 Successful `npm audit' with all required pkgs 2019-06-06 13:33:38 -02:30
Whymarrh Whitby
a1848983f8 npm audit: Works with gaba but w/o ganache-core 2019-06-06 13:33:32 -02:30
Whymarrh Whitby
1ad52a878d npm audit: Break karma, 1 less low, 1 less high 2019-06-06 13:33:16 -02:30
Whymarrh Whitby
84a949b298 npm audit: Use eth-json-rpc-infura@3 2019-06-06 13:33:04 -02:30
Whymarrh Whitby
c36662f3b0 Move eth-json-rpc-middleware into prod dependencies 2019-06-06 13:32:47 -02:30
Whymarrh Whitby
13feeb25d5 Break Storybook-related pkgs to reduce listed vulnerabilities 2019-06-06 13:32:08 -02:30
Whymarrh Whitby
6239d189cb npm audit fix 2019-06-06 13:32:08 -02:30
Whymarrh Whitby
acfd438329 npm audit: Works with eth-trezor-keyring 2019-06-06 13:32:43 -02:30
Whymarrh Whitby
41ebc2e127 npm audit: Works with eth-ledger-bridge-keyring 2019-06-06 13:32:38 -02:30
Whymarrh Whitby
d52f319a32 npm audit: Works with eth-json-rpc-middleware 2019-06-06 13:32:34 -02:30
Whymarrh Whitby
3dd19bd834 npm audit: Works with eth-json-rpc-filters 2019-06-06 13:32:30 -02:30
Whymarrh Whitby
048ac8af10 npm audit: Works with eth-json-rpc-infura 2019-06-06 13:32:22 -02:30
Whymarrh Whitby
d961454949 Add ethereumjs-tx dependency back 2019-06-06 13:32:08 -02:30
Whymarrh Whitby
95be7d5def Successful `npm audit' run w/o some packages
The following packages have been removed as I work to figure out what is causing
npm audit to produce errors:

eth-json-rpc-filters
eth-json-rpc-infura
eth-json-rpc-middleware
eth-ledger-bridge-keyring
eth-trezor-keyring
ethereumjs-tx
gaba

These packages will slowly be added back in forthcoming commits.
2019-06-06 13:30:14 -02:30
Paul Bouchon
47024fd9a5
feature: integrate gaba/CurrencyRateController (#6570) 2019-05-31 18:14:22 -04:00
pldespaigne
9a658ee53d merge 2019-05-30 18:22:55 +02:00
pldespaigne
9b87aaae19 update package 2019-05-30 12:21:45 +02:00
Frankie
2b5c7b82a9
transactions/deps - use broken out nonce-tracker module (#6555) 2019-05-21 17:17:09 +02:00
bitpshr
77d3bc252d feature: integrate gaba/PhishingController 2019-05-08 17:56:52 -04:00
Chi Kei Chan
56ed189aeb
Auto logout after specific time (#6558)
* Add i18n strings

* Finish Auto timeout

* Fix linter

* Fix copies

* Add unit test to Advanced Tab component

* Add back actions and container

* Add basic test to ensure container completeness

* No zero, fix linters

* restrict negative in input
2019-05-08 11:57:21 -07:00
Thomas
d8a96e6898 Bump eth-json-rpc-filters and eth-contract-metadata 2019-05-08 09:20:53 -07:00
Chi Kei Chan
581128503c Allow dragging seed phrase during Confirm Seed Phrase (#6557)
* Add basic drag and drop functionality

* Refactor seed phrase data structure

* Insert to list when drop

* Save before refactor

* Finish DND

* Fix linter

* update package-lock.json

* Address styling feedbacks

* Add box shadow on hover

* Finish adding unit tests

* Remove describe.only
2019-05-07 12:33:26 -02:30
Dan J Miller
64ae8131de
Adds NPM scripts for running a dapp, and dapp + chain, locally. (#6565) 2019-05-06 12:01:34 -02:30
pldespaigne
8cb6bd34e0 update content-hash 2019-05-04 18:56:26 +02:00
kumavis
2845398c3d Refactor ProviderApprovalController to use rpc and publicConfigStore (#6410)
* Ensure home screen does not render if there are unapproved txs (#6501)

* Ensure that the confirm screen renders before the home screen if there are unapproved txs.

* Only render confirm screen before home screen on mount.

* inpage - revert _metamask api to isEnabled isApproved isUnlocked
2019-05-03 13:32:05 -04:00
Dan J Miller
7d59e892e3 Update to eth-method-registry@1.2.0 (#6403) 2019-04-17 15:51:21 -02:30
Sneh Koul
fb22fb12ca Adds e2e test for most web3 methods that dapps use (#6160)
* schema added

* ui for the dapp added and schema.js changed according to the comments in PR

* added tests for all web3 methods

* Update run-all.sh

* Update web3.spec.js to work with new onboarding flow

* changes made according to the comments

* Create stand alone script for web3 e2e tests.

* Lint fixes for web3 e2e tests.
2019-04-16 15:29:11 -02:30
Esteban Mino
7c38ad9356 bump contract metadata 2019-04-12 12:26:39 -04:00
Esteban Miño
55cb4bf907
pin eth-contract-metadata to last commit hash (#6396) 2019-04-04 15:49:10 -03:00
pldespaigne
dc4c40414e issue#5742 2019-04-04 17:15:57 +02:00
Bruno Barbieri
fee0da1ca3
bump ledger and trezor keyring (#6395) 2019-04-03 16:05:52 -04:00
Whymarrh Whitby
7fc84f3cc0 ci: Add build:test Gulp task for e2e build 2019-03-29 11:13:39 -02:30
Dan Miller
a44f2bb6eb Use webRequest to cancel all requests to infura in e2e tests. 2019-03-28 16:20:11 -02:30
Whymarrh Whitby
a702ade3fe Bump gaba version to avoid broken eth-contract-metadata 2019-03-20 17:01:15 -02:30