mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Merge pull request #8937 from MetaMask/Version-v8.0.4
Version v8.0.4 RC
This commit is contained in:
commit
5a3ae85b72
@ -2,6 +2,10 @@
|
||||
|
||||
## Current Develop Branch
|
||||
|
||||
## 8.0.4 Tue Jul 07 2020
|
||||
- [#8934](https://github.com/MetaMask/metamask-extension/pull/8934): Fix transaction activity on custom networks
|
||||
- [#8936](https://github.com/MetaMask/metamask-extension/pull/8936): Fix account tracker optimization
|
||||
|
||||
## 8.0.3 Mon Jul 06 2020
|
||||
- [#8921](https://github.com/MetaMask/metamask-extension/pull/8921): Restore missing 'data' provider event, and fix 'notification' event
|
||||
- [#8923](https://github.com/MetaMask/metamask-extension/pull/8923): Normalize the 'from' parameter for `eth_sendTransaction`
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "__MSG_appName__",
|
||||
"short_name": "__MSG_appName__",
|
||||
"version": "8.0.3",
|
||||
"version": "8.0.4",
|
||||
"manifest_version": 2,
|
||||
"author": "https://metamask.io",
|
||||
"description": "__MSG_appDescription__",
|
||||
|
@ -191,19 +191,19 @@ export default class AccountTracker {
|
||||
const currentNetwork = this.network.getNetworkState()
|
||||
|
||||
switch (currentNetwork) {
|
||||
case MAINNET_NETWORK_ID:
|
||||
case MAINNET_NETWORK_ID.toString():
|
||||
await this._updateAccountsViaBalanceChecker(addresses, SINGLE_CALL_BALANCES_ADDRESS)
|
||||
break
|
||||
|
||||
case RINKEBY_NETWORK_ID:
|
||||
case RINKEBY_NETWORK_ID.toString():
|
||||
await this._updateAccountsViaBalanceChecker(addresses, SINGLE_CALL_BALANCES_ADDRESS_RINKEBY)
|
||||
break
|
||||
|
||||
case ROPSTEN_NETWORK_ID:
|
||||
case ROPSTEN_NETWORK_ID.toString():
|
||||
await this._updateAccountsViaBalanceChecker(addresses, SINGLE_CALL_BALANCES_ADDRESS_ROPSTEN)
|
||||
break
|
||||
|
||||
case KOVAN_NETWORK_ID:
|
||||
case KOVAN_NETWORK_ID.toString():
|
||||
await this._updateAccountsViaBalanceChecker(addresses, SINGLE_CALL_BALANCES_ADDRESS_KOVAN)
|
||||
break
|
||||
|
||||
|
@ -20,6 +20,7 @@ module.exports = function (api) {
|
||||
'@babel/plugin-proposal-class-properties',
|
||||
'@babel/plugin-proposal-object-rest-spread',
|
||||
'@babel/plugin-proposal-optional-chaining',
|
||||
'@babel/plugin-proposal-nullish-coalescing-operator',
|
||||
],
|
||||
}
|
||||
}
|
||||
|
@ -181,6 +181,7 @@
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.5.5",
|
||||
"@babel/plugin-proposal-class-properties": "^7.5.5",
|
||||
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.10.4",
|
||||
"@babel/plugin-proposal-object-rest-spread": "^7.5.5",
|
||||
"@babel/plugin-proposal-optional-chaining": "^7.8.3",
|
||||
"@babel/plugin-transform-runtime": "^7.5.5",
|
||||
|
@ -74,14 +74,14 @@ export default class TransactionActivityLog extends PureComponent {
|
||||
const ethValue = index === 0
|
||||
? `${getValueFromWeiHex({
|
||||
value,
|
||||
fromCurrency: nativeCurrency,
|
||||
toCurrency: nativeCurrency,
|
||||
fromCurrency: 'ETH',
|
||||
toCurrency: 'ETH',
|
||||
conversionRate,
|
||||
numberOfDecimals: 6,
|
||||
})} ${nativeCurrency}`
|
||||
: getEthConversionFromWeiHex({
|
||||
value,
|
||||
fromCurrency: nativeCurrency,
|
||||
fromCurrency: 'ETH',
|
||||
conversionRate,
|
||||
numberOfDecimals: 3,
|
||||
})
|
||||
|
@ -333,3 +333,23 @@ export function isExtensionUrl (urlLike) {
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether an address is in a passed list of objects with address properties. The check is performed on the
|
||||
* lowercased version of the addresses.
|
||||
*
|
||||
* @param {string} address - The hex address to check
|
||||
* @param {array} list - The array of objects to check
|
||||
* @returns {boolean} Whether or not the address is in the list
|
||||
*/
|
||||
export function checkExistingAddresses (address, list = []) {
|
||||
if (!address) {
|
||||
return false
|
||||
}
|
||||
|
||||
const matchesAddress = (obj) => {
|
||||
return obj.address.toLowerCase() === address.toLowerCase()
|
||||
}
|
||||
|
||||
return list.some(matchesAddress)
|
||||
}
|
||||
|
@ -319,4 +319,33 @@ describe('util', function () {
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('checkExistingAddresses', function () {
|
||||
const tokenList = [
|
||||
{ address: 'A' },
|
||||
{ address: 'n' },
|
||||
{ address: 'Q' },
|
||||
{ address: 'z' },
|
||||
]
|
||||
|
||||
it('should return true when a lowercase address matches an uppercase address in the passed list', function () {
|
||||
assert(util.checkExistingAddresses('q', tokenList) === true)
|
||||
})
|
||||
|
||||
it('should return true when an uppercase address matches a lowercase address in the passed list', function () {
|
||||
assert(util.checkExistingAddresses('N', tokenList) === true)
|
||||
})
|
||||
|
||||
it('should return true when a lowercase address matches a lowercase address in the passed list', function () {
|
||||
assert(util.checkExistingAddresses('z', tokenList) === true)
|
||||
})
|
||||
|
||||
it('should return true when an uppercase address matches an uppercase address in the passed list', function () {
|
||||
assert(util.checkExistingAddresses('Q', tokenList) === true)
|
||||
})
|
||||
|
||||
it('should return false when the passed address is not in the passed list', function () {
|
||||
assert(util.checkExistingAddresses('b', tokenList) === false)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React, { Component } from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import ethUtil from 'ethereumjs-util'
|
||||
import { checkExistingAddresses } from './util'
|
||||
import { checkExistingAddresses } from '../../helpers/utils/util'
|
||||
import { tokenInfoGetter } from '../../helpers/utils/token-util'
|
||||
import { CONFIRM_ADD_TOKEN_ROUTE } from '../../helpers/constants/routes'
|
||||
import TextField from '../../components/ui/text-field'
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React, { Component } from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import classnames from 'classnames'
|
||||
import { checkExistingAddresses } from '../util'
|
||||
import { checkExistingAddresses } from '../../../helpers/utils/util'
|
||||
import TokenListPlaceholder from './token-list-placeholder'
|
||||
|
||||
export default class InfoBox extends Component {
|
||||
|
@ -1,13 +0,0 @@
|
||||
import R from 'ramda'
|
||||
|
||||
export function checkExistingAddresses (address, tokenList = []) {
|
||||
if (!address) {
|
||||
return false
|
||||
}
|
||||
|
||||
const matchesAddress = (existingToken) => {
|
||||
return existingToken.address.toLowerCase() === address.toLowerCase()
|
||||
}
|
||||
|
||||
return R.any(matchesAddress)(tokenList)
|
||||
}
|
@ -5,9 +5,7 @@ import {
|
||||
INVALID_RECIPIENT_ADDRESS_NOT_ETH_NETWORK_ERROR,
|
||||
} from '../../send.constants'
|
||||
|
||||
import { isValidAddress, isEthNetwork } from '../../../../helpers/utils/util'
|
||||
import { checkExistingAddresses } from '../../../add-token/util'
|
||||
|
||||
import { isValidAddress, isEthNetwork, checkExistingAddresses } from '../../../../helpers/utils/util'
|
||||
import ethUtil from 'ethereumjs-util'
|
||||
import contractMap from 'eth-contract-metadata'
|
||||
|
||||
|
20
yarn.lock
20
yarn.lock
@ -228,6 +228,11 @@
|
||||
resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0.tgz#bbb3fbee98661c569034237cc03967ba99b4f250"
|
||||
integrity sha512-CYAOUCARwExnEixLdB6sDm2dIJ/YgEAKDM1MOeMeZu9Ld/bDgVo8aiWrXwcY7OBh+1Ea2uUcVRcxKk0GJvW7QA==
|
||||
|
||||
"@babel/helper-plugin-utils@^7.10.4":
|
||||
version "7.10.4"
|
||||
resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz#2f75a831269d4f677de49986dff59927533cf375"
|
||||
integrity sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==
|
||||
|
||||
"@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3":
|
||||
version "7.8.3"
|
||||
resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz#9ea293be19babc0f52ff8ca88b34c3611b208670"
|
||||
@ -342,6 +347,14 @@
|
||||
"@babel/helper-plugin-utils" "^7.0.0"
|
||||
"@babel/plugin-syntax-json-strings" "^7.2.0"
|
||||
|
||||
"@babel/plugin-proposal-nullish-coalescing-operator@^7.10.4":
|
||||
version "7.10.4"
|
||||
resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.10.4.tgz#02a7e961fc32e6d5b2db0649e01bf80ddee7e04a"
|
||||
integrity sha512-wq5n1M3ZUlHl9sqT2ok1T2/MTt6AXE0e1Lz4WzWBr95LsAZ5qDXe4KnFuauYyEyLiohvXFMdbsOTMyLZs91Zlw==
|
||||
dependencies:
|
||||
"@babel/helper-plugin-utils" "^7.10.4"
|
||||
"@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.0"
|
||||
|
||||
"@babel/plugin-proposal-object-rest-spread@^7.4.4", "@babel/plugin-proposal-object-rest-spread@^7.5.5", "@babel/plugin-proposal-object-rest-spread@^7.6.2":
|
||||
version "7.8.3"
|
||||
resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.8.3.tgz#eb5ae366118ddca67bed583b53d7554cad9951bb"
|
||||
@ -410,6 +423,13 @@
|
||||
dependencies:
|
||||
"@babel/helper-plugin-utils" "^7.0.0"
|
||||
|
||||
"@babel/plugin-syntax-nullish-coalescing-operator@^7.8.0":
|
||||
version "7.8.3"
|
||||
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz#167ed70368886081f74b5c36c65a88c03b66d1a9"
|
||||
integrity sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==
|
||||
dependencies:
|
||||
"@babel/helper-plugin-utils" "^7.8.0"
|
||||
|
||||
"@babel/plugin-syntax-object-rest-spread@^7.2.0":
|
||||
version "7.2.0"
|
||||
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.2.0.tgz#3b7a3e733510c57e820b9142a6579ac8b0dfad2e"
|
||||
|
Loading…
Reference in New Issue
Block a user