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

9367 Commits

Author SHA1 Message Date
Erik Marks
58c5fe01bf use eth-json-rpc-errors 2019-09-18 19:17:31 -07: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
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
Mark Stacey
a00493fdbd
Remove redundant error logging (#7158)
The `_fetchAll` function is expected to return values, so catching
errors and logging them only results in an additional error at the
place where `_fetchAll` is called. It's better instead to let the
error get thrown as normal.

In this particular case `_fetchAll` is only called in once place. The
error is still correctly caught and logged (in the `_update` function)
2019-09-12 17:00:35 -03:00
Mark Stacey
34440d63eb
Set minimum Firefox version to v56.2 to support Waterfox (#7156)
The minimum compatible version of Firefox has been lowered from `60.0`
to `56.2`. It was originally set to `60.0` because that is Firefox ESR,
which currently the minimum Firefox version with security updates.
However Waterfox is based upon Firefox `56.0`, and has backported
security fixes from the ESR release.

This change in minimum version requires no additional transpiling, and
doesn't affect any browser APIs we use.

It does introduce one additional warning in the `addon-linter` about
Firefox for Android `56` lacking support for browser action popups.
However there is no version `56.2` of Firefox for Android, so the
minimum version remains `57` in practice (which does support browser
action popups).
2019-09-12 16:55:20 -03:00
kumavis
dbbf6986d2
ci - install deps with "--har" flag to capture network activity (#7143)
* ci - install deps with "--har" flag to capture network activity

* ci - add yarn install HAR logs to build-artifacts

* ci - yarn har - fix typo

* Update .circleci/scripts/collect-har-artifact.sh

Co-Authored-By: Mark Stacey <markjstacey@gmail.com>
2019-09-12 00:03:47 +08: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
Mark Stacey
c9fffafd9a
Publish GitHub release from master branch (#7136)
* Publish GitHub release from master branch

This ensures that changes made on `develop` since branching for the
release are not included. It also ensures that the final release
sourcemaps line-up correctly (they were always build on master)`.

* Consolidate publish jobs

The jobs `job-publish-release` and `create_github_release` both handle
different parts of publishing a release. They have been consolidated
into a single `job-publish-release` job.

* Update release script to expect a merge commit

The release script was originally written to be run on `develop`, so it
expected the current commit to be a result of `Squash & Merge`. Now
that it's run on `master`, it will generally be run against a merge
commit.

The version is now extracted from the commit message using a regular
expression that should work on all version of Bash v3+, and should be
tolerant of both merge commits and `Squash & Merge` commits.

* Target `master` with release PR

`master` is now targeted by the release PR instead of `develop`, as
the release has to be created from the master branch.

The update to `develop` is handled after the release by a PR from
`master` to `develop`, which is created automatically after the
release.
2019-09-11 11:44:36 -03:00
Erik Marks
38f6550951 fix rinkeby spelling (#7148) 2019-09-10 12:51:34 -10:00
kumavis
f402d09980
Merge pull request #7139 from MetaMask/build-terser
build - replace gulp-uglify-es with gulp-terser-js
2019-09-11 01:34:39 +08:00
kumavis
e8d1f16400
Merge pull request #7144 from MetaMask/test-e2e-refactor
Test - small refactor of e2e
2019-09-11 01:32:22 +08:00
kumavis
75238fc918
Merge pull request #7146 from MetaMask/gource-viz
dev - move gource instructions from docs to development script
2019-09-11 01:04:06 +08:00
kumavis
86e69b6a22 deps - move gulp-terser-js to devDeps 2019-09-11 01:02:48 +08:00
kumavis
ef3f7b77f2 test:integration - fix renamed test data file 2019-09-11 00:13:21 +08:00
kumavis
8eb3e4705a lint fix 2019-09-11 00:11:49 +08:00
kumavis
b2e1f14039 test:e2e - fix bail condition 2019-09-10 23:45:43 +08:00
kumavis
ded3b7df62 test:e2e - fix responsie argument 2019-09-10 23:43:59 +08:00
kumavis
d2376ac268 test:e2e - refactor missed spec file 2019-09-10 23:43:41 +08:00
kumavis
17e7b1a8cb test:e2e - only overwrite window.fetch once per session 2019-09-10 23:10:24 +08:00
kumavis
43007555bd test:e2e - rework fetch-mocks 2019-09-10 23:04:03 +08:00
kumavis
59f18e3207 dev - move gource instructions from docs to development script 2019-09-10 22:05:16 +08:00
kumavis
581763d510 test:e2e - add extra delay before closing popups 2019-09-10 21:05:03 +08:00
kumavis
95b1cfd282 test:e2e - factor out prepareExtensionForTesting 2019-09-10 21:05:03 +08:00
kumavis
3afd69b3ec test - e2e - dedupe fetchMocking + compose script as fn 2019-09-10 21:05:03 +08:00
Mark Stacey
db3d754205
Update the changelog for v7.1.1 (#7145)
Due to a mistake in the release scripts, there were a few changes
accidentally included in the v7.1.1 release. This updates the changelog
to include those changes.
2019-09-10 09:44:24 -03:00
kumavis
72fd15e828 build - replace gulp-uglify-es with gulp-terser-js 2019-09-10 16:48:09 +08:00
Sunghee Lee
869c83fd2c Fix network-form block explorer URL validation (#7137) 2019-09-09 23:51:05 -03: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
Mark Stacey
0ffee10f19
Prevent invalid inline speed-ups (#7085)
Speeding up anything but the pending transaction with the lowest nonce
is ineffectual, as the transaction with the lowest nonce blocks the
others from completing first. The inline speed-up button in the
transaction activity log has been removed for these invalid cases.

The button will show up in the activity log for the pending transaction
with the lowest nonce, but not for the others.

Closes #6844
2019-09-09 16:59:00 -03:00
dependabot[bot]
0dd273b3e5 Bump mixin-deep from 1.3.1 to 1.3.2 (#7132)
Bumps [mixin-deep](https://github.com/jonschlinkert/mixin-deep) from 1.3.1 to 1.3.2.
- [Release notes](https://github.com/jonschlinkert/mixin-deep/releases)
- [Commits](https://github.com/jonschlinkert/mixin-deep/compare/1.3.1...1.3.2)

Signed-off-by: dependabot[bot] <support@github.com>
2019-09-09 15:42:44 -04:00
dependabot[bot]
a65c546a89 Bump lodash-es from 4.17.4 to 4.17.15 (#7131)
Bumps [lodash-es](https://github.com/lodash/lodash) from 4.17.4 to 4.17.15.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.4...4.17.15)

Signed-off-by: dependabot[bot] <support@github.com>
2019-09-09 15:41:39 -04:00
dependabot[bot]
9c91cb9a7b Bump eslint-utils from 1.3.1 to 1.4.2 (#7130)
Bumps [eslint-utils](https://github.com/mysticatea/eslint-utils) from 1.3.1 to 1.4.2.
- [Release notes](https://github.com/mysticatea/eslint-utils/releases)
- [Commits](https://github.com/mysticatea/eslint-utils/compare/v1.3.1...v1.4.2)

Signed-off-by: dependabot[bot] <support@github.com>
2019-09-09 15:41:14 -04:00
dependabot[bot]
c81b0a9d2e Bump nwmatcher from 1.4.3 to 1.4.4 (#7129)
Bumps [nwmatcher](https://github.com/dperini/nwmatcher) from 1.4.3 to 1.4.4.
- [Release notes](https://github.com/dperini/nwmatcher/releases)
- [Commits](https://github.com/dperini/nwmatcher/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2019-09-09 15:40:59 -04:00
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
Whymarrh Whitby
67f6857fce
nvm: Update to v10.16.3 (#7127) 2019-09-09 14:19:39 -04:00
kumavis
0dad4db8de build - dont create bundler until task is actually run (#7117) 2019-09-09 10:44:08 -03:00
Mark Stacey
5363d6aa2a
Prevent multiple warnings for the same locale message (#7091)
* Prevent multiple warnings for the same locale message

Our i18n helper issues warnings whenever a requested message is
missing. These warnings are helpful in assisting translation efforts,
but they can be distracting otherwise. They're especially problematic
for locales that are missing many messages. My browser ended up
crashing on more than one occasion due to the sheer volume of warnings.

The warning has been updated to only be issued once per missing key.
This required updating the method to pass in the current locale. The
current locale was added to the warning itself as well, which could be
helpful for cases where a message is missing in both the current locale
and the fallback ('en').

* Change locale and localeMessages as single action

Updating the current locale and the locale messages resulted in two
renders, and during the first the state was inconsistent (it would say
the locale had changed to the new one, but still be using the old set
of locale messages). Instead the locale is now updated with one atomic
action.

This was required after adding the locale to the missing locale message
warning, as otherwise it would say the message was missing from the
wrong locale.
2019-09-06 10:47:07 -03:00
Dan Finlay
8a1887d9df
Merge pull request #7113 from Gudahtt/remove-duplicate-keys
Remove duplicate keys in `ru` locale
2019-09-05 10:54:08 -07:00
Mark Stacey
2672ae7e66 Remove duplicate keys in ru locale
These were accidentally introduced recently as two separate updates to
the `ru` locale were merged. They added these keys in different places,
so they didn't conflict.
2019-09-05 14:24:34 -03:00
Brian R. Bondy
93204a578b Update localization from Transifex Brave order (#7099)
* Add extra locales to index.json

* Fix verify locale script bugs

- All locales didn't work because it was putting an object inside of an object.
- Individual checks didn't work because of how the destructuring was done.
- Extra items were being printed as missing items.

* Sync up string changes w/ Brave wallet

* Add 33 new locales from Brave wallet

* Merge tml into ta code
2019-09-05 14:05:33 -03:00
Mark Stacey
1e7b37d1cc
Combine fetch-with-timeout implementations (#7084)
There were two competing utility functions for calling fetch with a
timeout. They have been combined into one.
2019-09-04 17:00:11 -03:00
Mark Stacey
3e9d247d4b
Fix fetch-with-cache (#7083)
The `fetch-with-cache` utility was failing to actually cache anything.
It would cache an object with cache time and URL, and would return that
instead of a valid response. This resulted in the error:
`TypeError: fourByteResponse.json is not a function`

The utility was updated to call `.json()` within itself, and cache the
JSON response. The function signature was updated as well, to expect an
options object instead of just the `cacheRefreshTime` option. The
timeout was added to this options object, which helped with testing.

The utility method now also handles unsuccessfull responses, and
incompatible `fetch` options.
2019-09-04 16:10:23 -03:00
Denis
622c3e482f Added missed phrases to RU locale (got from en locale) (#7012)
Co-Authored-By: Dmitriy Ryajov <dryajov@gmail.com>
2019-09-04 13:51:03 -04:00
Dan Finlay
09866269bf
Merge pull request #7102 from Gudahtt/fix-persian-locale-indentation
Fix indentation of the Persian locale
2019-09-03 21:11:47 -07:00