From c5ffc4e7ddfef72033b18a4e33faf4a33a1573d8 Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Tue, 13 Jun 2017 14:44:39 -0300 Subject: [PATCH] fix account setting in Trezor/Ledger --- src/js/controllers/import.js | 2 ++ src/js/services/trezor.js | 10 ++++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/js/controllers/import.js b/src/js/controllers/import.js index a3b8e134e..65f3732e5 100644 --- a/src/js/controllers/import.js +++ b/src/js/controllers/import.js @@ -297,6 +297,7 @@ angular.module('copayApp.controllers').controller('importController', lopts.externalSource = walletService.externalSource.trezor.id; lopts.bwsurl = $scope.formData.bwsurl; + lopts.account = account; ongoingProcess.set('importingWallet', true); $log.debug('Import opts', lopts); @@ -353,6 +354,7 @@ angular.module('copayApp.controllers').controller('importController', lopts.externalSource = lopts.externalSource = walletService.externalSource.ledger.id; lopts.bwsurl = $scope.formData.bwsurl; + lopts.account = account; ongoingProcess.set('importingWallet', true); $log.debug('Import opts', lopts); diff --git a/src/js/services/trezor.js b/src/js/services/trezor.js index 0411386fc..3d40d88d1 100644 --- a/src/js/services/trezor.js +++ b/src/js/services/trezor.js @@ -93,7 +93,6 @@ angular.module('copayApp.services') outputs = []; var tmpOutputs = []; - if (txp.type && txp.type != 'simple') { return callback('Only TXPs type SIMPLE are supported in TREZOR'); } else if (txp.outputs) { @@ -170,7 +169,6 @@ angular.module('copayApp.services') return ''; }); - inputs = lodash.map(txp.inputs, function(i) { $log.debug("Trezor TX input path:", i.path); var pathArr = i.path.split('/'); @@ -180,12 +178,12 @@ angular.module('copayApp.services') inAmount += i.satoshis; var orderedPubKeys = root._orderPubKeys(xPubKeys, np); - var pubkeys = lodash(orderedPubKeys.map(function(v) { + var pubkeys = orderedPubKeys.map(function(v) { return { node: v, address_n: np, }; - })); + }); return { address_n: n, @@ -208,12 +206,12 @@ angular.module('copayApp.services') var np = n.slice(3); var orderedPubKeys = root._orderPubKeys(xPubKeys, np); - var pubkeys = lodash(orderedPubKeys.map(function(v) { + var pubkeys = orderedPubKeys.map(function(v) { return { node: v, address_n: np, }; - })); + }); tmpOutputs.push({ address_n: n,