From 752ec5f4fc7172c84d2dc4fe1defe1d5f07d2f9f Mon Sep 17 00:00:00 2001 From: Axel Chalon Date: Fri, 13 Jul 2018 16:27:48 +0200 Subject: [PATCH 1/6] Fix fetchParity default object argument destructuring Previously, e.g. fetchParity(w, {parityChannel: "beta"}) would set onProgress to be undefined, rather than the default () => {} --- packages/parity-electron/src/fetchParity.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/parity-electron/src/fetchParity.ts b/packages/parity-electron/src/fetchParity.ts index 43414017..9cf57b9d 100644 --- a/packages/parity-electron/src/fetchParity.ts +++ b/packages/parity-electron/src/fetchParity.ts @@ -70,12 +70,9 @@ export const deleteParity = async () => { export const fetchParity = async ( mainWindow: BrowserWindow, { - onProgress, - parityChannel - }: { onProgress: (progress: number) => void; parityChannel: string } = { - onProgress: () => {}, - parityChannel: 'beta' - } + onProgress = () => {}, + parityChannel = 'beta' + }: { onProgress: (progress: number) => void; parityChannel: string } ) => { try { const parityPath: string = retry( -- GitLab From b3f94acb86f02a909199ffed8821a1064dae2c18 Mon Sep 17 00:00:00 2001 From: Axel Chalon Date: Mon, 16 Jul 2018 19:44:29 +0200 Subject: [PATCH 2/6] Replace references to parity-js/fether with paritytech/fether --- package.json | 8 ++++---- packages/fether-electron/package.json | 8 ++++---- packages/fether-react/package.json | 6 +++--- packages/fether-ui/package.json | 8 ++++---- packages/light-hoc/package.json | 8 ++++---- packages/parity-electron/package.json | 8 ++++---- 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/package.json b/package.json index 534ab12b..50b1ac95 100644 --- a/package.json +++ b/package.json @@ -12,10 +12,10 @@ "license": "BSD-3-Clause", "repository": { "type": "git", - "url": "git+https://github.com/parity-js/fether.git" + "url": "git+https://github.com/paritytech/fether.git" }, "bugs": { - "url": "https://github.com/parity-js/fether/issues" + "url": "https://github.com/paritytech/fether/issues" }, "keywords": [ "Ethereum", @@ -23,7 +23,7 @@ "Light Client", "Parity" ], - "homepage": "https://github.com/parity-js/fether", + "homepage": "https://github.com/paritytech/fether", "workspaces": { "packages": [ "packages/*" @@ -61,4 +61,4 @@ "npm-run-all": "^4.1.2", "semistandard": "^12.0.1" } -} +} \ No newline at end of file diff --git a/packages/fether-electron/package.json b/packages/fether-electron/package.json index ef5365c8..5b21a6c7 100644 --- a/packages/fether-electron/package.json +++ b/packages/fether-electron/package.json @@ -12,10 +12,10 @@ "license": "BSD-3-Clause", "repository": { "type": "git", - "url": "git+https://github.com/parity-js/fether.git" + "url": "git+https://github.com/paritytech/fether.git" }, "bugs": { - "url": "https://github.com/parity-js/fether/issues" + "url": "https://github.com/paritytech/fether/issues" }, "keywords": [ "Ethereum", @@ -23,7 +23,7 @@ "Light Client", "Parity" ], - "homepage": "https://github.com/parity-js/fether", + "homepage": "https://github.com/paritytech/fether", "parity": { "channel": "beta" }, @@ -55,4 +55,4 @@ "electron-webpack": "^2.1.2", "webpack": "^4.7.0" } -} +} \ No newline at end of file diff --git a/packages/fether-react/package.json b/packages/fether-react/package.json index ff0f1c19..876c544c 100644 --- a/packages/fether-react/package.json +++ b/packages/fether-react/package.json @@ -12,10 +12,10 @@ "license": "BSD-3-Clause", "repository": { "type": "git", - "url": "git+https://github.com/parity-js/fether.git" + "url": "git+https://github.com/paritytech/fether.git" }, "bugs": { - "url": "https://github.com/parity-js/fether/issues" + "url": "https://github.com/paritytech/fether/issues" }, "keywords": [ "Ethereum", @@ -66,4 +66,4 @@ "npm-run-all": "^4.1.2", "react-app-rewired": "^1.5.2" } -} +} \ No newline at end of file diff --git a/packages/fether-ui/package.json b/packages/fether-ui/package.json index 54c8a4b8..929b3cb0 100644 --- a/packages/fether-ui/package.json +++ b/packages/fether-ui/package.json @@ -12,10 +12,10 @@ "license": "BSD-3-Clause", "repository": { "type": "git", - "url": "git+https://github.com/parity-js/fether.git" + "url": "git+https://github.com/paritytech/fether.git" }, "bugs": { - "url": "https://github.com/parity-js/fether/issues" + "url": "https://github.com/paritytech/fether/issues" }, "keywords": [ "Ethereum", @@ -23,7 +23,7 @@ "Light Client", "Parity" ], - "homepage": "https://github.com/parity-js/fether", + "homepage": "https://github.com/paritytech/fether", "main": "lib/index.js", "scripts": { "prebuild": "rimraf lib", @@ -50,4 +50,4 @@ "prop-types": "^15.6.1", "react": "^16.4.0" } -} +} \ No newline at end of file diff --git a/packages/light-hoc/package.json b/packages/light-hoc/package.json index dd1024bc..e45e71ad 100644 --- a/packages/light-hoc/package.json +++ b/packages/light-hoc/package.json @@ -12,10 +12,10 @@ "license": "BSD-3-Clause", "repository": { "type": "git", - "url": "git+https://github.com/parity-js/fether.git" + "url": "git+https://github.com/paritytech/fether.git" }, "bugs": { - "url": "https://github.com/parity-js/fether/issues" + "url": "https://github.com/paritytech/fether/issues" }, "keywords": [ "Ethereum", @@ -23,7 +23,7 @@ "Light Client", "Parity" ], - "homepage": "https://github.com/parity-js/fether", + "homepage": "https://github.com/paritytech/fether", "main": "lib/index.js", "scripts": { "prebuild": "rimraf lib", @@ -42,4 +42,4 @@ "@babel/preset-stage-0": "^7.0.0-beta.49", "rimraf": "^2.6.2" } -} +} \ No newline at end of file diff --git a/packages/parity-electron/package.json b/packages/parity-electron/package.json index 1809a99a..7bde3586 100644 --- a/packages/parity-electron/package.json +++ b/packages/parity-electron/package.json @@ -12,10 +12,10 @@ "license": "BSD-3-Clause", "repository": { "type": "git", - "url": "git+https://github.com/parity-js/fether.git" + "url": "git+https://github.com/paritytech/fether.git" }, "bugs": { - "url": "https://github.com/parity-js/fether/issues" + "url": "https://github.com/paritytech/fether/issues" }, "keywords": [ "Ethereum", @@ -23,7 +23,7 @@ "Light Client", "Parity" ], - "homepage": "https://github.com/parity-js/fether", + "homepage": "https://github.com/paritytech/fether", "main": "lib/index.js", "scripts": { "prebuild": "rimraf lib", @@ -47,4 +47,4 @@ "peerDependencies": { "electron": "^2.0.3" } -} +} \ No newline at end of file -- GitLab From b2f821dd82e41e5c6aa154c248f99171485bb86f Mon Sep 17 00:00:00 2001 From: Axel Chalon Date: Tue, 17 Jul 2018 10:49:14 +0200 Subject: [PATCH 3/6] Remove unnecessary Object.keys() --- packages/parity-electron/src/runParity.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/parity-electron/src/runParity.ts b/packages/parity-electron/src/runParity.ts index 76745fb0..b7da0345 100644 --- a/packages/parity-electron/src/runParity.ts +++ b/packages/parity-electron/src/runParity.ts @@ -95,7 +95,7 @@ export const runParity = async ( } // If the exit code is not 0, then we show some error message - if (Object.keys(parityArgv()).length > 0) { + if (parityArgv().length > 0) { app.exit(1); } else { onParityError(new Error(`Exit code ${exitCode}, with signal ${signal}.`)); -- GitLab From 4af25245d440f9f478b816529cf246c901b7e846 Mon Sep 17 00:00:00 2001 From: Axel Chalon Date: Tue, 17 Jul 2018 12:02:51 +0200 Subject: [PATCH 4/6] Replace `Parity UI` with `Fether` --- .../src/main/installers/windows/installer.nsh | 8 ++++---- packages/parity-electron/src/getParityPath.ts | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/fether-electron/src/main/installers/windows/installer.nsh b/packages/fether-electron/src/main/installers/windows/installer.nsh index 1d718cd8..7877cc51 100644 --- a/packages/fether-electron/src/main/installers/windows/installer.nsh +++ b/packages/fether-electron/src/main/installers/windows/installer.nsh @@ -2,9 +2,9 @@ ; https://www.electron.build/configuration/nsis#how-do-change-the-default-installation-directory-to-custom !macro preInit SetRegView 64 - WriteRegExpandStr HKLM "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\Program Files\Parity Technologies\Parity UI" - WriteRegExpandStr HKCU "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\Program Files\Parity Technologies\Parity UI" + WriteRegExpandStr HKLM "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\Program Files\Parity Technologies\Fether" + WriteRegExpandStr HKCU "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\Program Files\Parity Technologies\Fether" SetRegView 32 - WriteRegExpandStr HKLM "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\Program Files\Parity Technologies\Parity UI" - WriteRegExpandStr HKCU "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\Program Files\Parity Technologies\Parity UI" + WriteRegExpandStr HKLM "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\Program Files\Parity Technologies\Fether" + WriteRegExpandStr HKCU "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\Program Files\Parity Technologies\Fether" !macroend diff --git a/packages/parity-electron/src/getParityPath.ts b/packages/parity-electron/src/getParityPath.ts index 851d436a..6a21e227 100644 --- a/packages/parity-electron/src/getParityPath.ts +++ b/packages/parity-electron/src/getParityPath.ts @@ -75,7 +75,7 @@ const isParityInUserData = async () => { * This function checks if parity has been installed on the local machine: * - first check if the program is in $PATH, using `command-exists` * - then check the OS default installation dir if a parity folder exists - * - finally check parity-ui's own userData folder + * - finally check fether's own userData folder * This function should run in node env. * * @ignore -- GitLab From 5f6c368c48296895d3c148d3fddd4ae3473272f7 Mon Sep 17 00:00:00 2001 From: Axel Chalon Date: Tue, 17 Jul 2018 12:23:54 +0200 Subject: [PATCH 5/6] Change custom websockets default port --- packages/parity-electron/src/isParityRunning.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/parity-electron/src/isParityRunning.ts b/packages/parity-electron/src/isParityRunning.ts index 73d40c35..c2f86743 100644 --- a/packages/parity-electron/src/isParityRunning.ts +++ b/packages/parity-electron/src/isParityRunning.ts @@ -16,7 +16,7 @@ const hostsToPing = ['http://127.0.0.1:8545', 'http://127.0.0.1:8546']; if (cli.wsInterface || cli.wsPort) { // Also try custom host/port if a --ws-interface or --ws-port flag is passed hostsToPing.push( - `http://${cli.wsInterface || '127.0.0.1'}:${cli.wsPort || '8545'}` + `http://${cli.wsInterface || '127.0.0.1'}:${cli.wsPort || '8546'}` ); } -- GitLab From 3df34cf3095451bb751d8c031618c15d67ba1e94 Mon Sep 17 00:00:00 2001 From: Axel Chalon Date: Tue, 17 Jul 2018 17:50:18 +0200 Subject: [PATCH 6/6] Simplify onParityError --- packages/parity-electron/src/runParity.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/packages/parity-electron/src/runParity.ts b/packages/parity-electron/src/runParity.ts index b7da0345..159bc1ce 100644 --- a/packages/parity-electron/src/runParity.ts +++ b/packages/parity-electron/src/runParity.ts @@ -3,7 +3,6 @@ // // SPDX-License-Identifier: BSD-3-Clause -import { app } from 'electron'; import { chmod } from 'fs'; import { spawn } from 'child_process'; import { promisify } from 'util'; @@ -94,12 +93,8 @@ export const runParity = async ( return; } - // If the exit code is not 0, then we show some error message - if (parityArgv().length > 0) { - app.exit(1); - } else { - onParityError(new Error(`Exit code ${exitCode}, with signal ${signal}.`)); - } + // Otherwise, if the exit code is not 0, then we show some error message + onParityError(new Error(`Exit code ${exitCode}, with signal ${signal}.`)); }); }; -- GitLab