From 35ce9b6a1d523c4162cc11e169bb8d5458e9fb23 Mon Sep 17 00:00:00 2001 From: Vladimir Volek Date: Sat, 20 Oct 2018 02:11:24 +0200 Subject: [PATCH] Refactor sign input --- src/actions/SignVerifyActions.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/actions/SignVerifyActions.js b/src/actions/SignVerifyActions.js index 2b6c76d8..a9eed358 100644 --- a/src/actions/SignVerifyActions.js +++ b/src/actions/SignVerifyActions.js @@ -11,21 +11,21 @@ export const sign = ( ): AsyncAction => async (dispatch: Dispatch, getState: GetState): Promise => { const selected = getState().wallet.selectedDevice; const devicePath = selected.path; - const device = { - path: devicePath, - instance: selected.instance, - state: selected.state, - }; - - dispatch({ type: SIGN_VERIFY.SIGN_PROGRESS, isSignProgress: true }); - - const response = await TrezorConnect.ethereumSignMessage({ - device, + const input = { + device: { + path: devicePath, + instance: selected.instance, + state: selected.state, + }, path, hex, message, useEmptyPassphrase: selected.useEmptyPassphrase, - }); + }; + + dispatch({ type: SIGN_VERIFY.SIGN_PROGRESS, isSignProgress: true }); + + const response = await TrezorConnect.ethereumSignMessage(input); dispatch({ type: SIGN_VERIFY.SIGN_PROGRESS, isSignProgress: false });