From 38f8d9906d8d113a549a5cbceea8d6b45cd8f229 Mon Sep 17 00:00:00 2001 From: MetaMask Bot Date: Tue, 19 Nov 2019 19:44:23 +0000 Subject: [PATCH 1/5] Version v7.6.1 --- CHANGELOG.md | 2 ++ app/manifest.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1784bfc31..5a43035c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Current Develop Branch +## 7.6.1 Tue Nov 19 2019 + ## 7.6.0 Mon Nov 18 2019 - [#7450](https://github.com/MetaMask/metamask-extension/pull/7450): Add migration notification for users with non-zero Sai - [#7461](https://github.com/MetaMask/metamask-extension/pull/7461): Import styles for showing multiple notifications diff --git a/app/manifest.json b/app/manifest.json index 9d0523a2a..f9e25ceda 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -1,7 +1,7 @@ { "name": "__MSG_appName__", "short_name": "__MSG_appName__", - "version": "7.6.0", + "version": "7.6.1", "manifest_version": 2, "author": "https://metamask.io", "description": "__MSG_appDescription__", From 5f9e8867b4377556796aa92625c613fae603805f Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Tue, 19 Nov 2019 15:01:23 -0330 Subject: [PATCH 2/5] Allow any renderable type in HomeNotification texts --- .../app/home-notification/home-notification.component.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/app/components/app/home-notification/home-notification.component.js b/ui/app/components/app/home-notification/home-notification.component.js index cc86ef6d8..d3d0a0961 100644 --- a/ui/app/components/app/home-notification/home-notification.component.js +++ b/ui/app/components/app/home-notification/home-notification.component.js @@ -17,12 +17,12 @@ export default class HomeNotification extends PureComponent { } static propTypes = { - acceptText: PropTypes.string.isRequired, + acceptText: PropTypes.node.isRequired, onAccept: PropTypes.func, - ignoreText: PropTypes.string, + ignoreText: PropTypes.node, onIgnore: PropTypes.func, - descriptionText: PropTypes.string.isRequired, - infoText: PropTypes.string, + descriptionText: PropTypes.node.isRequired, + infoText: PropTypes.node, classNames: PropTypes.array, } From ab0600ef0ba690da15de0c7d2b636703f6af2336 Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Tue, 19 Nov 2019 16:04:33 -0330 Subject: [PATCH 3/5] Add Remind Me Later to SAI migration notification --- app/_locales/en/messages.json | 3 ++ app/scripts/controllers/app-state.js | 7 +++ app/scripts/metamask-controller.js | 1 + .../dai-migration-notification.component.js | 44 ++++++++++++++++--- .../dai-migration-notification.container.js | 16 ++++++- ui/app/store/actions.js | 11 +++++ 6 files changed, 75 insertions(+), 7 deletions(-) diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index 18821dfe1..f947c9e5c 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -2,6 +2,9 @@ "migrateSai": { "message": "A message from Maker: The new Multi-Collateral Dai token has been released. Your old tokens are now called Sai. Please upgrade your Sai tokens to the new Dai." }, + "migrateSaiInfo": { + "message": "To dismiss this notification you can migrate your tokens or hide SAI from the token list." + }, "migrate": { "message": "Migrate" }, diff --git a/app/scripts/controllers/app-state.js b/app/scripts/controllers/app-state.js index 9533fd458..8d67874ad 100644 --- a/app/scripts/controllers/app-state.js +++ b/app/scripts/controllers/app-state.js @@ -13,6 +13,7 @@ class AppStateController { this.onInactiveTimeout = onInactiveTimeout || (() => {}) this.store = new ObservableStore(extend({ timeoutMinutes: 0, + mkrMigrationReminderTimestamp: null, }, initState)) this.timer = null @@ -23,6 +24,12 @@ class AppStateController { this._setInactiveTimeout(preferences.autoLogoutTimeLimit) } + setMkrMigrationReminderTimestamp (timestamp) { + this.store.updateState({ + mkrMigrationReminderTimestamp: timestamp, + }) + } + /** * Sets the last active time to the current time * @return {void} diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 1c607a4c6..14caf0706 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -508,6 +508,7 @@ module.exports = class MetamaskController extends EventEmitter { // AppStateController setLastActiveTime: nodeify(this.appStateController.setLastActiveTime, this.appStateController), + setMkrMigrationReminderTimestamp: nodeify(this.appStateController.setMkrMigrationReminderTimestamp, this.appStateController), // EnsController tryReverseResolveAddress: nodeify(this.ensController.reverseResolveAddress, this.ensController), diff --git a/ui/app/components/app/dai-migration-component/dai-migration-notification.component.js b/ui/app/components/app/dai-migration-component/dai-migration-notification.component.js index eebe4296a..d26358df7 100644 --- a/ui/app/components/app/dai-migration-component/dai-migration-notification.component.js +++ b/ui/app/components/app/dai-migration-component/dai-migration-notification.component.js @@ -1,3 +1,4 @@ +import { DateTime } from 'luxon' import React, { PureComponent } from 'react' import PropTypes from 'prop-types' import HomeNotification from '../home-notification' @@ -8,18 +9,37 @@ export default class DaiV1MigrationNotification extends PureComponent { } static defaultProps = { + mkrMigrationReminderTimestamp: null, string: '', symbol: '', } static propTypes = { + setMkrMigrationReminderTimestamp: PropTypes.func.isRequired, + mkrMigrationReminderTimestamp: PropTypes.string, string: PropTypes.string, symbol: PropTypes.string, } + remindMeLater = () => { + const nextWeek = DateTime.utc().plus({ + days: 7, + }) + this.props.setMkrMigrationReminderTimestamp(nextWeek.toString()) + } + render () { const { t } = this.context - const { string: balanceString, symbol } = this.props + const { mkrMigrationReminderTimestamp, string: balanceString, symbol } = this.props + + if (mkrMigrationReminderTimestamp) { + const reminderDateTime = DateTime.fromISO(mkrMigrationReminderTimestamp, { + zone: 'UTC', + }) + if (reminderDateTime > DateTime.utc()) { + return null + } + } if (!balanceString || !symbol) { return null @@ -31,15 +51,27 @@ export default class DaiV1MigrationNotification extends PureComponent { return ( + {t('migrateSai')} +   + { + window.open('https://blog.makerdao.com/multi-collateral-dai-is-live/', '_blank', 'noopener') + }} + > + {t('learnMore')}. + + + )} acceptText={t('migrate')} onAccept={() => { window.open('https://migrate.makerdao.com', '_blank', 'noopener') }} - ignoreText={t('learnMore')} - onIgnore={() => { - window.open('https://blog.makerdao.com/multi-collateral-dai-is-live/', '_blank', 'noopener') - }} + ignoreText={t('remindMeLater')} + onIgnore={this.remindMeLater} + infoText={t('migrateSaiInfo')} /> ) } diff --git a/ui/app/components/app/dai-migration-component/dai-migration-notification.container.js b/ui/app/components/app/dai-migration-component/dai-migration-notification.container.js index 1ea1d2fe4..175083bce 100644 --- a/ui/app/components/app/dai-migration-component/dai-migration-notification.container.js +++ b/ui/app/components/app/dai-migration-component/dai-migration-notification.container.js @@ -3,18 +3,32 @@ import { compose } from 'recompose' import DaiMigrationNotification from './dai-migration-notification.component' import withTokenTracker from '../../../helpers/higher-order-components/with-token-tracker' import { getSelectedAddress, getDaiV1Token } from '../../../selectors/selectors' +import { setMkrMigrationReminderTimestamp } from '../../../store/actions' const mapStateToProps = (state) => { + const { + metamask: { + mkrMigrationReminderTimestamp, + }, + } = state + const userAddress = getSelectedAddress(state) const oldDai = getDaiV1Token(state) return { + mkrMigrationReminderTimestamp, userAddress, token: oldDai, } } +const mapDispatchToProps = (dispatch) => { + return { + setMkrMigrationReminderTimestamp: (t) => dispatch(setMkrMigrationReminderTimestamp(t)), + } +} + export default compose( - connect(mapStateToProps), + connect(mapStateToProps, mapDispatchToProps), withTokenTracker, )(DaiMigrationNotification) diff --git a/ui/app/store/actions.js b/ui/app/store/actions.js index f76024590..2642e89e9 100644 --- a/ui/app/store/actions.js +++ b/ui/app/store/actions.js @@ -367,6 +367,7 @@ var actions = { // AppStateController-related actions SET_LAST_ACTIVE_TIME: 'SET_LAST_ACTIVE_TIME', setLastActiveTime, + setMkrMigrationReminderTimestamp, getContractMethodData, loadingMethoDataStarted, @@ -2755,6 +2756,16 @@ function setLastActiveTime () { } } +function setMkrMigrationReminderTimestamp (timestamp) { + return (dispatch) => { + background.setMkrMigrationReminderTimestamp(timestamp, (err) => { + if (err) { + return dispatch(actions.displayWarning(err.message)) + } + }) + } +} + function loadingMethoDataStarted () { return { type: actions.LOADING_METHOD_DATA_STARTED, From 038e2e8ca997ecf88defa4fca54183fce3d7b74c Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Tue, 19 Nov 2019 16:24:48 -0400 Subject: [PATCH 4/5] Update changelog for v7.6.1 --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a43035c8..02d6a0b64 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ ## Current Develop Branch ## 7.6.1 Tue Nov 19 2019 +- [#7475](https://github.com/MetaMask/metamask-extension/pull/7475): Add 'Remind Me Later' to the Maker notification +- [#7436](https://github.com/MetaMask/metamask-extension/pull/7436): Add additional rpcUrl verification +- [#7468](https://github.com/MetaMask/metamask-extension/pull/7468): Show transaction fee units on approve screen ## 7.6.0 Mon Nov 18 2019 - [#7450](https://github.com/MetaMask/metamask-extension/pull/7450): Add migration notification for users with non-zero Sai From ea93408bddf6fc51767d1a046650b3ae811a6d24 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Tue, 19 Nov 2019 17:35:14 -0400 Subject: [PATCH 5/5] Revert "Update abi-decoder (#7472)" This reverts commit a26e77c61e5117b9db3fe852deed63f1d29f659e. --- package.json | 2 +- yarn.lock | 60 +++++++++++++++++++--------------------------------- 2 files changed, 23 insertions(+), 39 deletions(-) diff --git a/package.json b/package.json index 73659d909..047911146 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "@material-ui/core": "1.0.0", "@sentry/browser": "^4.1.1", "@zxing/library": "^0.8.0", - "abi-decoder": "^2.2.0", + "abi-decoder": "^1.2.0", "abortcontroller-polyfill": "^1.3.0", "asmcrypto.js": "^2.3.2", "await-semaphore": "^0.1.1", diff --git a/yarn.lock b/yarn.lock index 22f241c21..5e9578a16 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3071,13 +3071,12 @@ abbrev@1: resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== -abi-decoder@^2.2.0: - version "2.2.2" - resolved "https://registry.yarnpkg.com/abi-decoder/-/abi-decoder-2.2.2.tgz#aa1e6679f43c6c6be5d2a3fb20e9578e14e44440" - integrity sha512-viRNIt7FzBC9/Y99AVKsAvEMJsIe9Yc/PMrqYT7edSlZ4EnbXlxAq7hS08XTeMzjMP6DpoVrYyCwhSCskCPQqA== +abi-decoder@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/abi-decoder/-/abi-decoder-1.2.0.tgz#c42882dbb91b444805f0cd203a87a5cc3c22f4a8" + integrity sha512-y2OKSEW4gf2838Eavc56vQY9V46zaXkf3Jl1WpTfUBbzAVrXSr4JRZAAWv55Tv9s5WNz1rVgBgz5d2aJIL1QCg== dependencies: - web3-eth-abi "^1.2.1" - web3-utils "^1.2.1" + web3 "^0.18.4" abort-controller@^3.0.0: version "3.0.0" @@ -5339,6 +5338,10 @@ bignumber.js@^9.0.0: resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.0.0.tgz#805880f84a329b5eac6e7cb6f8274b6d82bdf075" integrity sha512-t/OYhhJ2SD+YGBQcjY8GzzDHEk9f3nerxjtfa6tlMXfe7frs/WozhvCNoGvpM0P3bNf3Gq5ZRMlGr5f3r4/N8A== +"bignumber.js@git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2": + version "2.0.7" + resolved "git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2" + "bignumber.js@git+https://github.com/frozeman/bignumber.js-nolookahead.git": version "2.0.7" resolved "git+https://github.com/frozeman/bignumber.js-nolookahead.git#57692b3ecfc98bbdd6b3a516cb2353652ea49934" @@ -10336,13 +10339,6 @@ ethashjs@~0.0.7: ethereumjs-util "^4.0.1" miller-rabin "^4.0.0" -ethereum-bloom-filters@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/ethereum-bloom-filters/-/ethereum-bloom-filters-1.0.6.tgz#9cdebb3ec20de96ec4a434c6bad6ea5a513037aa" - integrity sha512-dE9CGNzgOOsdh7msZirvv8qjHtnHpvBlKe2647kM8v+yeF71IRso55jpojemvHV+jMjr48irPWxMRaHuOWzAFA== - dependencies: - js-sha3 "^0.8.0" - ethereum-common@0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/ethereum-common/-/ethereum-common-0.2.0.tgz#13bf966131cce1eeade62a1b434249bb4cb120ca" @@ -21912,7 +21908,7 @@ randombytes@^2.0.0, randombytes@^2.0.5: dependencies: safe-buffer "^5.1.0" -randombytes@^2.0.1, randombytes@^2.0.3, randombytes@^2.0.6, randombytes@^2.1.0: +randombytes@^2.0.1, randombytes@^2.0.3, randombytes@^2.0.6: version "2.1.0" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== @@ -27615,15 +27611,6 @@ web3-eth-abi@1.2.1: underscore "1.9.1" web3-utils "1.2.1" -web3-eth-abi@^1.2.1: - version "1.2.4" - resolved "https://registry.yarnpkg.com/web3-eth-abi/-/web3-eth-abi-1.2.4.tgz#5b73e5ef70b03999227066d5d1310b168845e2b8" - integrity sha512-8eLIY4xZKoU3DSVu1pORluAw9Ru0/v4CGdw5so31nn+7fR8zgHMgwbFe0aOqWQ5VU42PzMMXeIJwt4AEi2buFg== - dependencies: - ethers "4.0.0-beta.3" - underscore "1.9.1" - web3-utils "1.2.4" - web3-eth-accounts@1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/web3-eth-accounts/-/web3-eth-accounts-1.2.1.tgz#2741a8ef337a7219d57959ac8bd118b9d68d63cf" @@ -27827,20 +27814,6 @@ web3-utils@1.2.1: underscore "1.9.1" utf8 "3.0.0" -web3-utils@1.2.4, web3-utils@^1.2.1: - version "1.2.4" - resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.2.4.tgz#96832a39a66b05bf8862a5b0bdad2799d709d951" - integrity sha512-+S86Ip+jqfIPQWvw2N/xBQq5JNqCO0dyvukGdJm8fEWHZbckT4WxSpHbx+9KLEWY4H4x9pUwnoRkK87pYyHfgQ== - dependencies: - bn.js "4.11.8" - eth-lib "0.2.7" - ethereum-bloom-filters "^1.0.6" - ethjs-unit "0.1.6" - number-to-bn "1.7.0" - randombytes "^2.1.0" - underscore "1.9.1" - utf8 "3.0.0" - web3@1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/web3/-/web3-1.2.1.tgz#5d8158bcca47838ab8c2b784a2dee4c3ceb4179b" @@ -27854,6 +27827,17 @@ web3@1.2.1: web3-shh "1.2.1" web3-utils "1.2.1" +web3@^0.18.4: + version "0.18.4" + resolved "https://registry.yarnpkg.com/web3/-/web3-0.18.4.tgz#81ec1784145491f2eaa8955b31c06049e07c5e7d" + integrity sha1-gewXhBRUkfLqqJVbMcBgSeB8Xn0= + dependencies: + bignumber.js "git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2" + crypto-js "^3.1.4" + utf8 "^2.1.1" + xhr2 "*" + xmlhttprequest "*" + web3@^0.20.7: version "0.20.7" resolved "https://registry.yarnpkg.com/web3/-/web3-0.20.7.tgz#1605e6d81399ed6f85a471a4f3da0c8be57df2f7" @@ -28243,7 +28227,7 @@ xhr2-cookies@1.1.0, xhr2-cookies@^1.1.0: dependencies: cookiejar "^2.1.1" -xhr2@0.1.3: +xhr2@*, xhr2@0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/xhr2/-/xhr2-0.1.3.tgz#cbfc4759a69b4a888e78cf4f20b051038757bd11" integrity sha1-y/xHWaabSoiOeM9PILBRA4dXvRE=