Browse Source
Merge pull request #1245 from amougel/feature/test_provider
add FORCE_PROVIDER constant for testing
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
5 additions and
1 deletions
-
src/config/constants.js
-
src/helpers/devices/getDeviceInfo.js
|
|
@ -58,6 +58,9 @@ export const MANAGER_API_BASE = stringFromEnv( |
|
|
|
|
|
|
|
export const BASE_SOCKET_URL = stringFromEnv('BASE_SOCKET_URL', 'wss://api.ledgerwallet.com/update') |
|
|
|
|
|
|
|
// Provider
|
|
|
|
export const FORCE_PROVIDER = intFromEnv('FORCE_PROVIDER', 0) |
|
|
|
|
|
|
|
// Flags
|
|
|
|
|
|
|
|
export const DEBUG_ANALYTICS = boolFromEnv('DEBUG_ANALYTICS') |
|
|
|
|
|
@ -3,6 +3,7 @@ |
|
|
|
import type Transport from '@ledgerhq/hw-transport' |
|
|
|
|
|
|
|
import { getFirmwareInfo } from 'helpers/common' |
|
|
|
import { FORCE_PROVIDER } from 'config/constants' |
|
|
|
|
|
|
|
export type DeviceInfo = { |
|
|
|
targetId: string | number, |
|
|
@ -31,7 +32,7 @@ export default async (transport: Transport<*>): Promise<DeviceInfo> => { |
|
|
|
seVersion.match(/([0-9]+.[0-9])+(.[0-9]+)?((?!-osu)-([a-z]+))?(-osu)?/) || [] |
|
|
|
const isOSU = typeof parsedVersion[5] !== 'undefined' |
|
|
|
const providerName = parsedVersion[4] || '' |
|
|
|
const providerId = PROVIDERS[providerName] |
|
|
|
const providerId = FORCE_PROVIDER || PROVIDERS[providerName] |
|
|
|
const isBootloader = targetId === 0x01000001 |
|
|
|
const majMin = parsedVersion[1] |
|
|
|
const patch = parsedVersion[2] || '.0' |
|
|
|