mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Merge branch 'master' of https://github.com/MetaMask/metamask-extension into cb-254
This commit is contained in:
commit
51ad2b03c8
@ -161,9 +161,11 @@ module.exports = class TransactionController extends EventEmitter {
|
|||||||
this.emit(`${txMeta.id}:unapproved`, txMeta)
|
this.emit(`${txMeta.id}:unapproved`, txMeta)
|
||||||
}
|
}
|
||||||
|
|
||||||
async newUnapprovedTransaction (txParams) {
|
async newUnapprovedTransaction (txParams, opts = {}) {
|
||||||
log.debug(`MetaMaskController newUnapprovedTransaction ${JSON.stringify(txParams)}`)
|
log.debug(`MetaMaskController newUnapprovedTransaction ${JSON.stringify(txParams)}`)
|
||||||
const initialTxMeta = await this.addUnapprovedTransaction(txParams)
|
const initialTxMeta = await this.addUnapprovedTransaction(txParams)
|
||||||
|
initialTxMeta.origin = opts.origin
|
||||||
|
this.txStateManager.updateTx(initialTxMeta, '#newUnapprovedTransaction - adding the origin')
|
||||||
// listen for tx completion (success, fail)
|
// listen for tx completion (success, fail)
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
this.txStateManager.once(`${initialTxMeta.id}:finished`, (finishedTxMeta) => {
|
this.txStateManager.once(`${initialTxMeta.id}:finished`, (finishedTxMeta) => {
|
||||||
|
@ -57,7 +57,6 @@ module.exports = class MetamaskController extends EventEmitter {
|
|||||||
this.defaultMaxListeners = 20
|
this.defaultMaxListeners = 20
|
||||||
|
|
||||||
this.sendUpdate = debounce(this.privateSendUpdate.bind(this), 200)
|
this.sendUpdate = debounce(this.privateSendUpdate.bind(this), 200)
|
||||||
|
|
||||||
this.opts = opts
|
this.opts = opts
|
||||||
const initState = opts.initState || {}
|
const initState = opts.initState || {}
|
||||||
this.recordFirstTimeInfo(initState)
|
this.recordFirstTimeInfo(initState)
|
||||||
@ -242,6 +241,11 @@ module.exports = class MetamaskController extends EventEmitter {
|
|||||||
static: {
|
static: {
|
||||||
eth_syncing: false,
|
eth_syncing: false,
|
||||||
web3_clientVersion: `MetaMask/v${version}`,
|
web3_clientVersion: `MetaMask/v${version}`,
|
||||||
|
eth_sendTransaction: (payload, next, end) => {
|
||||||
|
const origin = payload.origin
|
||||||
|
const txParams = payload.params[0]
|
||||||
|
nodeify(this.txController.newUnapprovedTransaction, this.txController)(txParams, { origin }, end)
|
||||||
|
},
|
||||||
},
|
},
|
||||||
// account mgmt
|
// account mgmt
|
||||||
getAccounts: (cb) => {
|
getAccounts: (cb) => {
|
||||||
@ -256,7 +260,6 @@ module.exports = class MetamaskController extends EventEmitter {
|
|||||||
cb(null, result)
|
cb(null, result)
|
||||||
},
|
},
|
||||||
// tx signing
|
// tx signing
|
||||||
processTransaction: nodeify(async (txParams) => await this.txController.newUnapprovedTransaction(txParams), this),
|
|
||||||
// old style msg signing
|
// old style msg signing
|
||||||
processMessage: this.newUnsignedMessage.bind(this),
|
processMessage: this.newUnsignedMessage.bind(this),
|
||||||
// personal_sign msg signing
|
// personal_sign msg signing
|
||||||
|
11
gulpfile.js
11
gulpfile.js
@ -16,7 +16,6 @@ const eslint = require('gulp-eslint')
|
|||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
const manifest = require('./app/manifest.json')
|
const manifest = require('./app/manifest.json')
|
||||||
const gulpif = require('gulp-if')
|
|
||||||
const replace = require('gulp-replace')
|
const replace = require('gulp-replace')
|
||||||
const mkdirp = require('mkdirp')
|
const mkdirp = require('mkdirp')
|
||||||
const asyncEach = require('async/each')
|
const asyncEach = require('async/each')
|
||||||
@ -31,8 +30,6 @@ const debug = require('gulp-debug')
|
|||||||
const pify = require('pify')
|
const pify = require('pify')
|
||||||
const endOfStream = pify(require('end-of-stream'))
|
const endOfStream = pify(require('end-of-stream'))
|
||||||
|
|
||||||
const disableDebugTools = gutil.env.disableDebugTools
|
|
||||||
const debugMode = gutil.env.debug
|
|
||||||
|
|
||||||
const browserPlatforms = [
|
const browserPlatforms = [
|
||||||
'firefox',
|
'firefox',
|
||||||
@ -181,12 +178,12 @@ gulp.task('manifest:production', function() {
|
|||||||
],{base: './dist/'})
|
],{base: './dist/'})
|
||||||
|
|
||||||
// Exclude chromereload script in production:
|
// Exclude chromereload script in production:
|
||||||
.pipe(gulpif(!debugMode,jsoneditor(function(json) {
|
.pipe(jsoneditor(function(json) {
|
||||||
json.background.scripts = json.background.scripts.filter((script) => {
|
json.background.scripts = json.background.scripts.filter((script) => {
|
||||||
return !script.includes('chromereload')
|
return !script.includes('chromereload')
|
||||||
})
|
})
|
||||||
return json
|
return json
|
||||||
})))
|
}))
|
||||||
|
|
||||||
.pipe(gulp.dest('./dist/', { overwrite: true }))
|
.pipe(gulp.dest('./dist/', { overwrite: true }))
|
||||||
})
|
})
|
||||||
@ -311,6 +308,7 @@ function createTasksForBuildJsExtension({ buildJsFiles, taskPrefix, devMode, bun
|
|||||||
minifyBuild: !devMode,
|
minifyBuild: !devMode,
|
||||||
buildWithFullPaths: devMode,
|
buildWithFullPaths: devMode,
|
||||||
watch: devMode,
|
watch: devMode,
|
||||||
|
devMode,
|
||||||
}, bundleTaskOpts)
|
}, bundleTaskOpts)
|
||||||
createTasksForBuildJs({ rootDir, taskPrefix, bundleTaskOpts, destinations, buildPhase1, buildPhase2 })
|
createTasksForBuildJs({ rootDir, taskPrefix, bundleTaskOpts, destinations, buildPhase1, buildPhase2 })
|
||||||
}
|
}
|
||||||
@ -326,6 +324,7 @@ function createTasksForBuildJsMascara({ taskPrefix, devMode, bundleTaskOpts = {}
|
|||||||
minifyBuild: !devMode,
|
minifyBuild: !devMode,
|
||||||
buildWithFullPaths: devMode,
|
buildWithFullPaths: devMode,
|
||||||
watch: devMode,
|
watch: devMode,
|
||||||
|
devMode,
|
||||||
}, bundleTaskOpts)
|
}, bundleTaskOpts)
|
||||||
createTasksForBuildJs({ rootDir, taskPrefix, bundleTaskOpts, destinations, buildPhase1 })
|
createTasksForBuildJs({ rootDir, taskPrefix, bundleTaskOpts, destinations, buildPhase1 })
|
||||||
}
|
}
|
||||||
@ -541,7 +540,7 @@ function bundleTask(opts) {
|
|||||||
// convert bundle stream to gulp vinyl stream
|
// convert bundle stream to gulp vinyl stream
|
||||||
.pipe(source(opts.filename))
|
.pipe(source(opts.filename))
|
||||||
// inject variables into bundle
|
// inject variables into bundle
|
||||||
.pipe(replace('\'GULP_METAMASK_DEBUG\'', debugMode))
|
.pipe(replace('\'GULP_METAMASK_DEBUG\'', opts.devMode))
|
||||||
// buffer file contents (?)
|
// buffer file contents (?)
|
||||||
.pipe(buffer())
|
.pipe(buffer())
|
||||||
|
|
||||||
|
24
package-lock.json
generated
24
package-lock.json
generated
@ -5747,7 +5747,7 @@
|
|||||||
"ethereumjs-vm": "2.3.2",
|
"ethereumjs-vm": "2.3.2",
|
||||||
"through2": "2.0.3",
|
"through2": "2.0.3",
|
||||||
"treeify": "1.1.0",
|
"treeify": "1.1.0",
|
||||||
"web3-provider-engine": "13.6.0"
|
"web3-provider-engine": "13.8.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ethereum-common": {
|
"ethereum-common": {
|
||||||
@ -19306,9 +19306,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"solc": {
|
"solc": {
|
||||||
"version": "0.4.20",
|
"version": "0.4.21",
|
||||||
"resolved": "https://registry.npmjs.org/solc/-/solc-0.4.20.tgz",
|
"resolved": "https://registry.npmjs.org/solc/-/solc-0.4.21.tgz",
|
||||||
"integrity": "sha512-LrP3Jp4FS3y8sduIR67y8Ss1riR3fggk5sMnx4OSCcU88Ro0e51+KVXyfH3NP6ghLo7COrLx/lGUaDDugCzdgA==",
|
"integrity": "sha512-8lJmimVjOG9AJOQRWS2ph4rSctPMsPGZ4H360HLs5iI+euUlt7iAvUxSLeFZZzwk0kas4Qta7HmlMXNU3yYwhw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"fs-extra": "0.30.0",
|
"fs-extra": "0.30.0",
|
||||||
"memorystream": "0.3.1",
|
"memorystream": "0.3.1",
|
||||||
@ -22309,9 +22309,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"web3-provider-engine": {
|
"web3-provider-engine": {
|
||||||
"version": "13.6.0",
|
"version": "13.8.0",
|
||||||
"resolved": "https://registry.npmjs.org/web3-provider-engine/-/web3-provider-engine-13.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/web3-provider-engine/-/web3-provider-engine-13.8.0.tgz",
|
||||||
"integrity": "sha512-iCsAlAeLWHxgx6EXuBm5GNg5VBqKtzmnrhEOfJBv8Cetukush7yOvo4RPjDZIynKxg9jfAlMmWqCk6wLxA6coQ==",
|
"integrity": "sha512-fZXhX5VWwWpoFfrfocslyg6P7cN3YWPG/ASaevNfeO80R+nzgoPUBXcWQekSGSsNDkeRTis4aMmpmofYf1TNtQ==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"async": "2.6.0",
|
"async": "2.6.0",
|
||||||
"clone": "2.1.1",
|
"clone": "2.1.1",
|
||||||
@ -22319,7 +22319,7 @@
|
|||||||
"eth-sig-util": "1.4.2",
|
"eth-sig-util": "1.4.2",
|
||||||
"ethereumjs-block": "1.7.0",
|
"ethereumjs-block": "1.7.0",
|
||||||
"ethereumjs-tx": "1.3.3",
|
"ethereumjs-tx": "1.3.3",
|
||||||
"ethereumjs-util": "5.1.4",
|
"ethereumjs-util": "5.1.5",
|
||||||
"ethereumjs-vm": "2.3.2",
|
"ethereumjs-vm": "2.3.2",
|
||||||
"fetch-ponyfill": "4.1.0",
|
"fetch-ponyfill": "4.1.0",
|
||||||
"json-rpc-error": "2.0.0",
|
"json-rpc-error": "2.0.0",
|
||||||
@ -22328,16 +22328,16 @@
|
|||||||
"readable-stream": "2.3.3",
|
"readable-stream": "2.3.3",
|
||||||
"request": "2.83.0",
|
"request": "2.83.0",
|
||||||
"semaphore": "1.1.0",
|
"semaphore": "1.1.0",
|
||||||
"solc": "0.4.20",
|
"solc": "0.4.21",
|
||||||
"tape": "4.8.0",
|
"tape": "4.8.0",
|
||||||
"xhr": "2.4.1",
|
"xhr": "2.4.1",
|
||||||
"xtend": "4.0.1"
|
"xtend": "4.0.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ethereumjs-util": {
|
"ethereumjs-util": {
|
||||||
"version": "5.1.4",
|
"version": "5.1.5",
|
||||||
"resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.1.4.tgz",
|
"resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.1.5.tgz",
|
||||||
"integrity": "sha512-wbeTc5prEzIWFSQUcEsCAZbqubtJKy6yS+oZMY1cGG6GLYzLjm4YhC2RNrWIg8hRYnclWpnZmx2zkiufQkmd3w==",
|
"integrity": "sha512-xPaSEATYJpMTCGowIt0oMZwFP4R1bxd6QsWgkcDvFL0JtXsr39p32WEcD14RscCjfP41YXZPCVWA4yAg0nrJmw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"bn.js": "4.11.8",
|
"bn.js": "4.11.8",
|
||||||
"create-hash": "1.1.3",
|
"create-hash": "1.1.3",
|
||||||
|
@ -187,7 +187,7 @@
|
|||||||
"valid-url": "^1.0.9",
|
"valid-url": "^1.0.9",
|
||||||
"vreme": "^3.0.2",
|
"vreme": "^3.0.2",
|
||||||
"web3": "^0.20.1",
|
"web3": "^0.20.1",
|
||||||
"web3-provider-engine": "^13.5.6",
|
"web3-provider-engine": "^13.8.0",
|
||||||
"web3-stream-provider": "^3.0.1",
|
"web3-stream-provider": "^3.0.1",
|
||||||
"xtend": "^4.0.1"
|
"xtend": "^4.0.1"
|
||||||
},
|
},
|
||||||
@ -223,7 +223,6 @@
|
|||||||
"gulp": "github:gulpjs/gulp#6d71a658c61edb3090221579d8f97dbe086ba2ed",
|
"gulp": "github:gulpjs/gulp#6d71a658c61edb3090221579d8f97dbe086ba2ed",
|
||||||
"gulp-babel": "^7.0.0",
|
"gulp-babel": "^7.0.0",
|
||||||
"gulp-eslint": "^4.0.0",
|
"gulp-eslint": "^4.0.0",
|
||||||
"gulp-if": "^2.0.2",
|
|
||||||
"gulp-json-editor": "^2.2.1",
|
"gulp-json-editor": "^2.2.1",
|
||||||
"gulp-livereload": "^3.8.1",
|
"gulp-livereload": "^3.8.1",
|
||||||
"gulp-replace": "^0.6.1",
|
"gulp-replace": "^0.6.1",
|
||||||
|
Loading…
Reference in New Issue
Block a user