Implemented review

pull/200/head
Vladimir Volek 6 years ago
parent 434c86dc8c
commit 31889270a0

@ -25,7 +25,7 @@
],
"env": {
"test": {
"presets": ["jest"]
"presets": ["jest"]
}
}
}
}

@ -127,6 +127,7 @@ const getAccountStatus = (state: State, selectedAccount: SelectedAccountState):
shouldRender: true,
};
}
if (!device.available) {
return {
type: 'info',

@ -23,10 +23,13 @@ export const sign = (
hex: boolean = false,
): AsyncAction => async (dispatch: Dispatch, getState: GetState): Promise<void> => {
const selected = getState().wallet.selectedDevice;
const devicePath = selected.path;
const input = {
if (!selected) return;
dispatch({ type: SIGN_VERIFY.SIGN_PROGRESS, isSignProgress: true });
const response = await TrezorConnect.ethereumSignMessage({
device: {
path: devicePath,
path: selected.path,
instance: selected.instance,
state: selected.state,
},
@ -34,11 +37,7 @@ export const sign = (
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 });
@ -74,15 +73,19 @@ export const verify = (
hex: boolean = false,
): AsyncAction => async (dispatch: Dispatch, getState: GetState): Promise<void> => {
const selected = getState().wallet.selectedDevice;
const input = {
if (!selected) return;
const response = await TrezorConnect.ethereumVerifyMessage({
device: {
path: selected.path,
instance: selected.instance,
state: selected.state,
},
address,
message,
signature,
hex,
useEmptyPassphrase: selected.useEmptyPassphrase,
};
const response = await TrezorConnect.ethereumVerifyMessage(input);
});
if (response && response.success) {
dispatch({

Loading…
Cancel
Save