Browse Source

Mock things up for rapid development

master
meriadec 7 years ago
parent
commit
2f8d7c3339
No known key found for this signature in database GPG Key ID: 1D2FC2305E2CB399
  1. 4
      src/bridge/index.js
  2. 4
      src/bridge/makeMockBridge.js
  3. 4
      src/components/modals/ImportAccounts/index.js

4
src/bridge/index.js

@ -1,5 +1,8 @@
// @flow // @flow
import type { Currency } from '@ledgerhq/live-common/lib/types' import type { Currency } from '@ledgerhq/live-common/lib/types'
import makeMockBridge from 'bridge/makeMockBridge'
import { WalletBridge } from './types' import { WalletBridge } from './types'
import LibcoreBridge from './LibcoreBridge' import LibcoreBridge from './LibcoreBridge'
import EthereumJSBridge from './EthereumJSBridge' import EthereumJSBridge from './EthereumJSBridge'
@ -12,5 +15,6 @@ export const getBridgeForCurrency = (currency: Currency): WalletBridge<any> => {
if (currency.id === 'ripple') { if (currency.id === 'ripple') {
return RippleJSBridge // polyfill js return RippleJSBridge // polyfill js
} }
return makeMockBridge({})
return LibcoreBridge // libcore for the rest return LibcoreBridge // libcore for the rest
} }

4
src/bridge/makeMockBridge.js

@ -79,13 +79,13 @@ function makeMockBridge(opts?: Opts): WalletBridge<*> {
async function job() { async function job() {
if (Math.random() > scanAccountDeviceSuccessRate) { if (Math.random() > scanAccountDeviceSuccessRate) {
await delay(5000) await delay(1000)
if (!unsubscribed) error(new Error('scan failed')) if (!unsubscribed) error(new Error('scan failed'))
return return
} }
const nbAccountToGen = 3 const nbAccountToGen = 3
for (let i = 0; i < nbAccountToGen && !unsubscribed; i++) { for (let i = 0; i < nbAccountToGen && !unsubscribed; i++) {
await delay(2000) await delay(500)
const account = genAccount(String(Math.random()), { const account = genAccount(String(Math.random()), {
operationsSize: 0, operationsSize: 0,
currency, currency,

4
src/components/modals/ImportAccounts/index.js

@ -82,9 +82,9 @@ const mapStateToProps = state => ({
}) })
const INITIAL_STATE = { const INITIAL_STATE = {
stepId: 'chooseCurrency', stepId: 'import',
isAppOpened: false, isAppOpened: false,
currency: null, currency: getCryptoCurrencyById('bitcoin'),
} }
class ImportAccounts extends PureComponent<Props, State> { class ImportAccounts extends PureComponent<Props, State> {

Loading…
Cancel
Save