Skip to content
Permalink
Browse files

Fixes flow

  • Loading branch information...
gre committed Mar 5, 2019
1 parent 2504853 commit 64cf3a483bbb10128e1aca7de70c2d45763cb028
@@ -281,7 +281,7 @@ const install = (
const genuineCheck = (
transport: Transport<*>,
{ targetId, perso }: { targetId: *, perso: * }
): Observable<*> =>
): Observable<GenuineCheckEvent> =>
createDeviceSocket(transport, {
url: URL.format({
pathname: `${getEnv("BASE_SOCKET_URL")}/genuine`,
@@ -540,8 +540,8 @@ export const accountBridge: AccountBridge<Transaction> = {
!t.gasPrice
? Promise.reject(new FeeNotLoaded())
: t.amount.isLessThanOrEqualTo(a.balance)
? Promise.resolve(null)
: Promise.reject(new NotEnoughBalance()),
? Promise.resolve(null)
: Promise.reject(new NotEnoughBalance()),

getTotalSpent: (a, t) =>
t.amount.isGreaterThan(0) &&
@@ -224,11 +224,13 @@ function createCounterValues<State>({
}
);

const pairsKeySelector = createSelector(pairsSelector, pairs =>
pairs
.map(p => `${p.from.ticker}-${p.to.ticker}-${p.exchange || ""}`)
.sort()
.join("|")
const pairsKeySelector = createSelector(
pairsSelector,
pairs =>
pairs
.map(p => `${p.from.ticker}-${p.to.ticker}-${p.exchange || ""}`)
.sort()
.join("|")
);

const MAXIMUM_RATIO_EXTREME_VARIATION = 1000;
@@ -879,8 +879,7 @@ const cryptocurrenciesById: { [name: string]: CryptoCurrency } = {
],
txExplorers: ["http://explorer.h.cash/tx/$hash"],
terminated: {
link:
"https://support.ledger.com/hc/en-us/articles/115003917133"
link: "https://support.ledger.com/hc/en-us/articles/115003917133"
}
},
icon: {
@@ -1338,8 +1337,7 @@ const cryptocurrenciesById: { [name: string]: CryptoCurrency } = {
],
txExplorers: [],
terminated: {
link:
"https://support.ledger.com/hc/en-us/articles/115005175309"
link: "https://support.ledger.com/hc/en-us/articles/115005175309"
}
},
qtum: {
@@ -2,15 +2,15 @@
import Transport from "@ledgerhq/hw-transport";
import { Observable, of, throwError } from "rxjs";
import { UnexpectedBootloader } from "@ledgerhq/errors";
import type { DeviceInfo } from "../types/manager";
import type { DeviceInfo, GenuineCheckEvent } from "../types/manager";
import genuineCheck from "./genuineCheck";

export default (
transport: Transport<*>,
deviceInfo: DeviceInfo
): Observable<string> =>
): Observable<GenuineCheckEvent> =>
deviceInfo.isOSU
? of("0000")
? of({ type: "result", payload: "0000" })
: deviceInfo.isBootloader
? throwError(new UnexpectedBootloader())
: genuineCheck(transport, deviceInfo);
? throwError(new UnexpectedBootloader())
: genuineCheck(transport, deviceInfo);
@@ -38,25 +38,22 @@ const main = (
);

const waitForBootloader = withDeviceInfo.pipe(
concatMap(
deviceInfo =>
deviceInfo.isBootloader ? empty() : concat(wait2s, waitForBootloader)
concatMap(deviceInfo =>
deviceInfo.isBootloader ? empty() : concat(wait2s, waitForBootloader)
)
);

const bootloaderLoop = withDeviceInfo.pipe(
concatMap(
deviceInfo =>
!deviceInfo.isBootloader
? empty()
: concat(withDeviceInstall(flash(final)), wait2s, bootloaderLoop)
concatMap(deviceInfo =>
!deviceInfo.isBootloader
? empty()
: concat(withDeviceInstall(flash(final)), wait2s, bootloaderLoop)
)
);

const finalStep = withDeviceInfo.pipe(
concatMap(
deviceInfo =>
!deviceInfo.isOSU ? empty() : withDeviceInstall(installFinalFirmware)
concatMap(deviceInfo =>
!deviceInfo.isOSU ? empty() : withDeviceInstall(installFinalFirmware)
)
);

@@ -24,9 +24,8 @@ const repair = (
);

const waitForBootloader = withDeviceInfo.pipe(
concatMap(
deviceInfo =>
deviceInfo.isBootloader ? empty() : concat(wait2s, waitForBootloader)
concatMap(deviceInfo =>
deviceInfo.isBootloader ? empty() : concat(wait2s, waitForBootloader)
)
);

0 comments on commit 64cf3a4

Please sign in to comment.
You can’t perform that action at this time.