meriadec
7 years ago
No known key found for this signature in database
GPG Key ID: 1D2FC2305E2CB399
3 changed files with
8 additions and
4 deletions
-
src/bridge/index.js
-
src/bridge/makeMockBridge.js
-
src/components/modals/ImportAccounts/index.js
|
|
@ -1,5 +1,8 @@ |
|
|
|
// @flow
|
|
|
|
import type { Currency } from '@ledgerhq/live-common/lib/types' |
|
|
|
|
|
|
|
import makeMockBridge from 'bridge/makeMockBridge' |
|
|
|
|
|
|
|
import { WalletBridge } from './types' |
|
|
|
import LibcoreBridge from './LibcoreBridge' |
|
|
|
import EthereumJSBridge from './EthereumJSBridge' |
|
|
@ -12,5 +15,6 @@ export const getBridgeForCurrency = (currency: Currency): WalletBridge<any> => { |
|
|
|
if (currency.id === 'ripple') { |
|
|
|
return RippleJSBridge // polyfill js
|
|
|
|
} |
|
|
|
return makeMockBridge({}) |
|
|
|
return LibcoreBridge // libcore for the rest
|
|
|
|
} |
|
|
|
|
|
@ -79,13 +79,13 @@ function makeMockBridge(opts?: Opts): WalletBridge<*> { |
|
|
|
|
|
|
|
async function job() { |
|
|
|
if (Math.random() > scanAccountDeviceSuccessRate) { |
|
|
|
await delay(5000) |
|
|
|
await delay(1000) |
|
|
|
if (!unsubscribed) error(new Error('scan failed')) |
|
|
|
return |
|
|
|
} |
|
|
|
const nbAccountToGen = 3 |
|
|
|
for (let i = 0; i < nbAccountToGen && !unsubscribed; i++) { |
|
|
|
await delay(2000) |
|
|
|
await delay(500) |
|
|
|
const account = genAccount(String(Math.random()), { |
|
|
|
operationsSize: 0, |
|
|
|
currency, |
|
|
|
|
|
@ -82,9 +82,9 @@ const mapStateToProps = state => ({ |
|
|
|
}) |
|
|
|
|
|
|
|
const INITIAL_STATE = { |
|
|
|
stepId: 'chooseCurrency', |
|
|
|
stepId: 'import', |
|
|
|
isAppOpened: false, |
|
|
|
currency: null, |
|
|
|
currency: getCryptoCurrencyById('bitcoin'), |
|
|
|
} |
|
|
|
|
|
|
|
class ImportAccounts extends PureComponent<Props, State> { |
|
|
|