Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Commit

Permalink
Merge pull request #145 from brave/metamask-v7.7.9
Browse files Browse the repository at this point in the history
Metamask v7.7.9 Upstream Rebase
  • Loading branch information
ryanml authored Jun 22, 2020
2 parents af9c07f + 478200f commit 20c494e
Show file tree
Hide file tree
Showing 32 changed files with 335 additions and 860 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@

## Current Develop Branch

## 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
- [#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
- [#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
- [#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
- [#8178](https://github.com/MetaMask/metamask-extension/pull/8178): Use specified gas limit when speeding up a transaction
Expand Down
2 changes: 1 addition & 1 deletion app/_locales/de/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,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"
},
"customize": {
"message": "Anpassen"
Expand Down
11 changes: 1 addition & 10 deletions app/_locales/en/messages.json
Original file line number Diff line number Diff line change
@@ -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"
},
Expand Down Expand Up @@ -238,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"
Expand Down
2 changes: 1 addition & 1 deletion app/manifest.json
Original file line number Diff line number Diff line change
@@ -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__",
Expand Down
2 changes: 1 addition & 1 deletion app/phishing.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ <h1>
<a href="https://github.com/metamask/eth-phishing-detect">Ethereum Phishing Detector</a>.
Domains on these warning lists may include outright malicious websites and legitimate websites that have been compromised by a malicious actor.
</p>
<p>To read more about this site <a id="esdbLink">please review the domain on Etherscam</a>.</p>
<p>To read more about this site <a id="csdbLink">please search for the domain on CryptoScamDB</a>.</p>
<p>
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.
Expand Down
1 change: 0 additions & 1 deletion app/scripts/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,6 @@ function triggerUi () {
const currentlyActiveMetamaskTab = Boolean(tabs.find(tab => openMetamaskTabsIDs[tab.id]))
if (!popupIsOpen && !currentlyActiveMetamaskTab && !notificationIsOpen) {
notificationManager.showPopup()
notificationIsOpen = true
}
})
}
Expand Down
7 changes: 0 additions & 7 deletions app/scripts/controllers/app-state.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ class AppStateController {
this.onInactiveTimeout = onInactiveTimeout || (() => {})
this.store = new ObservableStore(extend({
timeoutMinutes: 0,
mkrMigrationReminderTimestamp: null,
}, initState))
this.timer = null

Expand All @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/controllers/ens/ens.js
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
1 change: 0 additions & 1 deletion app/scripts/controllers/transactions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
4 changes: 3 additions & 1 deletion app/scripts/controllers/transactions/tx-state-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions app/scripts/metamask-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -768,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()
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/phishing-detect.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions brave/ui/app/pages/home/home.container.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { compose } from 'recompose'
import { connect } from 'react-redux'
import { withRouter } from 'react-router-dom'
import { unconfirmedTransactionsCountSelector } from '../../../../../ui/app/selectors/confirm-transaction'
import { getCurrentEthBalance, getDaiV1Token } from '../../../../../ui/app/selectors/selectors'
import { getCurrentEthBalance } from '../../../../../ui/app/selectors/selectors'
import {
addTokens,
setHardwareConnect,
Expand Down Expand Up @@ -48,7 +48,6 @@ const mapStateToProps = state => {
showRestorePrompt,
selectedAddress,
threeBoxLastUpdated,
hasDaiV1Token: Boolean(getDaiV1Token(state)),
batTokenAdded,
hardwareConnect,
providerRequests,
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,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",
Expand All @@ -126,6 +126,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",
Expand Down
17 changes: 17 additions & 0 deletions test/unit/app/controllers/transactions/tx-state-manager-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down
6 changes: 3 additions & 3 deletions test/unit/balance-formatter-test.js
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion ui/app/components/app/dai-migration-component/index.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit 20c494e

Please sign in to comment.