From 4f1f2364c2b90f7d9cb894728c0dcb491742992d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Renaudeau?= Date: Thu, 14 Jun 2018 14:55:55 +0200 Subject: [PATCH] replace getWalletIdentifier by accountIdHelper for sign --- src/commands/libcoreSignAndBroadcast.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/commands/libcoreSignAndBroadcast.js b/src/commands/libcoreSignAndBroadcast.js index 3f0cc9e2..5a3a8169 100644 --- a/src/commands/libcoreSignAndBroadcast.js +++ b/src/commands/libcoreSignAndBroadcast.js @@ -10,7 +10,7 @@ import { isSegwitAccount } from 'helpers/bip32' import withLibcore from 'helpers/withLibcore' import { createCommand, Command } from 'helpers/ipc' import { withDevice } from 'helpers/deviceAccess' -import { getWalletIdentifier } from 'helpers/libcore' +import * as accountIdHelper from 'helpers/accountId' type BitcoinLikeTransaction = { amount: number, @@ -156,15 +156,8 @@ export async function doSignAndBroadcast({ const signedTransaction = await withDevice(deviceId)(async transport => { const hwApp = new Btc(transport) - - const WALLET_IDENTIFIER = await getWalletIdentifier({ - hwApp, - isSegwit: isSegwitAccount(account), - currencyId: account.currencyId, - devicePath: deviceId, - }) - - const njsWallet = await core.getWallet(WALLET_IDENTIFIER) + const { walletName } = accountIdHelper.decode(account.id) + const njsWallet = await core.getWallet(walletName) if (isCancelled()) return null njsAccount = await njsWallet.getAccount(account.index) if (isCancelled()) return null