From a7911ce9b3dc05bcb6533259240033cb7de38f9a Mon Sep 17 00:00:00 2001 From: MetaMask Bot Date: Tue, 28 Apr 2020 15:40:28 +0000 Subject: [PATCH 01/18] Version v7.7.9 --- CHANGELOG.md | 2 ++ app/manifest.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c062db402d8..c01b6cc4897c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Current Develop Branch +## 7.7.9 Tue Apr 28 2020 + ## 7.7.8 Wed Mar 11 2020 - [#8176](https://github.com/MetaMask/metamask-extension/pull/8176): Handle and set gas estimation when max mode is clicked - [#8178](https://github.com/MetaMask/metamask-extension/pull/8178): Use specified gas limit when speeding up a transaction diff --git a/app/manifest.json b/app/manifest.json index de4191ab49e9..45ff5ab7f914 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -1,7 +1,7 @@ { "name": "__MSG_appName__", "short_name": "__MSG_appName__", - "version": "7.7.8", + "version": "7.7.9", "manifest_version": 2, "author": "https://metamask.io", "description": "__MSG_appDescription__", From 2a513990c2b31e3e38fd3e741d58a86aea38d6ee Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Wed, 29 Apr 2020 01:57:25 -0300 Subject: [PATCH 02/18] Backport "Fix popup not opening (#8314)" (#8446) This is a backport of #8314. Here's the original description: MetaMask would sometimes get into a state where the notification popup would never open. This could happen if the notification window was closed shortly after being opened. After this happened, no popups would show up until after the extension was reset. This was happening because the background thought the popup was already open. The variable it uses to track whether the popup was open or not was being set to `true` immediately after the background asked the browser to open a new window, before a handler was attached that could respond to the window being closed. Removing this line seems to solve the problem. This line was added originally in #5437, which dealt with batch transactions. Batches of transactions seem to work just fine without this line though (from local testing), and I can't think of why this would be required. Closes #7051 --- CHANGELOG.md | 1 + app/scripts/background.js | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c01b6cc4897c..9b38bd54f5d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Current Develop Branch ## 7.7.9 Tue Apr 28 2020 +- [#8446](https://github.com/MetaMask/metamask-extension/pull/8446): Fix popup not opening ## 7.7.8 Wed Mar 11 2020 - [#8176](https://github.com/MetaMask/metamask-extension/pull/8176): Handle and set gas estimation when max mode is clicked diff --git a/app/scripts/background.js b/app/scripts/background.js index 31c8d1815d7d..fc14f68a739c 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -447,7 +447,6 @@ function triggerUi () { const currentlyActiveMetamaskTab = Boolean(tabs.find(tab => openMetamaskTabsIDs[tab.id])) if (!popupIsOpen && !currentlyActiveMetamaskTab && !notificationIsOpen) { notificationManager.showPopup() - notificationIsOpen = true } }) } From 8fb615c9f6746a5ea919e2e1609b6fb8f8a88696 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Wed, 29 Apr 2020 02:31:45 -0300 Subject: [PATCH 03/18] Backport "Skip adding history entry for empty txMeta diffs (#8379)" (#8449) Backport #8379 to v7.7.9 --- CHANGELOG.md | 1 + .../transactions/tx-state-manager.js | 4 +++- .../transactions/tx-state-manager-test.js | 17 +++++++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b38bd54f5d0..e06195956681 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ## 7.7.9 Tue Apr 28 2020 - [#8446](https://github.com/MetaMask/metamask-extension/pull/8446): Fix popup not opening +- [#8449](https://github.com/MetaMask/metamask-extension/pull/8449): Skip adding history entry for empty txMeta diffs ## 7.7.8 Wed Mar 11 2020 - [#8176](https://github.com/MetaMask/metamask-extension/pull/8176): Handle and set gas estimation when max mode is clicked diff --git a/app/scripts/controllers/transactions/tx-state-manager.js b/app/scripts/controllers/transactions/tx-state-manager.js index cf254352fddd..e2bbe8e39ed6 100644 --- a/app/scripts/controllers/transactions/tx-state-manager.js +++ b/app/scripts/controllers/transactions/tx-state-manager.js @@ -195,7 +195,9 @@ class TransactionStateManager extends EventEmitter { const previousState = txStateHistoryHelper.replayHistory(txMeta.history) // generate history entry and add to history const entry = txStateHistoryHelper.generateHistoryEntry(previousState, currentState, note) - txMeta.history.push(entry) + if (entry.length) { + txMeta.history.push(entry) + } // commit txMeta to state const txId = txMeta.id diff --git a/test/unit/app/controllers/transactions/tx-state-manager-test.js b/test/unit/app/controllers/transactions/tx-state-manager-test.js index 02d6199e9fa8..bdd1c9cb72c3 100644 --- a/test/unit/app/controllers/transactions/tx-state-manager-test.js +++ b/test/unit/app/controllers/transactions/tx-state-manager-test.js @@ -252,6 +252,23 @@ describe('TransactionStateManager', function () { assert.deepEqual(result.history[1][0].value, expectedEntry.value, 'two history items (initial + diff) value') assert.ok(result.history[1][0].timestamp >= before && result.history[1][0].timestamp <= after) }) + + it('does NOT add empty history items', function () { + const txMeta = { + id: '1', + status: 'unapproved', + metamaskNetworkId: currentNetworkId, + txParams: { + gasPrice: '0x01', + }, + } + + txStateManager.addTx(txMeta) + txStateManager.updateTx(txMeta) + + const { history } = txStateManager.getTx('1') + assert.equal(history.length, 1, 'two history items (initial + diff)') + }) }) describe('#getUnapprovedTxList', function () { From 57fdc03dc247bae1106f96cddacd11d819e9d591 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Wed, 29 Apr 2020 11:40:08 -0300 Subject: [PATCH 04/18] Backport "Delete Dai/Sai migration notification (#8418)" (#8447) This backports the deletion of the Dai/Sai migration notification (#8418). Note that the migration to delete the now unused background state has not been included, as it is non-essential and would have been more difficult to backport. The migration to delete the unused state will be included in the next major release instead. --- CHANGELOG.md | 1 + app/_locales/en/messages.json | 9 --- app/scripts/controllers/app-state.js | 7 -- app/scripts/metamask-controller.js | 1 - .../dai-migration-notification.component.js | 78 ------------------- .../dai-migration-notification.container.js | 34 -------- .../app/dai-migration-component/index.js | 1 - ui/app/pages/home/home.component.js | 9 --- ui/app/pages/home/home.container.js | 3 +- ui/app/selectors/selectors.js | 7 -- ui/app/store/actions.js | 11 --- 11 files changed, 2 insertions(+), 159 deletions(-) delete mode 100644 ui/app/components/app/dai-migration-component/dai-migration-notification.component.js delete mode 100644 ui/app/components/app/dai-migration-component/dai-migration-notification.container.js delete mode 100644 ui/app/components/app/dai-migration-component/index.js diff --git a/CHANGELOG.md b/CHANGELOG.md index e06195956681..4b6226b850a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ## 7.7.9 Tue Apr 28 2020 - [#8446](https://github.com/MetaMask/metamask-extension/pull/8446): Fix popup not opening - [#8449](https://github.com/MetaMask/metamask-extension/pull/8449): Skip adding history entry for empty txMeta diffs +- [#8447](https://github.com/MetaMask/metamask-extension/pull/8447): Delete Dai/Sai migration notification ## 7.7.8 Wed Mar 11 2020 - [#8176](https://github.com/MetaMask/metamask-extension/pull/8176): Handle and set gas estimation when max mode is clicked diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index 73c59555eb46..052229bfe1ea 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -1,13 +1,4 @@ { - "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" - }, "showIncomingTransactions": { "message": "Show Incoming Transactions" }, diff --git a/app/scripts/controllers/app-state.js b/app/scripts/controllers/app-state.js index c60a1c4f5065..32866888a5e6 100644 --- a/app/scripts/controllers/app-state.js +++ b/app/scripts/controllers/app-state.js @@ -13,7 +13,6 @@ class AppStateController { this.onInactiveTimeout = onInactiveTimeout || (() => {}) this.store = new ObservableStore(extend({ timeoutMinutes: 0, - mkrMigrationReminderTimestamp: null, }, initState)) this.timer = null @@ -24,12 +23,6 @@ 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 bd31705cbdb3..9eb46a40e518 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -509,7 +509,6 @@ 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 deleted file mode 100644 index d26358df7367..000000000000 --- a/ui/app/components/app/dai-migration-component/dai-migration-notification.component.js +++ /dev/null @@ -1,78 +0,0 @@ -import { DateTime } from 'luxon' -import React, { PureComponent } from 'react' -import PropTypes from 'prop-types' -import HomeNotification from '../home-notification' - -export default class DaiV1MigrationNotification extends PureComponent { - static contextTypes = { - t: PropTypes.func, - } - - 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 { 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 - } - - if (balanceString === '0') { - return null - } - - 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('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 deleted file mode 100644 index 175083bce982..000000000000 --- a/ui/app/components/app/dai-migration-component/dai-migration-notification.container.js +++ /dev/null @@ -1,34 +0,0 @@ -import { connect } from 'react-redux' -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, mapDispatchToProps), - withTokenTracker, -)(DaiMigrationNotification) diff --git a/ui/app/components/app/dai-migration-component/index.js b/ui/app/components/app/dai-migration-component/index.js deleted file mode 100644 index e3c7cec2bab3..000000000000 --- a/ui/app/components/app/dai-migration-component/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './dai-migration-notification.container' diff --git a/ui/app/pages/home/home.component.js b/ui/app/pages/home/home.component.js index e51c8217798a..f08a0bb47fda 100644 --- a/ui/app/pages/home/home.component.js +++ b/ui/app/pages/home/home.component.js @@ -4,7 +4,6 @@ import Media from 'react-media' import { Redirect } from 'react-router-dom' import { formatDate } from '../../helpers/utils/util' import HomeNotification from '../../components/app/home-notification' -import DaiMigrationNotification from '../../components/app/dai-migration-component' import MultipleNotifications from '../../components/app/multiple-notifications' import WalletView from '../../components/app/wallet-view' import TransactionView from '../../components/app/transaction-view' @@ -24,7 +23,6 @@ export default class Home extends PureComponent { static defaultProps = { unsetMigratedPrivacyMode: null, - hasDaiV1Token: false, } static propTypes = { @@ -45,7 +43,6 @@ export default class Home extends PureComponent { restoreFromThreeBox: PropTypes.func, setShowRestorePromptToFalse: PropTypes.func, threeBoxLastUpdated: PropTypes.number, - hasDaiV1Token: PropTypes.bool, } componentWillMount () { @@ -89,7 +86,6 @@ export default class Home extends PureComponent { forgottenPassword, providerRequests, history, - hasDaiV1Token, showPrivacyModeNotification, unsetMigratedPrivacyMode, shouldShowSeedPhraseReminder, @@ -176,11 +172,6 @@ export default class Home extends PureComponent { /> : null } - { - hasDaiV1Token - ? - : null - } ) diff --git a/ui/app/pages/home/home.container.js b/ui/app/pages/home/home.container.js index 4a2106a55b91..1bac780afeb8 100644 --- a/ui/app/pages/home/home.container.js +++ b/ui/app/pages/home/home.container.js @@ -3,7 +3,7 @@ import { compose } from 'recompose' import { connect } from 'react-redux' import { withRouter } from 'react-router-dom' import { unconfirmedTransactionsCountSelector } from '../../selectors/confirm-transaction' -import { getCurrentEthBalance, getDaiV1Token } from '../../selectors/selectors' +import { getCurrentEthBalance } from '../../selectors/selectors' import { unsetMigratedPrivacyMode, restoreFromThreeBox, @@ -44,7 +44,6 @@ const mapStateToProps = state => { showRestorePrompt, selectedAddress, threeBoxLastUpdated, - hasDaiV1Token: Boolean(getDaiV1Token(state)), } } diff --git a/ui/app/selectors/selectors.js b/ui/app/selectors/selectors.js index d606b6db8a38..fab5f1dae114 100644 --- a/ui/app/selectors/selectors.js +++ b/ui/app/selectors/selectors.js @@ -49,7 +49,6 @@ const selectors = { getAccountType, getNumberOfAccounts, getNumberOfTokens, - getDaiV1Token, isEthereumNetwork, getMetaMetricState, getRpcPrefsForCurrentProvider, @@ -226,12 +225,6 @@ function getAddressBookEntryName (state, address) { return entry && entry.name !== '' ? entry.name : addressSlicer(address) } -function getDaiV1Token (state) { - const OLD_DAI_CONTRACT_ADDRESS = '0x89d24A6b4CcB1B6fAA2625fE562bDD9a23260359' - const tokens = state.metamask.tokens || [] - return tokens.find(({address}) => checksumAddress(address) === OLD_DAI_CONTRACT_ADDRESS) -} - function accountsWithSendEtherInfoSelector (state) { const accounts = getMetaMaskAccounts(state) const { identities } = state.metamask diff --git a/ui/app/store/actions.js b/ui/app/store/actions.js index 285216154564..19c9bfaea37f 100644 --- a/ui/app/store/actions.js +++ b/ui/app/store/actions.js @@ -367,7 +367,6 @@ var actions = { // AppStateController-related actions SET_LAST_ACTIVE_TIME: 'SET_LAST_ACTIVE_TIME', setLastActiveTime, - setMkrMigrationReminderTimestamp, getContractMethodData, loadingMethoDataStarted, @@ -2756,16 +2755,6 @@ 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 08fd6cf329ea4665921f91c22183f42f4ccb8c6a Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Wed, 29 Apr 2020 15:17:29 -0300 Subject: [PATCH 05/18] Backport "Update deposit copy for Wyre (#7654)" (#8460) Backport #7654 to v7.7.9 Co-authored-by: Tyson Malchow --- CHANGELOG.md | 1 + app/_locales/en/messages.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b6226b850a8..88de7b535edb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - [#8446](https://github.com/MetaMask/metamask-extension/pull/8446): Fix popup not opening - [#8449](https://github.com/MetaMask/metamask-extension/pull/8449): Skip adding history entry for empty txMeta diffs - [#8447](https://github.com/MetaMask/metamask-extension/pull/8447): Delete Dai/Sai migration notification +- [#8460](https://github.com/MetaMask/metamask-extension/pull/8460): Update deposit copy for Wyre ## 7.7.8 Wed Mar 11 2020 - [#8176](https://github.com/MetaMask/metamask-extension/pull/8176): Handle and set gas estimation when max mode is clicked diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index 052229bfe1ea..412d78148950 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -229,7 +229,7 @@ "message": "Buy ETH with Wyre" }, "buyWithWyreDescription": { - "message": "Wyre lets you use a credit card to deposit ETH right in to your MetaMask account." + "message": "Wyre lets you use a debit card to deposit ETH right in to your MetaMask account." }, "buyCoinSwitch": { "message": "Buy on CoinSwitch" From 50b48b7a03274f7b4f11f2f168f96c8cb7035507 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Wed, 29 Apr 2020 15:37:26 -0300 Subject: [PATCH 06/18] Backport "Clean up list of available currencies (#7667)" (#8454) This is backported to make it easier to backport #7986 Co-authored-by: Whymarrh Whitby --- test/unit/balance-formatter-test.js | 6 +- .../constants/available-conversions.json | 238 +++++++ .../helpers/constants/infura-conversion.json | 653 ------------------ .../settings-tab/settings-tab.component.js | 10 +- 4 files changed, 246 insertions(+), 661 deletions(-) create mode 100644 ui/app/helpers/constants/available-conversions.json delete mode 100644 ui/app/helpers/constants/infura-conversion.json diff --git a/test/unit/balance-formatter-test.js b/test/unit/balance-formatter-test.js index bd0eb50087a4..52a442a005d8 100644 --- a/test/unit/balance-formatter-test.js +++ b/test/unit/balance-formatter-test.js @@ -1,13 +1,13 @@ const assert = require('assert') const currencyFormatter = require('currency-formatter') -const infuraConversion = require('../../ui/app/helpers/constants/infura-conversion.json') +const availableCurrencies = require('../../ui/app/helpers/constants/available-conversions.json') describe('currencyFormatting', function () { it('be able to format any infura currency', function (done) { const number = 10000 - infuraConversion.objects.forEach((conversion) => { - const code = conversion.quote.code.toUpperCase() + availableCurrencies.forEach((conversion) => { + const code = conversion.code.toUpperCase() const result = currencyFormatter.format(number, { code }) switch (code) { diff --git a/ui/app/helpers/constants/available-conversions.json b/ui/app/helpers/constants/available-conversions.json new file mode 100644 index 000000000000..61722de39c29 --- /dev/null +++ b/ui/app/helpers/constants/available-conversions.json @@ -0,0 +1,238 @@ +[ + { + "code": "aud", + "name": "Australian Dollar" + }, + { + "code": "hkd", + "name": "Hong Kong Dollar" + }, + { + "code": "sgd", + "name": "Singapore Dollar" + }, + { + "code": "idr", + "name": "Indonesian Rupiah" + }, + { + "code": "php", + "name": "Philippine Peso" + }, + { + "code": "1st", + "name": "FirstBlood" + }, + { + "code": "adt", + "name": "adToken" + }, + { + "code": "adx", + "name": "AdEx" + }, + { + "code": "ant", + "name": "Aragon" + }, + { + "code": "bat", + "name": "Basic Attention Token" + }, + { + "code": "bnt", + "name": "Bancor" + }, + { + "code": "btc", + "name": "Bitcoin" + }, + { + "code": "cad", + "name": "Canadian Dollar" + }, + { + "code": "cfi", + "name": "Cofound.it" + }, + { + "code": "crb", + "name": "CreditBit" + }, + { + "code": "cvc", + "name": "Civic" + }, + { + "code": "dash", + "name": "Dash" + }, + { + "code": "dgd", + "name": "DigixDAO" + }, + { + "code": "etc", + "name": "Ethereum Classic" + }, + { + "code": "eur", + "name": "Euro" + }, + { + "code": "fun", + "name": "FunFair" + }, + { + "code": "gbp", + "name": "Pound Sterling" + }, + { + "code": "gno", + "name": "Gnosis" + }, + { + "code": "gnt", + "name": "Golem" + }, + { + "code": "gup", + "name": "Matchpool" + }, + { + "code": "hmq", + "name": "Humaniq" + }, + { + "code": "jpy", + "name": "Japanese Yen" + }, + { + "code": "lgd", + "name": "Legends Room" + }, + { + "code": "lsk", + "name": "Lisk" + }, + { + "code": "ltc", + "name": "Litecoin" + }, + { + "code": "lun", + "name": "Lunyr" + }, + { + "code": "mco", + "name": "Monaco" + }, + { + "code": "mtl", + "name": "Metal" + }, + { + "code": "myst", + "name": "Mysterium" + }, + { + "code": "nmr", + "name": "Numeraire" + }, + { + "code": "omg", + "name": "OmiseGO" + }, + { + "code": "pay", + "name": "TenX" + }, + { + "code": "ptoy", + "name": "Patientory" + }, + { + "code": "qrl", + "name": "Quantum-Resistant Ledger" + }, + { + "code": "qtum", + "name": "Qtum" + }, + { + "code": "rep", + "name": "Augur" + }, + { + "code": "rlc", + "name": "iEx.ec" + }, + { + "code": "rub", + "name": "Russian Ruble" + }, + { + "code": "sc", + "name": "Siacoin" + }, + { + "code": "sngls", + "name": "SingularDTV" + }, + { + "code": "snt", + "name": "Status" + }, + { + "code": "steem", + "name": "Steem" + }, + { + "code": "storj", + "name": "Storj" + }, + { + "code": "time", + "name": "ChronoBank" + }, + { + "code": "tkn", + "name": "TokenCard" + }, + { + "code": "trst", + "name": "WeTrust" + }, + { + "code": "uah", + "name": "Ukrainian Hryvnia" + }, + { + "code": "usd", + "name": "United States Dollar" + }, + { + "code": "wings", + "name": "Wings" + }, + { + "code": "xem", + "name": "NEM" + }, + { + "code": "xlm", + "name": "Stellar Lumen" + }, + { + "code": "xmr", + "name": "Monero" + }, + { + "code": "xrp", + "name": "Ripple" + }, + { + "code": "zec", + "name": "Zcash" + } +] diff --git a/ui/app/helpers/constants/infura-conversion.json b/ui/app/helpers/constants/infura-conversion.json deleted file mode 100644 index 9a96fe069be4..000000000000 --- a/ui/app/helpers/constants/infura-conversion.json +++ /dev/null @@ -1,653 +0,0 @@ -{ - "objects": [ - { - "symbol": "ethaud", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "aud", - "name": "Australian Dollar" - } - }, - { - "symbol": "ethhkd", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "hkd", - "name": "Hong Kong Dollar" - } - }, - { - "symbol": "ethsgd", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "sgd", - "name": "Singapore Dollar" - } - }, - { - "symbol": "ethidr", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "idr", - "name": "Indonesian Rupiah" - } - }, - { - "symbol": "ethphp", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "php", - "name": "Philippine Peso" - } - }, - { - "symbol": "eth1st", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "1st", - "name": "FirstBlood" - } - }, - { - "symbol": "ethadt", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "adt", - "name": "adToken" - } - }, - { - "symbol": "ethadx", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "adx", - "name": "AdEx" - } - }, - { - "symbol": "ethant", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "ant", - "name": "Aragon" - } - }, - { - "symbol": "ethbat", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "bat", - "name": "Basic Attention Token" - } - }, - { - "symbol": "ethbnt", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "bnt", - "name": "Bancor" - } - }, - { - "symbol": "ethbtc", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "btc", - "name": "Bitcoin" - } - }, - { - "symbol": "ethcad", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "cad", - "name": "Canadian Dollar" - } - }, - { - "symbol": "ethcfi", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "cfi", - "name": "Cofound.it" - } - }, - { - "symbol": "ethcrb", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "crb", - "name": "CreditBit" - } - }, - { - "symbol": "ethcvc", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "cvc", - "name": "Civic" - } - }, - { - "symbol": "ethdash", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "dash", - "name": "Dash" - } - }, - { - "symbol": "ethdgd", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "dgd", - "name": "DigixDAO" - } - }, - { - "symbol": "ethetc", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "etc", - "name": "Ethereum Classic" - } - }, - { - "symbol": "etheur", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "eur", - "name": "Euro" - } - }, - { - "symbol": "ethfun", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "fun", - "name": "FunFair" - } - }, - { - "symbol": "ethgbp", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "gbp", - "name": "Pound Sterling" - } - }, - { - "symbol": "ethgno", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "gno", - "name": "Gnosis" - } - }, - { - "symbol": "ethgnt", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "gnt", - "name": "Golem" - } - }, - { - "symbol": "ethgup", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "gup", - "name": "Matchpool" - } - }, - { - "symbol": "ethhmq", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "hmq", - "name": "Humaniq" - } - }, - { - "symbol": "ethjpy", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "jpy", - "name": "Japanese Yen" - } - }, - { - "symbol": "ethlgd", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "lgd", - "name": "Legends Room" - } - }, - { - "symbol": "ethlsk", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "lsk", - "name": "Lisk" - } - }, - { - "symbol": "ethltc", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "ltc", - "name": "Litecoin" - } - }, - { - "symbol": "ethlun", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "lun", - "name": "Lunyr" - } - }, - { - "symbol": "ethmco", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "mco", - "name": "Monaco" - } - }, - { - "symbol": "ethmtl", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "mtl", - "name": "Metal" - } - }, - { - "symbol": "ethmyst", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "myst", - "name": "Mysterium" - } - }, - { - "symbol": "ethnmr", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "nmr", - "name": "Numeraire" - } - }, - { - "symbol": "ethomg", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "omg", - "name": "OmiseGO" - } - }, - { - "symbol": "ethpay", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "pay", - "name": "TenX" - } - }, - { - "symbol": "ethptoy", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "ptoy", - "name": "Patientory" - } - }, - { - "symbol": "ethqrl", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "qrl", - "name": "Quantum-Resistant Ledger" - } - }, - { - "symbol": "ethqtum", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "qtum", - "name": "Qtum" - } - }, - { - "symbol": "ethrep", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "rep", - "name": "Augur" - } - }, - { - "symbol": "ethrlc", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "rlc", - "name": "iEx.ec" - } - }, - { - "symbol": "ethrub", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "rub", - "name": "Russian Ruble" - } - }, - { - "symbol": "ethsc", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "sc", - "name": "Siacoin" - } - }, - { - "symbol": "ethsngls", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "sngls", - "name": "SingularDTV" - } - }, - { - "symbol": "ethsnt", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "snt", - "name": "Status" - } - }, - { - "symbol": "ethsteem", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "steem", - "name": "Steem" - } - }, - { - "symbol": "ethstorj", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "storj", - "name": "Storj" - } - }, - { - "symbol": "ethtime", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "time", - "name": "ChronoBank" - } - }, - { - "symbol": "ethtkn", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "tkn", - "name": "TokenCard" - } - }, - { - "symbol": "ethtrst", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "trst", - "name": "WeTrust" - } - }, - { - "symbol": "ethuah", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "uah", - "name": "Ukrainian Hryvnia" - } - }, - { - "symbol": "ethusd", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "usd", - "name": "United States Dollar" - } - }, - { - "symbol": "ethwings", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "wings", - "name": "Wings" - } - }, - { - "symbol": "ethxem", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "xem", - "name": "NEM" - } - }, - { - "symbol": "ethxlm", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "xlm", - "name": "Stellar Lumen" - } - }, - { - "symbol": "ethxmr", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "xmr", - "name": "Monero" - } - }, - { - "symbol": "ethxrp", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "xrp", - "name": "Ripple" - } - }, - { - "symbol": "ethzec", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "zec", - "name": "Zcash" - } - } - ] -} diff --git a/ui/app/pages/settings/settings-tab/settings-tab.component.js b/ui/app/pages/settings/settings-tab/settings-tab.component.js index f8daa98f9341..d62838a971be 100644 --- a/ui/app/pages/settings/settings-tab/settings-tab.component.js +++ b/ui/app/pages/settings/settings-tab/settings-tab.component.js @@ -1,15 +1,15 @@ import React, { PureComponent } from 'react' import PropTypes from 'prop-types' -import infuraCurrencies from '../../../helpers/constants/infura-conversion.json' +import availableCurrencies from '../../../helpers/constants/available-conversions' import SimpleDropdown from '../../../components/app/dropdowns/simple-dropdown' import ToggleButton from '../../../components/ui/toggle-button' import locales from '../../../../../app/_locales/index.json' -const sortedCurrencies = infuraCurrencies.objects.sort((a, b) => { - return a.quote.name.toLocaleLowerCase().localeCompare(b.quote.name.toLocaleLowerCase()) +const sortedCurrencies = availableCurrencies.sort((a, b) => { + return a.name.toLocaleLowerCase().localeCompare(b.name.toLocaleLowerCase()) }) -const infuraCurrencyOptions = sortedCurrencies.map(({ quote: { code, name } }) => { +const currencyOptions = sortedCurrencies.map(({ code, name }) => { return { displayValue: `${code.toUpperCase()} - ${name}`, key: code, @@ -63,7 +63,7 @@ export default class SettingsTab extends PureComponent {
setCurrentCurrency(newCurrency)} /> From f91bd3a08dae076f5af3ffd622d267c8ee6bbe2d Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Wed, 29 Apr 2020 16:17:52 -0300 Subject: [PATCH 07/18] Backport "Snapshot txMeta without cloning history (#8363)" (#8458) Backport #8363 to v7.7.9. Note that this uses `clone` instead of `cloneDeep`, because `clone` hadn't yet been replaced by `cloneDeep` on `master`. Backporting that change as well would have been very disruptive, so I've updated this to use `clone` instead to minimize conflicts. It is functionally equivalent. Co-authored-by: Whymarrh Whitby --- CHANGELOG.md | 1 + .../transactions/lib/tx-state-history-helper.js | 15 +++++++-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 88de7b535edb..ad4f1102c57b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - [#8449](https://github.com/MetaMask/metamask-extension/pull/8449): Skip adding history entry for empty txMeta diffs - [#8447](https://github.com/MetaMask/metamask-extension/pull/8447): Delete Dai/Sai migration notification - [#8460](https://github.com/MetaMask/metamask-extension/pull/8460): Update deposit copy for Wyre +- [#8458](https://github.com/MetaMask/metamask-extension/pull/8458): Snapshot txMeta without cloning history ## 7.7.8 Wed Mar 11 2020 - [#8176](https://github.com/MetaMask/metamask-extension/pull/8176): Handle and set gas estimation when max mode is clicked diff --git a/app/scripts/controllers/transactions/lib/tx-state-history-helper.js b/app/scripts/controllers/transactions/lib/tx-state-history-helper.js index 76fc5c35b394..20e64696b28c 100644 --- a/app/scripts/controllers/transactions/lib/tx-state-history-helper.js +++ b/app/scripts/controllers/transactions/lib/tx-state-history-helper.js @@ -57,13 +57,12 @@ function replayHistory (_shortHistory) { } /** - @param txMeta {Object} - @returns {object} a clone object of the txMeta with out history -*/ + * Snapshot {@code txMeta} + * @param {Object} txMeta - the tx metadata object + * @returns {Object} a deep clone without history + */ function snapshotFromTxMeta (txMeta) { - // create txMeta snapshot for history - const snapshot = clone(txMeta) - // dont include previous history in this snapshot - delete snapshot.history - return snapshot + const shallow = { ...txMeta } + delete shallow.history + return clone(shallow) } From 3dc8387a966e44b5df8d9c3e1fcbfa9fa20fdbd9 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Wed, 29 Apr 2020 17:02:16 -0300 Subject: [PATCH 08/18] Backport "Fix method registry initialization (#8200)" (#8459) Backport #8200 to v7.7.9. Original commit description: The method registry was being initialized with the global variable `ethereumProvider` before that variable was set. As a result, the method registry was falling back to an internally constructed provider that used the wrong provider URL (an obsolete Infura API). This was resulting in an error with the message "Project ID not found". The method registry is now initialized lazily, when it's first needed. This should be well after the initialization of `ethereumProvider`, which occurs during the UI initialization. --- CHANGELOG.md | 1 + ui/app/helpers/utils/transactions.util.js | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad4f1102c57b..0dd0ce8a8fda 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - [#8447](https://github.com/MetaMask/metamask-extension/pull/8447): Delete Dai/Sai migration notification - [#8460](https://github.com/MetaMask/metamask-extension/pull/8460): Update deposit copy for Wyre - [#8458](https://github.com/MetaMask/metamask-extension/pull/8458): Snapshot txMeta without cloning history +- [#8459](https://github.com/MetaMask/metamask-extension/pull/8459): Fix method registry initialization ## 7.7.8 Wed Mar 11 2020 - [#8176](https://github.com/MetaMask/metamask-extension/pull/8176): Handle and set gas estimation when max mode is clicked diff --git a/ui/app/helpers/utils/transactions.util.js b/ui/app/helpers/utils/transactions.util.js index 1f8c6e952a50..f198635e7c7a 100644 --- a/ui/app/helpers/utils/transactions.util.js +++ b/ui/app/helpers/utils/transactions.util.js @@ -47,8 +47,7 @@ async function getMethodFrom4Byte (fourBytePrefix) { return null } } - -const registry = new MethodRegistry({ provider: global.ethereumProvider }) +let registry /** * Attempts to return the method data from the MethodRegistry library, the message registry library and the token abi, in that order of preference @@ -62,6 +61,10 @@ export async function getMethodDataAsync (fourBytePrefix) { return null }) + if (!registry) { + registry = new MethodRegistry({ provider: global.ethereumProvider }) + } + let sig = await registry.lookup(fourBytePrefix) if (!sig) { From 361c57191dcaf0eb147300f9b840845c655b5c67 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Wed, 29 Apr 2020 17:44:27 -0300 Subject: [PATCH 09/18] Backport "Fixes #5706 - Adds Dai/Sai to currency display (#7986)" (#8455) Backport #7986 onto v7.7.9. The original commit message follows: With the change from infura to cryptocompare https://github.com/MetaMask/gaba/pull/30/files#diff-50c3c47cc5fa12e5213a6cc900476f41L41-R48 we have numerous conversion rates to go through and add if we like to. Co-authored-by: Thomas Huang --- CHANGELOG.md | 1 + ui/app/helpers/constants/available-conversions.json | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0dd0ce8a8fda..6a865ddb6ed6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - [#8460](https://github.com/MetaMask/metamask-extension/pull/8460): Update deposit copy for Wyre - [#8458](https://github.com/MetaMask/metamask-extension/pull/8458): Snapshot txMeta without cloning history - [#8459](https://github.com/MetaMask/metamask-extension/pull/8459): Fix method registry initialization +- [#8455](https://github.com/MetaMask/metamask-extension/pull/8455): Add Dai/Sai to currency display ## 7.7.8 Wed Mar 11 2020 - [#8176](https://github.com/MetaMask/metamask-extension/pull/8176): Handle and set gas estimation when max mode is clicked diff --git a/ui/app/helpers/constants/available-conversions.json b/ui/app/helpers/constants/available-conversions.json index 61722de39c29..4acb5f2ad808 100644 --- a/ui/app/helpers/constants/available-conversions.json +++ b/ui/app/helpers/constants/available-conversions.json @@ -234,5 +234,13 @@ { "code": "zec", "name": "Zcash" + }, + { + "code": "dai", + "name": "DAI" + }, + { + "code": "sai", + "name": "SAI" } ] From 4d9d732fe25d51ba098fac8c1f37361586d42780 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Wed, 29 Apr 2020 18:34:31 -0300 Subject: [PATCH 10/18] Backport "fix destructuring of lastSelectedProvider (#8197)" (#8461) Backport #8197 to v7.7.9. Co-authored-by: Brad Decker --- .../loading-network-screen/loading-network-screen.container.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/app/components/app/loading-network-screen/loading-network-screen.container.js b/ui/app/components/app/loading-network-screen/loading-network-screen.container.js index 87f1397ce5b6..893ee45d248a 100644 --- a/ui/app/components/app/loading-network-screen/loading-network-screen.container.js +++ b/ui/app/components/app/loading-network-screen/loading-network-screen.container.js @@ -7,10 +7,10 @@ const mapStateToProps = state => { const { loadingMessage, currentView, + lastSelectedProvider, } = state.appState const { provider, - lastSelectedProvider, network, } = state.metamask const { rpcTarget, chainId, ticker, nickname, type } = provider From 02329541e543cc5adfd60081a8f5af82876c03da Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Wed, 29 Apr 2020 18:35:08 -0300 Subject: [PATCH 11/18] Backport "Add INR currency option (#7673)" (#8457) Backport #7673 to v7.7.9. Co-authored-by: Whymarrh Whitby --- ui/app/helpers/constants/available-conversions.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ui/app/helpers/constants/available-conversions.json b/ui/app/helpers/constants/available-conversions.json index 4acb5f2ad808..913e8795fb44 100644 --- a/ui/app/helpers/constants/available-conversions.json +++ b/ui/app/helpers/constants/available-conversions.json @@ -15,6 +15,10 @@ "code": "idr", "name": "Indonesian Rupiah" }, + { + "code": "inr", + "name": "Indian Rupee" + }, { "code": "php", "name": "Philippine Peso" From 8a8c774e6d17f55325de1e7007757e672fe5e487 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Wed, 29 Apr 2020 18:35:59 -0300 Subject: [PATCH 12/18] Backport "Fix Kovan and Rinkeby chain IDs (#7762)" (#8462) Backport #7762 to v7.7.9 Co-authored-by: Sirius Tsou --- .../networks-tab/networks-tab.constants.js | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/ui/app/pages/settings/networks-tab/networks-tab.constants.js b/ui/app/pages/settings/networks-tab/networks-tab.constants.js index 1a49ca04f06b..453a616b209b 100644 --- a/ui/app/pages/settings/networks-tab/networks-tab.constants.js +++ b/ui/app/pages/settings/networks-tab/networks-tab.constants.js @@ -17,21 +17,12 @@ const defaultNetworksData = [ ticker: 'ETH', blockExplorerUrl: 'https://ropsten.etherscan.io', }, - { - labelKey: 'kovan', - iconColor: '#9064FF', - providerType: 'kovan', - rpcUrl: 'https://api.infura.io/v1/jsonrpc/kovan', - chainId: '4', - ticker: 'ETH', - blockExplorerUrl: 'https://etherscan.io', - }, { labelKey: 'rinkeby', iconColor: '#F6C343', providerType: 'rinkeby', rpcUrl: 'https://api.infura.io/v1/jsonrpc/rinkeby', - chainId: '42', + chainId: '4', ticker: 'ETH', blockExplorerUrl: 'https://rinkeby.etherscan.io', }, @@ -44,6 +35,15 @@ const defaultNetworksData = [ ticker: 'ETH', blockExplorerUrl: 'https://goerli.etherscan.io', }, + { + labelKey: 'kovan', + iconColor: '#9064FF', + providerType: 'kovan', + rpcUrl: 'https://api.infura.io/v1/jsonrpc/kovan', + chainId: '42', + ticker: 'ETH', + blockExplorerUrl: 'https://etherscan.io', + }, { labelKey: 'localhost', iconColor: 'white', From aab262a3d120f41554dee13118795e1b0a8d5cf1 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Wed, 29 Apr 2020 18:40:20 -0300 Subject: [PATCH 13/18] Backport "Use ethereum-ens-network-map for network support (#7960)" (#8465) Backport #7960 to v7.7.9 Co-authored-by: Whymarrh Whitby --- app/scripts/controllers/ens/ens.js | 2 +- package.json | 1 + .../send/send-content/add-recipient/ens-input.component.js | 2 +- yarn.lock | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/scripts/controllers/ens/ens.js b/app/scripts/controllers/ens/ens.js index eb2586a7d3ce..71996f4de331 100644 --- a/app/scripts/controllers/ens/ens.js +++ b/app/scripts/controllers/ens/ens.js @@ -1,5 +1,5 @@ const EthJsEns = require('ethjs-ens') -const ensNetworkMap = require('ethjs-ens/lib/network-map.json') +const ensNetworkMap = require('ethereum-ens-network-map') class Ens { static getNetworkEnsSupport (network) { diff --git a/package.json b/package.json index 578da2a78883..8628c6bbcd68 100644 --- a/package.json +++ b/package.json @@ -101,6 +101,7 @@ "eth-sig-util": "^2.3.0", "eth-token-tracker": "^1.1.10", "eth-trezor-keyring": "^0.4.0", + "ethereum-ens-network-map": "^1.0.2", "ethereumjs-abi": "^0.6.4", "ethereumjs-tx": "1.3.7", "ethereumjs-util": "5.1.0", diff --git a/ui/app/pages/send/send-content/add-recipient/ens-input.component.js b/ui/app/pages/send/send-content/add-recipient/ens-input.component.js index 11b9c5cb5beb..48a7d81525d3 100644 --- a/ui/app/pages/send/send-content/add-recipient/ens-input.component.js +++ b/ui/app/pages/send/send-content/add-recipient/ens-input.component.js @@ -7,7 +7,7 @@ import { ellipsify } from '../../send.utils' import debounce from 'debounce' import copyToClipboard from 'copy-to-clipboard/index' import ENS from 'ethjs-ens' -import networkMap from 'ethjs-ens/lib/network-map.json' +import networkMap from 'ethereum-ens-network-map' import log from 'loglevel' diff --git a/yarn.lock b/yarn.lock index 25712b7ed677..12a9a4124896 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10369,7 +10369,7 @@ ethereum-common@^0.0.18: resolved "https://registry.yarnpkg.com/ethereum-common/-/ethereum-common-0.0.18.tgz#2fdc3576f232903358976eb39da783213ff9523f" integrity sha1-L9w1dvIykDNYl26znaeDIT/5Uj8= -ethereum-ens-network-map@^1.0.0: +ethereum-ens-network-map@^1.0.0, ethereum-ens-network-map@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/ethereum-ens-network-map/-/ethereum-ens-network-map-1.0.2.tgz#4e27bad18dae7bd95d84edbcac2c9e739fc959b9" integrity sha512-5qwJ5n3YhjSpE6O/WEBXCAb2nagUgyagJ6C0lGUBWC4LjKp/rRzD+pwtDJ6KCiITFEAoX4eIrWOjRy0Sylq5Hg== From 2d36d422ee6a015c9074b9afd70a1cbe0a0d81ad Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Wed, 29 Apr 2020 18:40:34 -0300 Subject: [PATCH 14/18] Backport "Updating deprecated Etherscam link (#7464)" (#8463) Backport #7464 to v7.7.9 Co-authored-by: Alice Henshaw <34962750+alicevhenshaw@users.noreply.github.com> Co-authored-by: Whymarrh Whitby --- app/phishing.html | 2 +- app/scripts/phishing-detect.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/phishing.html b/app/phishing.html index 1e1c4d11cefb..515beea81888 100644 --- a/app/phishing.html +++ b/app/phishing.html @@ -47,7 +47,7 @@

Ethereum Phishing Detector. Domains on these warning lists may include outright malicious websites and legitimate websites that have been compromised by a malicious actor.

-

To read more about this site please review the domain on Etherscam.

+

To read more about this site please search for the domain on CryptoScamDB.

Note that this warning list is compiled on a voluntary basis. This list may be inaccurate or incomplete. Just because a domain does not appear on this list is not an implicit guarantee of that domain's safety. diff --git a/app/scripts/phishing-detect.js b/app/scripts/phishing-detect.js index 266e4fc312be..ad62749bbce7 100644 --- a/app/scripts/phishing-detect.js +++ b/app/scripts/phishing-detect.js @@ -14,7 +14,7 @@ function start () { const hash = window.location.hash.substring(1) const suspect = querystring.parse(hash) - document.getElementById('esdbLink').href = `https://etherscamdb.info/domain/${suspect.hostname}` + document.getElementById('csdbLink').href = `https://cryptoscamdb.org/search` global.platform = new ExtensionPlatform() global.METAMASK_UI_TYPE = windowType From 14d4c107e54e2a3000a826818b00667635033611 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Thu, 30 Apr 2020 11:38:33 -0300 Subject: [PATCH 15/18] Backport "Don't updatePendingTxs outside of block updates (#8445)" (#8474) Backport #8445 to v7.7.9. Original commit description: * Don't updatePendingTxs outside of block updates Refs #8377 Reverts 507397f6c (#5431) * Check for new block data on unlock Co-authored-by: Whymarrh Whitby --- app/scripts/controllers/transactions/index.js | 1 - app/scripts/metamask-controller.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/app/scripts/controllers/transactions/index.js b/app/scripts/controllers/transactions/index.js index fa82b4f19eff..808c224c39a1 100644 --- a/app/scripts/controllers/transactions/index.js +++ b/app/scripts/controllers/transactions/index.js @@ -724,7 +724,6 @@ class TransactionController extends EventEmitter { Updates the memStore in transaction controller */ _updateMemstore () { - this.pendingTxTracker.updatePendingTxs() const unapprovedTxs = this.txStateManager.getUnapprovedTxList() const selectedAddressTxList = this.txStateManager.getFilteredTxList({ from: this.getSelectedAddress(), diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 9eb46a40e518..0d7b0a598127 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -767,7 +767,7 @@ module.exports = class MetamaskController extends EventEmitter { } await this.preferencesController.syncAddresses(accounts) - await this.txController.pendingTxTracker.updatePendingTxs() + await this.blockTracker.checkForLatestBlock() try { const threeBoxSyncingAllowed = this.threeBoxController.getThreeBoxSyncingState() From b64cbbdbacd7b1af25424feabc881307b90a9643 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Thu, 30 Apr 2020 11:38:55 -0300 Subject: [PATCH 16/18] Backport "update eth-contract-metadata (#8466)" (#8476) Backport #8466 to v7.7.9 Co-authored-by: Erik Marks <25517051+rekmarks@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 8628c6bbcd68..8fb06842dd0b 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,7 @@ "dnode": "^1.2.2", "end-of-stream": "^1.1.0", "eth-block-tracker": "^4.4.2", - "eth-contract-metadata": "^1.12.1", + "eth-contract-metadata": "^1.13.0", "eth-ens-namehash": "^2.0.8", "eth-json-rpc-errors": "^1.1.0", "eth-json-rpc-filters": "^4.1.1", diff --git a/yarn.lock b/yarn.lock index 12a9a4124896..f83ad6d26e8f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10049,10 +10049,10 @@ eth-block-tracker@^4.4.2: pify "^3.0.0" safe-event-emitter "^1.0.1" -eth-contract-metadata@^1.11.0, eth-contract-metadata@^1.12.1: - version "1.12.1" - resolved "https://registry.yarnpkg.com/eth-contract-metadata/-/eth-contract-metadata-1.12.1.tgz#41014c8c0123453cee15acbcc14299c4d470c759" - integrity sha512-9u2jUcdxaKIv4RvA9RtjyD4+M2yWt4yCulR5bpdQTiG3HUFnN9lHtNL5NIRDpvQVJKerFhexrgEM2WdGP3a6VA== +eth-contract-metadata@^1.11.0, eth-contract-metadata@^1.13.0: + version "1.13.0" + resolved "https://registry.yarnpkg.com/eth-contract-metadata/-/eth-contract-metadata-1.13.0.tgz#9819d0e556ea2187da91d6b49ce96abc5fce2a73" + integrity sha512-9CjXHX8IdXysUEvOHdbCsjdAwM1E98jaeK2HeOqm/9S/vOZ8YryaBBt/YSiBq3MkpCwf+d1pEQ53p96rsdy52w== eth-ens-namehash@2.0.8, eth-ens-namehash@^2.0.8: version "2.0.8" From 8d8a17d2011e6e86f901e727af620ea4f14bbd61 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Thu, 30 Apr 2020 11:58:49 -0300 Subject: [PATCH 17/18] Update changelog for v7.7.9 (#8477) --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a865ddb6ed6..cc32416cbb0b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,13 @@ - [#8458](https://github.com/MetaMask/metamask-extension/pull/8458): Snapshot txMeta without cloning history - [#8459](https://github.com/MetaMask/metamask-extension/pull/8459): Fix method registry initialization - [#8455](https://github.com/MetaMask/metamask-extension/pull/8455): Add Dai/Sai to currency display +- [#8461](https://github.com/MetaMask/metamask-extension/pull/8461): Prevent network switch upon close of network timeout overlay +- [#8457](https://github.com/MetaMask/metamask-extension/pull/8457): Add INR currency option +- [#8462](https://github.com/MetaMask/metamask-extension/pull/8462): Fix display of Kovan and Rinkeby chain IDs +- [#8465](https://github.com/MetaMask/metamask-extension/pull/8465): Use ethereum-ens-network-map for network support +- [#8463](https://github.com/MetaMask/metamask-extension/pull/8463): Update deprecated Etherscam link +- [#8474](https://github.com/MetaMask/metamask-extension/pull/8474): Only update pending transactions upon block update +- [#8476](https://github.com/MetaMask/metamask-extension/pull/8476): Update eth-contract-metadata ## 7.7.8 Wed Mar 11 2020 - [#8176](https://github.com/MetaMask/metamask-extension/pull/8176): Handle and set gas estimation when max mode is clicked From b81558ae8fac602019fec5dee439fbf8e48c7c09 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Mon, 4 May 2020 13:43:22 -0300 Subject: [PATCH 18/18] Backport "fixed Tohen Typo (#7808)" (#8509) Backport #7808 to v7.7.9 Co-authored-by: Lenard Frommelt --- CHANGELOG.md | 1 + app/_locales/de/messages.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc32416cbb0b..b114a57e31c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ - [#8463](https://github.com/MetaMask/metamask-extension/pull/8463): Update deprecated Etherscam link - [#8474](https://github.com/MetaMask/metamask-extension/pull/8474): Only update pending transactions upon block update - [#8476](https://github.com/MetaMask/metamask-extension/pull/8476): Update eth-contract-metadata +- [#8509](https://github.com/MetaMask/metamask-extension/pull/8509): Fix Tohen Typo ## 7.7.8 Wed Mar 11 2020 - [#8176](https://github.com/MetaMask/metamask-extension/pull/8176): Handle and set gas estimation when max mode is clicked diff --git a/app/_locales/de/messages.json b/app/_locales/de/messages.json index 5f241ab05079..705d7f92eae8 100644 --- a/app/_locales/de/messages.json +++ b/app/_locales/de/messages.json @@ -328,7 +328,7 @@ "message": "Höhere Gebühren können Bearbeitungszeiten verkürzen, wofür es allerdings keine Garantie gibt." }, "customToken": { - "message": "Custom-Tohen" + "message": "Custom-Token" }, "customRPC": { "message": "Spezieller RPC"