Browse Source
Merge pull request #870 from gre/genuine-check-false-positive-fix
Fix false positive in genuine check
master
Gaëtan Renaudeau
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
7 additions and
0 deletions
-
src/components/GenuineCheck.js
-
static/i18n/en/errors.yml
|
|
@ -27,6 +27,7 @@ import IconHome from 'icons/Home' |
|
|
|
import IconCheck from 'icons/Check' |
|
|
|
|
|
|
|
const DeviceNotGenuineError = createCustomErrorClass('DeviceNotGenuine') |
|
|
|
const DeviceGenuineSocketEarlyClose = createCustomErrorClass('DeviceGenuineSocketEarlyClose') |
|
|
|
|
|
|
|
type Props = { |
|
|
|
t: T, |
|
|
@ -93,6 +94,9 @@ class GenuineCheck extends PureComponent<Props> { |
|
|
|
logger.log(`genuine check resulted ${res} after ${(Date.now() - beforeDate) / 1000}s`, { |
|
|
|
deviceInfo, |
|
|
|
}) |
|
|
|
if (!res) { |
|
|
|
throw new DeviceGenuineSocketEarlyClose() |
|
|
|
} |
|
|
|
const isGenuine = res === '0000' |
|
|
|
if (!isGenuine) { |
|
|
|
throw new DeviceNotGenuineError() |
|
|
|
|
|
@ -5,6 +5,9 @@ BtcUnmatchedApp: |
|
|
|
DeviceNotGenuine: |
|
|
|
title: Possibly not genuine |
|
|
|
description: 'Request Ledger Support assistance.' |
|
|
|
DeviceGenuineSocketEarlyClose: |
|
|
|
title: Sorry, try again (genuine-close) |
|
|
|
description: |
|
|
|
DeviceSocketFail: |
|
|
|
title: Oops, try again |
|
|
|
description: 'Some connection failed, so please try again.' |
|
|
|