Skip to content

Commit a3bc7f6

Browse files
authored
Privacy fix (#540)
* handle eth_accounts from backgroundbridge * Revert "install correct contract metadata (#532)" This reverts commit 16b180d. * update contract metadata
1 parent 7105180 commit a3bc7f6

File tree

3 files changed

+17
-29
lines changed

3 files changed

+17
-29
lines changed

app/components/Views/Browser/index.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ export class Browser extends Component {
357357
goingBack = false;
358358
forwardHistoryStack = [];
359359
approvalRequest;
360+
accountsRequest;
360361

361362
clampedScrollValue = 0;
362363
offsetValue = 0;
@@ -407,6 +408,19 @@ export class Browser extends Component {
407408
}
408409
return promise;
409410
},
411+
eth_accounts: ({ id, jsonrpc, hostname }) => {
412+
const { approvedHosts, privacyMode, selectedAddress } = this.props;
413+
const isEnabled = !privacyMode || approvedHosts[hostname];
414+
const promise = new Promise((resolve, reject) => {
415+
this.accountsRequest = { resolve, reject };
416+
});
417+
if (isEnabled) {
418+
this.accountsRequest.resolve({ id, jsonrpc, result: [selectedAddress] });
419+
} else {
420+
this.accountsRequest.resolve({ id, jsonrpc, result: [] });
421+
}
422+
return promise;
423+
},
410424
web3_clientVersion: payload =>
411425
Promise.resolve({ result: 'MetaMask/0.1.0/Alpha/Mobile', jsonrpc: payload.jsonrpc, id: payload.id }),
412426
wallet_scanQRCode: payload => {

package-lock.json

Lines changed: 2 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"base-64": "0.1.0",
6060
"bignumber.js": "8.1.1",
6161
"buffer": "5.2.1",
62-
"eth-contract-metadata": "github:MetaMask/eth-contract-metadata#2d0c1f1c6f0872c09603ae7bd7b30f1d680f8bd6",
62+
"eth-contract-metadata": "github:estebanmino/eth-contract-metadata#d5e4e6377b0c0bcb5c33b9a4523aeba1f8d78d1e",
6363
"eth-ens-namehash": "2.0.8",
6464
"eth-url-parser": "1.0.2",
6565
"ethereumjs-abi": "0.6.6",

0 commit comments

Comments
 (0)