From be05c097e91935f2177e939b63f48d7b75392a6c Mon Sep 17 00:00:00 2001 From: Szymon Lesisz Date: Tue, 22 May 2018 12:54:30 +0200 Subject: [PATCH] useEmptyPassphrase for device without instance --- src/js/actions/DiscoveryActions.js | 11 +++++++---- src/js/actions/ReceiveActions.js | 1 + src/js/actions/SendFormActions.js | 2 +- src/js/actions/TrezorConnectActions.js | 6 ++++-- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/js/actions/DiscoveryActions.js b/src/js/actions/DiscoveryActions.js index 39834052..5ae74c67 100644 --- a/src/js/actions/DiscoveryActions.js +++ b/src/js/actions/DiscoveryActions.js @@ -140,9 +140,10 @@ const begin = (device: TrezorDevice, network: string): AsyncAction => { path: device.path, instance: device.instance, state: device.state - }, + }, path: coinToDiscover.bip44, - keepSession: true // acquire and hold session + keepSession: true, // acquire and hold session + useEmptyPassphrase: !device.instance, }); // handle TREZOR response error @@ -214,7 +215,8 @@ const discoverAccount = (device: TrezorDevice, discoveryProcess: Discovery): Asy }, path, showOnTrezor: false, - keepSession: true + keepSession: true, + useEmptyPassphrase: !device.instance, }); if (discoveryProcess.interrupted) return; @@ -312,7 +314,8 @@ const discoverAccount = (device: TrezorDevice, discoveryProcess: Discovery): Asy instance: device.instance, state: device.state }, - keepSession: false + keepSession: false, + useEmptyPassphrase: !device.instance, }); if (discoveryProcess.interrupted) return; diff --git a/src/js/actions/ReceiveActions.js b/src/js/actions/ReceiveActions.js index 165b1048..551eccae 100644 --- a/src/js/actions/ReceiveActions.js +++ b/src/js/actions/ReceiveActions.js @@ -73,6 +73,7 @@ export const showAddress = (address_n: Array): AsyncAction => { state: selected.state }, path: address_n, + useEmptyPassphrase: !selected.instance, }); if (response && response.success) { diff --git a/src/js/actions/SendFormActions.js b/src/js/actions/SendFormActions.js index 3ab4600e..abce5344 100644 --- a/src/js/actions/SendFormActions.js +++ b/src/js/actions/SendFormActions.js @@ -902,7 +902,7 @@ export const onSend = (): AsyncAction => { instance: selected.instance, state: selected.state }, - //path: "m/44'/60'/0'/0/0", + useEmptyPassphrase: !selected.instance, path: txData.address_n, nonce: strip(txData.nonce), gasPrice: strip(txData.gasPrice), diff --git a/src/js/actions/TrezorConnectActions.js b/src/js/actions/TrezorConnectActions.js index ad697fdd..e0b67d9a 100644 --- a/src/js/actions/TrezorConnectActions.js +++ b/src/js/actions/TrezorConnectActions.js @@ -292,7 +292,8 @@ export const getSelectedDeviceState = (): AsyncAction => { path: selected.path, instance: selected.instance, state: selected.state - } + }, + useEmptyPassphrase: !selected.instance, }); if (response && response.success) { @@ -383,7 +384,8 @@ export function acquire(): AsyncAction { const response = await TrezorConnect.getFeatures({ device: { path: selected.path, - } + }, + useEmptyPassphrase: !selected.instance, }); if (!response.success) {