diff options
author | frankiebee <frankie.diamond@gmail.com> | 2017-07-12 03:18:44 +0800 |
---|---|---|
committer | frankiebee <frankie.diamond@gmail.com> | 2017-07-12 03:18:44 +0800 |
commit | a670e54973ed1bae20455507a4b3c44e231ba822 (patch) | |
tree | 00300ea3362b7b48be26d6547f89ed4c5bfac597 /app/scripts/metamask-controller.js | |
parent | c121ac21ec3bed0381e36de7ead1b583a3da148c (diff) | |
parent | f5de16c91174fbbf208e5aef8f542d3bbbb3cb93 (diff) | |
download | tangerine-wallet-browser-a670e54973ed1bae20455507a4b3c44e231ba822.tar tangerine-wallet-browser-a670e54973ed1bae20455507a4b3c44e231ba822.tar.gz tangerine-wallet-browser-a670e54973ed1bae20455507a4b3c44e231ba822.tar.bz2 tangerine-wallet-browser-a670e54973ed1bae20455507a4b3c44e231ba822.tar.lz tangerine-wallet-browser-a670e54973ed1bae20455507a4b3c44e231ba822.tar.xz tangerine-wallet-browser-a670e54973ed1bae20455507a4b3c44e231ba822.tar.zst tangerine-wallet-browser-a670e54973ed1bae20455507a4b3c44e231ba822.zip |
Merge branch 'nonce-tracker' of https://github.com/MetaMask/metamask-plugin into nonce-tracker
Diffstat (limited to 'app/scripts/metamask-controller.js')
-rw-r--r-- | app/scripts/metamask-controller.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index be64a45c7..573594b39 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -184,7 +184,9 @@ module.exports = class MetamaskController extends EventEmitter { eth_syncing: false, web3_clientVersion: `MetaMask/v${version}`, }, + // rpc data source rpcUrl: this.networkController.getCurrentRpcAddress(), + originHttpHeaderKey: 'X-Metamask-Origin', // account mgmt getAccounts: (cb) => { const isUnlocked = this.keyringController.memStore.getState().isUnlocked @@ -293,6 +295,7 @@ module.exports = class MetamaskController extends EventEmitter { // PreferencesController setSelectedAddress: nodeify(preferencesController.setSelectedAddress).bind(preferencesController), + addToken: nodeify(preferencesController.addToken).bind(preferencesController), setCurrentAccountTab: nodeify(preferencesController.setCurrentAccountTab).bind(preferencesController), setDefaultRpc: nodeify(this.setDefaultRpc).bind(this), setCustomRpc: nodeify(this.setCustomRpc).bind(this), @@ -355,8 +358,13 @@ module.exports = class MetamaskController extends EventEmitter { } setupProviderConnection (outStream, originDomain) { - streamIntoProvider(outStream, this.provider, logger) - function logger (err, request, response) { + streamIntoProvider(outStream, this.provider, onRequest, onResponse) + // append dapp origin domain to request + function onRequest (request) { + request.origin = originDomain + } + // log rpc activity + function onResponse (err, request, response) { if (err) return console.error(err) if (response.error) { console.error('Error in RPC response:\n', response.error) |