aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md2
-rw-r--r--app/_locales/es/messages.json36
-rw-r--r--app/manifest.json2
-rw-r--r--development/sourcemap-validator.js93
-rw-r--r--ui/app/util.js3
5 files changed, 93 insertions, 43 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index bf897c864..f82a8f306 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,8 @@
## Current Develop Branch
+## 6.2.1 Wed Mar 06 2019
+
## 6.2.0 Tue Mar 05 2019
- [#6192](https://github.com/MetaMask/metamask-extension/pull/6192): Improves design and UX of onboarding flow
- [#6195](https://github.com/MetaMask/metamask-extension/pull/6195): Fixes gas estimation when sending to contracts
diff --git a/app/_locales/es/messages.json b/app/_locales/es/messages.json
index 04e0c9f05..8033b962c 100644
--- a/app/_locales/es/messages.json
+++ b/app/_locales/es/messages.json
@@ -686,7 +686,7 @@
"message": "Restaurar desde semilla"
},
"restoreVault": {
- "message": "Restaurar Bóveda"
+ "message": "Restaurar bóveda"
},
"retryWithMoreGas": {
"message": "Vuelva a intentar con un precio de gas más alto aquí"
@@ -1168,10 +1168,10 @@
"message": "Nuevo URL de RPC"
},
"showAdvancedOptions": {
- "message": "Mostrar Opciones Avanzadas"
+ "message": "Mostrar opciones avanzadas"
},
"hideAdvancedOptions": {
- "message": "Ocultar Opciones Avanzadas"
+ "message": "Ocultar opciones avanzadas"
},
"optionalChainId": {
"message": "ChainID (opcional)"
@@ -1183,13 +1183,13 @@
"message": "Apodo (opcional)"
},
"newTotal": {
- "message": "Nuevo Total"
+ "message": "Nuevo total"
},
"newTransactionFee": {
- "message": "Nueva Comisión por Transacción"
+ "message": "Nueva Comisión por transacción"
},
"noConversionRateAvailable": {
- "message": "No Hay Tasa de Conversión"
+ "message": "No hay tasa de conversión"
},
"notFound": {
"message": "No se encontró"
@@ -1238,7 +1238,7 @@
"message": "Prev"
},
"primaryCurrencySetting": {
- "message": "Moneda Principal"
+ "message": "Moneda principal"
},
"primaryCurrencySettingDescription": {
"message": "Seleccionar nativa para prioritizar el que se muestren los valores en la moneda nativa de la cadena (p.ej. ETH). Seleccionar Fíat para prioritzar el que se muestren los valores en la moneda fíat seleccionada."
@@ -1247,10 +1247,10 @@
"message": "Cola"
},
"rejectAll": {
- "message": "Rechazar a Todos"
+ "message": "Rechazar todas"
},
"rejectTxsN": {
- "message": "Rechazar a transacciones de $1"
+ "message": "Rechazar transacciones de $1"
},
"rejectTxsDescription": {
"message": "Está al punto de rechazar transacciones de $1 en lote."
@@ -1271,7 +1271,7 @@
"message": "Restaurar"
},
"revealSeedWordsTitle": {
- "message": "Frase Semilla"
+ "message": "Frase semilla"
},
"revealSeedWordsDescription": {
"message": "Si en algún momento cambias de navegador o de ordenador, necesitarás esta frase semilla para acceder a tus cuentas. Guárdatela en un lugar seguro y secreto."
@@ -1298,7 +1298,7 @@
"message": "Lento"
},
"slower": {
- "message": "Más Lento"
+ "message": "Más lento"
},
"saveAsCsvFile": {
"message": "Guardar como archivo CSV"
@@ -1316,10 +1316,10 @@
"message": "Seg"
},
"selectLocale": {
- "message": "Seleccionar Local"
+ "message": "Seleccionar local"
},
"sendAmount": {
- "message": "Mandar Cantidad"
+ "message": "Mandar cantidad"
},
"sentEther": {
"message": "se mandó ether"
@@ -1361,7 +1361,7 @@
"message": "Petición de Firma"
},
"somethingWentWrong": {
- "message": "¡Ups! Algo se estropeó."
+ "message": "¡Ups! Algo funcionó mal."
},
"speedUp": {
"message": "Agilizar"
@@ -1382,13 +1382,13 @@
"message": "Cambiar de Red"
},
"step1HardwareWallet": {
- "message": "1. Conectar Monedero Físico."
+ "message": "1. Conectar monedero físico."
},
"step1HardwareWalletMsg": {
"message": "Conéctate el monedero físico directamente al ordenador."
},
"step2HardwareWallet": {
- "message": "2. Seleccionar una Cuenta"
+ "message": "2. Seleccionar una cuenta"
},
"step2HardwareWalletMsg": {
"message": "Seleccione la cuenta que quieres ver. Sólo se puede eligir una a la vez."
@@ -1454,10 +1454,10 @@
"message": "Traspasar"
},
"transferFrom": {
- "message": "Traspasar De"
+ "message": "Traspasar de"
},
"trezorHardwareWallet": {
- "message": "Monedero Físico TREZOR"
+ "message": "Monedero físico TREZOR"
},
"tryAgain": {
"message": "Vuelve a intentar"
diff --git a/app/manifest.json b/app/manifest.json
index 6dbd8ad09..3098d0f82 100644
--- a/app/manifest.json
+++ b/app/manifest.json
@@ -1,7 +1,7 @@
{
"name": "__MSG_appName__",
"short_name": "__MSG_appName__",
- "version": "6.2.0",
+ "version": "6.2.1",
"manifest_version": 2,
"author": "https://metamask.io",
"description": "__MSG_appDescription__",
diff --git a/development/sourcemap-validator.js b/development/sourcemap-validator.js
index 143888128..546745f16 100644
--- a/development/sourcemap-validator.js
+++ b/development/sourcemap-validator.js
@@ -1,6 +1,9 @@
const fs = require('fs')
const { SourceMapConsumer } = require('source-map')
const path = require('path')
+const pify = require('pify')
+const fsAsync = pify(fs)
+
//
// Utility to help check if sourcemaps are working
//
@@ -9,39 +12,85 @@ const path = require('path')
// if not working it may error or print minified garbage
//
-start()
+start().catch(console.error)
async function start () {
- const rawBuild = fs.readFileSync(path.join(__dirname, '/../dist/chrome/', 'inpage.js')
- , 'utf8')
- const rawSourceMap = fs.readFileSync(path.join(__dirname, '/../dist/sourcemaps/', 'inpage.js.map'), 'utf8')
+ const targetFiles = [`inpage.js`, `contentscript.js`, `ui.js`, `background.js`]
+ for (const buildName of targetFiles) {
+ await validateSourcemapForFile({ buildName })
+ }
+}
+
+async function validateSourcemapForFile ({ buildName }) {
+ console.log(`build "${buildName}"`)
+ const platform = `chrome`
+ // load build and sourcemaps
+ let rawBuild
+ try {
+ const filePath = path.join(__dirname, `/../dist/${platform}/`, `${buildName}`)
+ rawBuild = await fsAsync.readFile(filePath, 'utf8')
+ } catch (err) {}
+ if (!rawBuild) {
+ throw new Error(`SourcemapValidator - failed to load source file for "${buildName}"`)
+ }
+ // attempt to load in dist mode
+ let rawSourceMap
+ try {
+ const filePath = path.join(__dirname, `/../dist/sourcemaps/`, `${buildName}.map`)
+ rawSourceMap = await fsAsync.readFile(filePath, 'utf8')
+ } catch (err) {}
+ // attempt to load in dev mode
+ try {
+ const filePath = path.join(__dirname, `/../dist/${platform}/`, `${buildName}.map`)
+ rawSourceMap = await fsAsync.readFile(filePath, 'utf8')
+ } catch (err) {}
+ if (!rawSourceMap) {
+ throw new Error(`SourcemapValidator - failed to load sourcemaps for "${buildName}"`)
+ }
+
const consumer = await new SourceMapConsumer(rawSourceMap)
- console.log('hasContentsOfAllSources:', consumer.hasContentsOfAllSources(), '\n')
- console.log('sources:')
- consumer.sources.map((sourcePath) => console.log(sourcePath))
-
- console.log('\nexamining "new Error" statements:\n')
- const sourceLines = rawBuild.split('\n')
- sourceLines.map(line => indicesOf('new Error', line))
- .forEach((errorIndices, lineIndex) => {
- // if (errorIndex === null) return console.log('line does not contain "new Error"')
- errorIndices.forEach((errorIndex) => {
- const position = { line: lineIndex + 1, column: errorIndex }
+ const hasContentsOfAllSources = consumer.hasContentsOfAllSources()
+ if (!hasContentsOfAllSources) console.warn('SourcemapValidator - missing content of some sources...')
+
+ console.log(` sampling from ${consumer.sources.length} files`)
+ let sampleCount = 0
+
+ const buildLines = rawBuild.split('\n')
+ const targetString = 'new Error'
+ // const targetString = 'null'
+ const matchesPerLine = buildLines.map(line => indicesOf(targetString, line))
+ matchesPerLine.forEach((matchIndices, lineIndex) => {
+ matchIndices.forEach((matchColumn) => {
+ sampleCount++
+ const position = { line: lineIndex + 1, column: matchColumn }
const result = consumer.originalPositionFor(position)
- if (!result.source) return console.warn(`!! missing source for position: ${position}`)
- // filter out deps distributed minified without sourcemaps
- if (result.source === 'node_modules/browserify/node_modules/browser-pack/_prelude.js') return // minified mess
- if (result.source === 'node_modules/web3/dist/web3.min.js') return // minified mess
+ // warn if source content is missing
+ if (!result.source) {
+ console.warn(`!! missing source for position: ${JSON.stringify(position)}`)
+ // const buildLine = buildLines[position.line - 1]
+ console.warn(` origin in build:`)
+ console.warn(` ${buildLines[position.line - 2]}`)
+ console.warn(`-> ${buildLines[position.line - 1]}`)
+ console.warn(` ${buildLines[position.line - 0]}`)
+ return
+ }
const sourceContent = consumer.sourceContentFor(result.source)
const sourceLines = sourceContent.split('\n')
const line = sourceLines[result.line - 1]
- console.log(`\n========================== ${result.source} ====================================\n`)
- console.log(line)
- console.log(`\n==============================================================================\n`)
+ // this sometimes includes the whole line though we tried to match somewhere in the middle
+ const portion = line.slice(result.column)
+ const isMaybeValid = portion.includes(targetString)
+ if (!isMaybeValid) {
+ console.error('Sourcemap seems invalid:')
+ console.log(`\n========================== ${result.source} ====================================\n`)
+ console.log(line)
+ console.log(`\n==============================================================================\n`)
+ }
})
})
+ console.log(` checked ${sampleCount} samples`)
}
function indicesOf (substring, string) {
diff --git a/ui/app/util.js b/ui/app/util.js
index e27956a45..3237e5feb 100644
--- a/ui/app/util.js
+++ b/ui/app/util.js
@@ -95,7 +95,6 @@ function miniAddressSummary (address) {
function isValidAddress (address, network) {
var prefixed = ethUtil.addHexPrefix(address)
if (address === '0x0000000000000000000000000000000000000000') return false
- if (!isEthNetwork(network)) return (ethUtil.isValidAddress(prefixed) && address === address.toLowerCase())
return (isAllOneCase(prefixed) && ethUtil.isValidAddress(prefixed)) || ethUtil.isValidChecksumAddress(prefixed)
}
@@ -315,7 +314,7 @@ function getTokenAddressFromTokenObject (token) {
*/
function checksumAddress (address, network) {
const checksummed = address ? ethUtil.toChecksumAddress(address) : ''
- return checksummed && network && !isEthNetwork(network) ? checksummed.toLowerCase() : checksummed
+ return checksummed
}
function addressSlicer (address = '') {