From 6587dfecc0a3919f727ce900e3e21014196462fb Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Fri, 15 Dec 2017 12:48:51 +0100 Subject: [PATCH] Wallet subscriptions & refresh (#7283) * Update to @parity/api 2.1.7 * Update packages * Update after signer API alias --- js-old/package-lock.json | 32 +++----------------------------- js-old/package.json | 4 ++-- js-old/src/index.ejs | 1 - js/package-lock.json | 18 +++++++++--------- js/package.json | 4 ++-- js/src/DappRequests/store.js | 11 +++-------- 6 files changed, 19 insertions(+), 51 deletions(-) diff --git a/js-old/package-lock.json b/js-old/package-lock.json index b453fc465..ae13792fb 100644 --- a/js-old/package-lock.json +++ b/js-old/package-lock.json @@ -15,9 +15,9 @@ } }, "@parity/api": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@parity/api/-/api-2.1.5.tgz", - "integrity": "sha512-HkvMIhIwDMEIyTmXqEjWn1C2qes0qJO270bQldRfCZf0XiOGXG726EzV3FUpUbVONCVQ9riDviAl3fw6D+N6nA==", + "version": "2.1.14", + "resolved": "https://registry.npmjs.org/@parity/api/-/api-2.1.14.tgz", + "integrity": "sha512-1IiaXJCXkhNUNeWiMcLKrdXcPnLjdH58zIc8zk4IgwFvJ3ZNriV1W6lGHghHB9GbNcHgpZdpYt4NUvu67oWZ9w==", "requires": { "@parity/abi": "2.1.2", "@parity/jsonrpc": "2.1.4", @@ -3416,11 +3416,6 @@ "randomfill": "1.0.3" } }, - "crypto-js": { - "version": "3.1.8", - "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-3.1.8.tgz", - "integrity": "sha1-cV8HC/YBTyrpkqmLOSkli3E/CNU=" - }, "css-color-names": { "version": "0.0.4", "resolved": "https://registry.npmjs.org/css-color-names/-/css-color-names-0.0.4.tgz", @@ -13475,22 +13470,6 @@ } } }, - "web3": { - "version": "0.17.0-beta", - "resolved": "https://registry.npmjs.org/web3/-/web3-0.17.0-beta.tgz", - "integrity": "sha1-V684JFv/ejIJn3zleA+tW7wA2ls=", - "requires": { - "bignumber.js": "git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2", - "crypto-js": "3.1.8", - "utf8": "2.1.2", - "xmlhttprequest": "1.8.0" - }, - "dependencies": { - "bignumber.js": { - "version": "git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2" - } - } - }, "webidl-conversions": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", @@ -13794,11 +13773,6 @@ "integrity": "sha1-TYuPHszTQZqjYgYb7O9RXh5VljU=", "dev": true }, - "xmlhttprequest": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz", - "integrity": "sha1-Z/4HXFwk/vOfnWX197f+dRcZaPw=" - }, "xss-filters": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/xss-filters/-/xss-filters-1.2.7.tgz", diff --git a/js-old/package.json b/js-old/package.json index 6596e7dd3..4dd928a82 100644 --- a/js-old/package.json +++ b/js-old/package.json @@ -31,7 +31,7 @@ "build:app": "webpack --config webpack/app", "build:dll": "webpack --config webpack/vendor", "ci:build": "cross-env NODE_ENV=production npm run build", - "clean": "rimraf ./.build ./.coverage ./.happypack ./.npmjs ./build ./node_modules/.cache", + "clean": "rimraf ./.build ./.coverage ./.happypack ./.npmjs ./node_modules/.cache", "lint": "npm run lint:css && npm run lint:js", "lint:css": "stylelint ./src/**/*.css", "lint:js": "eslint --ignore-path .gitignore ./src/", @@ -133,7 +133,7 @@ }, "dependencies": { "@parity/abi": "2.1.x", - "@parity/api": "2.1.x", + "@parity/api": "^2.1.14", "@parity/wordlist": "1.1.x", "base32.js": "0.1.0", "bignumber.js": "3.0.1", diff --git a/js-old/src/index.ejs b/js-old/src/index.ejs index b1a23576e..305568f5b 100644 --- a/js-old/src/index.ejs +++ b/js-old/src/index.ejs @@ -33,7 +33,6 @@
Loading
- diff --git a/js/package-lock.json b/js/package-lock.json index 63a6cc03d..d73d5943c 100644 --- a/js/package-lock.json +++ b/js/package-lock.json @@ -15,9 +15,9 @@ } }, "@parity/api": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/@parity/api/-/api-2.1.6.tgz", - "integrity": "sha512-4HuUJLGkZEAHSy5918ofepKXWvAE89VsoUN7q1Px9ASN8xLR3MWPMuNxOJZjKTqVDZWpXs8q3g7GIOVdi90BXA==", + "version": "2.1.14", + "resolved": "https://registry.npmjs.org/@parity/api/-/api-2.1.14.tgz", + "integrity": "sha512-1IiaXJCXkhNUNeWiMcLKrdXcPnLjdH58zIc8zk4IgwFvJ3ZNriV1W6lGHghHB9GbNcHgpZdpYt4NUvu67oWZ9w==", "requires": { "@parity/abi": "2.1.2", "@parity/jsonrpc": "2.1.4", @@ -52,7 +52,7 @@ "version": "github:js-dist-paritytech/dapp-dapp-methods#7245089a8e83274372cde3c9406ae155e2083f84", "dev": true, "requires": { - "@parity/api": "2.1.6", + "@parity/api": "2.1.14", "@parity/shared": "2.2.14", "@parity/ui": "2.2.15", "lodash": "4.17.4", @@ -74,7 +74,7 @@ "integrity": "sha512-6bICFA1c1GBz4d7vratkoqovBezJNjc8VCwnZtpPTcyLeMshAhatPV4dGgJo/eHtlOCkKAeaAKatWZhEtXt/5g==", "dev": true, "requires": { - "@parity/api": "2.1.6", + "@parity/api": "2.1.14", "@parity/etherscan": "2.1.3", "@parity/shared": "2.2.14", "bignumber.js": "3.0.1", @@ -556,7 +556,7 @@ "version": "github:js-dist-paritytech/dapp-dapp-visible#84f40feb42f1707d7f463213a990600dc11978f7", "dev": true, "requires": { - "@parity/api": "2.1.6", + "@parity/api": "2.1.14", "@parity/ui": "2.2.15", "mobx": "3.3.2", "mobx-react": "4.3.5", @@ -576,7 +576,7 @@ "integrity": "sha512-6bICFA1c1GBz4d7vratkoqovBezJNjc8VCwnZtpPTcyLeMshAhatPV4dGgJo/eHtlOCkKAeaAKatWZhEtXt/5g==", "dev": true, "requires": { - "@parity/api": "2.1.6", + "@parity/api": "2.1.14", "@parity/etherscan": "2.1.3", "@parity/shared": "2.2.14", "bignumber.js": "3.0.1", @@ -1103,7 +1103,7 @@ "resolved": "https://registry.npmjs.org/@parity/etherscan/-/etherscan-2.1.3.tgz", "integrity": "sha512-GtQMaE8t7PDOcz/K4Ud+Z6EELB47+qG5V6R7iTJ4DcueXVgiMAXK5OiNeKF3Qjd1/M4FIJdFm5NTSdC7bR38+Q==", "requires": { - "@parity/api": "2.1.6", + "@parity/api": "2.1.14", "bignumber.js": "3.0.1", "es6-promise": "4.1.1", "node-fetch": "1.7.3", @@ -1202,7 +1202,7 @@ "resolved": "https://registry.npmjs.org/@parity/ui/-/ui-3.0.16.tgz", "integrity": "sha512-yGQ8k2/oNxu0GyJ6eQS1AUk1O1XR//oXfaHPEBa0VuJIB7gY9lPrkG7CSNpazOrTCfhdCHgpjGe3WR5lbv0HiQ==", "requires": { - "@parity/api": "2.1.6", + "@parity/api": "2.1.14", "@parity/etherscan": "2.1.3", "@parity/shared": "2.2.14", "babel-runtime": "6.26.0", diff --git a/js/package.json b/js/package.json index d4df1963d..f980a3ba9 100644 --- a/js/package.json +++ b/js/package.json @@ -27,7 +27,7 @@ "build:embed": "cross-env EMBED=1 node webpack/embed", "build:i18n": "npm run clean && npm run build && babel-node ./scripts/build-i18n.js", "ci:build": "cross-env NODE_ENV=production npm run build", - "clean": "rimraf ./.build ./.coverage ./.happypack ./build", + "clean": "rimraf ./.build ./.coverage ./.happypack", "coveralls": "npm run testCoverage && coveralls < coverage/lcov.info", "lint": "npm run lint:css && npm run lint:js", "lint:cached": "npm run lint:css && npm run lint:js:cached", @@ -140,7 +140,7 @@ "yargs": "6.6.0" }, "dependencies": { - "@parity/api": "^2.1.6", + "@parity/api": "^2.1.14", "@parity/plugin-signer-account": "paritytech/plugin-signer-account", "@parity/plugin-signer-default": "paritytech/plugin-signer-default", "@parity/plugin-signer-hardware": "paritytech/plugin-signer-hardware", diff --git a/js/src/DappRequests/store.js b/js/src/DappRequests/store.js index cba140cd3..ee9905288 100644 --- a/js/src/DappRequests/store.js +++ b/js/src/DappRequests/store.js @@ -242,14 +242,9 @@ export default class Store { return; } - if ( - (method && - methodGroupFromMethod[method] && - !this.hasTokenPermission(method, token)) || - (api && - methodGroupFromMethod[params[0]] && - !this.hasTokenPermission(method, token)) - ) { + const _method = api ? params[0] : method; + + if (methodGroupFromMethod[_method] && !this.hasTokenPermission(_method, token)) { this.queueRequest(id, { // The requestId of a request is the id inside data data, source