1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-23 03:36:18 +02:00
Commit Graph

9410 Commits

Author SHA1 Message Date
Thomas Huang
d7a4dfebeb
Merge pull request #7260 from MetaMask/notranslate-seed-phrases
Do not transate on seed phrases
2019-10-07 11:08:22 -07:00
ryanml
3383eabc9d Use translated string for state log (#7255) 2019-10-07 14:54:44 -03:00
Thomas
aa95e5a4c8 Do not transate on seed phrases 2019-10-07 10:45:12 -07:00
Mark Stacey
8b5ac9340b Fix custom nonce placeholder type (#7243)
The placeholder for the custom nonce needed to be converted into a
string. The placeholder is omitted if `nextNonce` isn't set, as may be
the case for the initial render.
2019-10-02 18:12:52 -02:30
Thomas Huang
93b473d46d
Merge pull request #7244 from MetaMask/mark-3Box-sync-as-experimental
Mark 3Box sync as experimental
2019-10-02 13:35:17 -07:00
Mark Stacey
1369d0280d Mark 3Box sync as experimental
The initial release of the 3Box sync will be marked as experimental.
This is to allow us time to test the 3Box sync and reduce the load on
3Box's infrastructure.
2019-10-02 17:11:20 -03:00
Mark Stacey
9541d1e281
Don't wait for 3Box initialization during login (#7242)
The 3Box initialization is triggered by login, but it no longer blocks
the login from finishing. The 3Box initialization is designed to run in
the background, so there's no reason to block on it.
2019-10-02 16:12:20 -03:00
Dan J Miller
e6e8897434
Custom nonce fixes (#7240)
* Allow default nextNonce to be the custom nonce in cases where highest locally pending is higher than nextNonce

* Reset custom nonce in cases of transaction submission failures

* Make the recommended nonce in the custom nonce field the true 'nextNonce'

* Revert automatic setting of custom nonce to nextNonce

* Make the nextNonce the default placeholder value

* Fix getNextNonce

* Remove unused nonceFieldPlaceholder message

* Fix nits in getPendingNonce and getNextNonce

* Properly handle errors in getNextNonce

* Improve placeholder and value defaults in custom nonce field

* Remove custom error message from getNextNonce
2019-10-02 15:42:04 -02:30
Thomas Huang
45a8fdebf7 Update ETH logo, update deposit Ether logo height and width (#7239) 2019-10-02 10:15:44 -06:00
Dan J Miller
daf4fe439c Ensure 3box validation uses the correct address (#7235) 2019-10-01 10:03:13 -03:00
Mark Stacey
8d97bdc5c9
Fix error handling when checking for 3Box backup (#7232)
The 3Box SDK throws an HTTP 404 error when attempting to get the config
for an account that doesn't yet exist in 3Box. The regex we were using
to differentiate this error from others was broken. This ended up
preventing the user from logging in if they had 3Box enabled but hadn't
yet synced.

The regex has been corrected to catch this case, while allowing other
errors to propogate upward. Other 3Box errors will now be caught and
reported rather than interrupting login completely.

At some point in the future, we should expose these errors to the user
in some way, and allow them to retry in case 3Box was just temporarily
offline.
2019-10-01 10:01:57 -03:00
Thomas Huang
b69982da84 Remove logging of action.value of set_next_nonce (#7233) 2019-09-30 19:17:45 -03:00
Thomas Huang
67ab13b74b Master parity with developer/release (#7225)
* Version v7.2.2

* Add v7.2.2 to changelog
2019-09-27 10:35:38 -06:00
ricky
5f254f7325 Add advanced setting to enable editing nonce on confirmation screens (#7089)
* Add UseNonce toggle

* Get the toggle actually working and dispatching

* Display nonce field on confirmation page

* Remove console.log

* Add placeholder

* Set customNonceValue

* Add nonce key/value to txParams

* remove customNonceValue from component state

* Use translation file and existing CSS class

* Use existing TextField component

* Remove console.log

* Fix lint nits

* Okay this sorta works?

* Move nonce toggle to advanced tab

* Set min to 0

* Wrap value in Number()

* Add customNonceMap

* Update custom nonce translation

* Update styles

* Reset CustomNonce

* Fix lint

* Get tests passing

* Add customNonceValue to defaults

* Fix test

* Fix comments

* Update tests

* Use camel case

* Ensure custom nonce can only be whole number

* Correct font size for custom nonce input

* UX improvements for custom nonce feature

* Fix advanced-tab-component tests for custom nonce changes

* Update title of nonce toggle in settings

* Remove unused locale message

* Cast custom nonce to string in confirm-transaction-base.component

* Handle string conversion and invalid values for custom nonces in handler

* Don't call getNonceLock in tx controller if there is a custom nonce

* Set nonce details for cases where nonce is customized

* Fix incorrectly use value for deciding whether to getnoncelock in approveTransaction

* Default nonceLock to empty object in approveTransaction

* Reapply use on nonceLock in cases where customNonceValue in approveTransaction.

* Show warning message if custom nonce is higher than MetaMask's next nonce

* Fix e2e test failure caused by custom nonce and 3box toggle conflict

* Update nonce warning message to include the suggested nonce

* Handle nextNonce comparison and update logic in lifecycle

* Default nonce field to suggested nonce

* Clear custom nonce on reject or confirm

* Fix bug where nonces are not shown in tx list on self sent transactions

* Ensure custom nonce is reset after tx is created in background

* Convert customNonceValue to number in approve tranasction controller

* Lint fix

* Call getNextNonce after updating custom nonce
2019-09-27 00:30:36 -04:00
Dan J Miller
970e90ea70
Add migration on 3box imports and remove feature flag (#7209)
* Delete unused code

* Run threebox imports through migrations

* Remove 3box feature flag

* Remove unnecessary use of 'type' in threebox._updatePlugin

* Fix threebox controller getLastUpdated

* Turn off threebox by default

* Rename restoredFromThreeBox to showRestorePrompt

* Remove accientally added method from threebox controller

* Restore from threebox on import from unlock screen

* Throw on non 404 errors from Box.getconfig in new3Box
2019-09-26 03:24:52 -04:00
kumavis
e1efb4d7ac
ci - install deps - limit install scripts to whitelist (#7208)
* ci - install deps - limit install scripts to those needed for build

* Update .circleci/scripts/deps-install.sh

Co-Authored-By: Mark Stacey <markjstacey@gmail.com>

* ci - install deps - expand install scripts needed for tests

* ci - install deps - expand install scripts needed for integration tests

* ci - install deps - fix node-sass script ref

* github - set codeowners for scripts/deps-install

* development - add utility to show deps with install scripts

* lint fix

* deps - move read-installed to devDeps
2019-09-25 20:01:10 +08:00
Dan J Miller
1bd22b58c0
Add a/b test for full screen transaction confirmations (#7162)
* Adds ab test controller with a fullScreenVsPopup test

* Add migration for fullScreenVsPopup state

* Move abtest state under an 'abtests' object.

* MetaMask shows fullScreen group of a/b test unapproved txs in a full browser tab

* Ensure cancel metrics event in confirm-transaction-base.component.js is sent in all cases

* Switch to existing tab for unapproved tx if it exists when opening in full screen

* Send metrics event for entering a/b test from confirm screen

* Fix lint, unit and integration tests related to a/b test code

* Remove unnecessary tabs.query call in triggerUiInNewTab
2019-09-24 17:08:38 -04:00
Mark Stacey
0ad6e2ada8
Update minimum Firefox verison to 56.0 (#7213)
The previous minimum version of 56.2 resulted in the build failing
validation when it was uploaded to the Firefox web store, because that
version doesn't exist. It was set to that version because a Firefox
fork uses it.

Instead the minimum version has been reduced so that we pass
validation. Unfortunately this will mean that a single incompatible
version of Firefox Mobile will allow the extension to be installed
(in theory), but there was no other way to avoid cutting off support
to WaterFox (the Firefox fork). The warning about this from the addons
linter can be ignored for now.
2019-09-24 12:49:24 -03:00
kumavis
4d71f3f854 mesh-testing - submit infura rpc requests to mesh-testing container (#7031) 2019-09-23 02:54:41 -07:00
kumavis
f5b2977764
obs-store/local-store should upgrade webextension error to real error (#7207)
* obs-store/local-store should upgrade webextension error to real error

* lint fix

* local-store - allow lastError through unchanged if error-like
2019-09-23 11:45:20 +08:00
kumavis
8a1ddbbcd8
sesify-viz - bump dep for visualization enhancement (#7175)
* deps - bump sesify-viz for visualization enhancement

* deps - bump sesify-viz for visualization enhancement

* deps - bump sesify-viz for visualization enhancement

* deps - sesify-viz - use carrot version range

Co-Authored-By: Mark Stacey <markjstacey@gmail.com>

* deps - update yarn lockfile
2019-09-23 11:14:18 +08:00
Jenny Pollack
e86cebde3b address book entries by chainId (#7205) 2019-09-21 14:36:05 -03:00
Mark Stacey
e44a2283b5
Optimize images only during production build (#7194)
* Optimize images only during production build

Image optimization is fairly slow (over a minute), and isn't necessary
for test or development builds. It is now only run as part of the
`build` gulp task, which is used during `gulp dist`.

* Remove unused gulp tasks

There were two high-level tasks and one style formatting task that
were not used by any npm scripts, so were probably unused generally.

The `dev` task was a duplcate of `dev:extension`. The `build:extension`
task was useful for just building the extension without performing
other steps required by the final production bundle, but it was
broken. It didn't correctly build the ui-libs and bg-libs required.
Instead of fixing it, it has been removed until the handling of those
separate library bundles is simplified.

The style formatting task seems like it could be useful, but I'm unsure
about keeping it around as opt-in, as in practice it'll just end up
being ignored. Moreover the library authors themselves are recommending
switching to `prettier`, so I think we're better off removing it for
now, then considering using `prettier` if we want to introduce
something like this again.

The stylelint dependency was added because it's a peer dependency of
gulp-stylelint that should have already been listed among our
dependencies. It hadn't caused a problem before because it happened to
be a transitive dependency of gulp-stylefmt, which is no longer needed
 and has been removed.
2019-09-21 13:32:17 -03:00
Mark Stacey
b0ec610908
Use common test build during CI (#7196)
* Use common test build during CI

Previously both e2e test jobs were running `test:build`. Now there is a
separate job that runs `test:build` that runs before each e2e test job,
so that `test:build` is only run once instead of twice.

* Move test builds to separate directory

This prevents the test build from conflicting with the production build
in later jobs.
2019-09-21 13:32:07 -03:00
Mark Stacey
f100d753cf
Report missing en locale messages to Sentry (#7197)
Any missing messages in the `en` locale are now reported to Sentry as
errors. They are printed to the console as an error upon the first
encounter as well.

If a missing message is found during e2e testing, the error is thrown.
This will likely break the e2e test even if it isn't looking for
console errors, as the UI with the missing message will fail to render.

The `tOrDefault` method was updated to no longer attempt looking for
messages with a key that is a falsey value (e.g. `undefined`). There
are a few places where they key is determined dynamically, where it's
expected during the normal flow for it to be `undefined` sometimes.
In these cases we don't want the error to be thrown.
2019-09-21 13:31:45 -03:00
Mark Stacey
9f21317a30
Verify locales on CI (#7199)
* Add '--quiet' flag to verify locales script

The `--quiet` flag reduces the console output to just the essential
information for running in a CI environment. For each locale, it will
print the number of unused messages (if any).

* Add `verify-locales` script to lint CI job

The locales are now verified as part of the lint CI job. Any unused
messages detected will result in the job failing.
2019-09-21 13:31:33 -03:00
Marius van der Wijden
a869fd639b updated ganache and addons-linter (#7204) 2019-09-20 08:52:34 -03:00
Dan Finlay
85cbf8a894
Merge pull request #7173 from rekmarks/fix-errors
Fix RPC error messages
2019-09-19 09:40:11 -07:00
Erik Marks
710b00b7a1 fixup! add user rejected errors 2019-09-18 19:25:23 -07:00
Erik Marks
672ade33a6 add user rejected errors 2019-09-18 19:19:12 -07:00
Erik Marks
79e0a9c1a6 update json-rpc-engine 2019-09-18 19:19:10 -07:00
Erik Marks
58c5fe01bf use eth-json-rpc-errors 2019-09-18 19:17:31 -07:00
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
Mark Stacey
624139a00f
Remove unused components (#7191)
* Remove unused sendWarnings

The send warnings state and associated component is no longer used
anywhere.

* Remove unused subtitleParams

The `subtitleParams` SendHeader prop was being ignored. It has been
removed, along with associated selectors and tests.
2019-09-18 18:41:36 -03:00
Jenny Pollack
5b309afc2c
Merge pull request #7189 from MetaMask/add-goerli-to-incoming-tx
add goerli to incoming tx
2019-09-18 10:26:57 -07:00
Jenny Pollack
03f216e27c add goerli to incoming tx 2019-09-18 10:04:39 -07:00
Sunghee Lee
87ac07bb35 Refactor validation function (#7187)
* Update invalidBlockExplorerURL message

* Refactor validation function
2019-09-18 10:57:18 -03:00
Mark Stacey
638149d861
Remove unused modals (#7184)
These modals were no longer referenced anywhere.
2019-09-18 10:09:41 -03:00
Mark Stacey
8a08b320e5
Remove unused customize-gas modal (#7185)
This modal hasn't been used since #5704, where it was replaced.
2019-09-18 10:09:32 -03:00
Mark Stacey
c007fcab1a
master => develop (#7182)
* Version v7.1.1

* Version v7.2.0

* Version v7.2.1

* Update changelog for v7.2.1, v7.2.0, and v7.1.1
2019-09-17 19:47:42 -03:00
Sergej Müller
ef7d0192c1 Performance: Delivery optimized images (#7176) 2019-09-17 19:01:48 -03:00
Dan Finlay
79d88abe54
Merge pull request #7180 from MetaMask/add-app-name-messages
Add `appName` message to each locale
2019-09-17 14:00:51 -07:00
Mark Stacey
a0b9eff5c4 Add appName message to each locale
The Chrome Web store was rejecting the build because `appName` was
missing from some locales.
2019-09-17 17:26:19 -03:00
Mark Stacey
b5da8a237e
Remove the disk store (#7170)
The disk store has not been written to since MetaMask v4.3.0, as it was
removed in #3083. It was kept around so that anything written to disk
prior to v4.3.0 could still be restored.

It has been a year and a half since that release, so I think it's time
to remove the disk store altogether. The consequences of losing locally
stored data are small anyway - it's an inconvenience at worst.
2019-09-16 19:29:26 -03:00
Mark Stacey
3696e4c648
Update @hapi/subtext as per security advisory (#7172)
This change was advised by https://www.npmjs.com/advisories/1165
2019-09-16 17:54:29 -03:00
Sergej Müller
e7a0939f53 Add fixes for German translations (#7168) 2019-09-16 16:27:50 -04:00
Dan J Miller
5641f1be29
Fix recipient field of approve screen (#7171) 2019-09-16 17:05:21 -02:30
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
kumavis
bf72f39ff1
ci - metamaskbot - include links to dep-viz and all artifacts (#7155) 2019-09-16 12:19:15 +08:00
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