From cbe71fdf9a14c704189961e8521f42a737da8215 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Renaudeau?= Date: Mon, 28 May 2018 17:06:39 +0200 Subject: [PATCH] Remove Account#path with latest live-common --- package.json | 2 +- src/bridge/EthereumJSBridge.js | 5 +---- src/bridge/RippleJSBridge.js | 6 +----- yarn.lock | 6 +++--- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index fabbcf28..8f38b771 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "@ledgerhq/hw-transport": "^4.12.0", "@ledgerhq/hw-transport-node-hid": "^4.12.0", "@ledgerhq/ledger-core": "^1.2.1", - "@ledgerhq/live-common": "^2.9.1", + "@ledgerhq/live-common": "2.10.0", "axios": "^0.18.0", "babel-runtime": "^6.26.0", "bcryptjs": "^2.4.3", diff --git a/src/bridge/EthereumJSBridge.js b/src/bridge/EthereumJSBridge.js index cbb56d11..46924add 100644 --- a/src/bridge/EthereumJSBridge.js +++ b/src/bridge/EthereumJSBridge.js @@ -115,7 +115,6 @@ const EthereumBridge: WalletBridge = { let { txs } = await api.getTransactions(address) if (finished) return { complete: true } - const path = freshAddressPath // FIXME const freshAddress = address if (txs.length === 0) { @@ -127,7 +126,6 @@ const EthereumBridge: WalletBridge = { const account: $Exact = { id: accountId, xpub: '', - path, // FIXME we probably not want the address path in the account.path freshAddress, freshAddressPath, name: 'New Account', @@ -153,7 +151,6 @@ const EthereumBridge: WalletBridge = { const account: $Exact = { id: accountId, xpub: '', - path, // FIXME we probably not want the address path in the account.path freshAddress, freshAddressPath, name: address.slice(32), @@ -308,7 +305,7 @@ const EthereumBridge: WalletBridge = { .send({ currencyId: a.currency.id, devicePath: deviceId, - path: a.path, + path: a.freshAddressPath, transaction: { ...t, nonce }, }) .toPromise() diff --git a/src/bridge/RippleJSBridge.js b/src/bridge/RippleJSBridge.js index 51c66b0d..3113f0ed 100644 --- a/src/bridge/RippleJSBridge.js +++ b/src/bridge/RippleJSBridge.js @@ -188,8 +188,6 @@ const RippleJSBridge: WalletBridge = { for (const derivation of derivations) { for (let index = 0; index < 255; index++) { const freshAddressPath = derivation({ currency, x: index, segwit: false }) - const path = freshAddressPath - // FIXME^ we need the account path, not the address path const { address } = await await getAddress .send({ currencyId: currency.id, devicePath: deviceId, path: freshAddressPath }) .toPromise() @@ -215,7 +213,6 @@ const RippleJSBridge: WalletBridge = { next({ id: accountId, xpub: '', - path, name: 'New Account', freshAddress, freshAddressPath, @@ -247,7 +244,6 @@ const RippleJSBridge: WalletBridge = { const account: $Exact = { id: accountId, xpub: '', - path, name: address.slice(0, 8), freshAddress, freshAddressPath, @@ -426,7 +422,7 @@ const RippleJSBridge: WalletBridge = { .send({ currencyId: a.currency.id, devicePath: deviceId, - path: a.path, + path: a.freshAddressPath, transaction: JSON.parse(prepared.txJSON), }) .toPromise() diff --git a/yarn.lock b/yarn.lock index 58ece7be..821949f4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1464,9 +1464,9 @@ npm "^5.7.1" prebuild-install "^2.2.2" -"@ledgerhq/live-common@^2.9.1": - version "2.9.2" - resolved "https://registry.yarnpkg.com/@ledgerhq/live-common/-/live-common-2.9.2.tgz#e77139368c690fc542cb95cdb87ea37890652377" +"@ledgerhq/live-common@2.10.0": + version "2.10.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/live-common/-/live-common-2.10.0.tgz#c4f8891e23f45afd533addf6f603edfeb284aa14" dependencies: axios "^0.18.0" invariant "^2.2.2"