Skip to content

Commit

Permalink
fix(ledger): use correct key number
Browse files Browse the repository at this point in the history
  • Loading branch information
kyranjamie authored and pete-watters committed May 15, 2024
1 parent 89257f3 commit ffd79f4
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ import { pullBitcoinKeysFromLedgerDevice } from '@app/features/ledger/flows/requ
import { ledgerRequestKeysRoutes } from '@app/features/ledger/generic-flows/request-keys/ledger-request-keys-route-generator';
import { LedgerRequestKeysContext } from '@app/features/ledger/generic-flows/request-keys/ledger-request-keys.context';
import { RequestKeysFlow } from '@app/features/ledger/generic-flows/request-keys/request-keys-flow';
import { useRequestLedgerKeys } from '@app/features/ledger/generic-flows/request-keys/use-request-ledger-keys';
import {
defaultNumberOfKeysToPullFromLedgerDevice,
useRequestLedgerKeys,
} from '@app/features/ledger/generic-flows/request-keys/use-request-ledger-keys';
import { useLedgerNavigate } from '@app/features/ledger/hooks/use-ledger-navigate';
import {
connectLedgerBitcoinApp,
Expand All @@ -28,7 +31,7 @@ function LedgerRequestBitcoinKeys() {
const ledgerNavigate = useLedgerNavigate();
const network = useCurrentNetwork();

const chain = 'bitcoin' as const;
const chain = 'bitcoin';

const { requestKeys, latestDeviceResponse, awaitingDeviceConnection } =
useRequestLedgerKeys<BitcoinApp>({
Expand All @@ -45,11 +48,13 @@ function LedgerRequestBitcoinKeys() {
onRequestKey(index) {
if (index <= 4) {
ledgerNavigate.toDeviceBusyStep(
`Requesting Bitcoin Native Segwit address (${index + 1}5)`
`Requesting Bitcoin Native Segwit address (${index + 1}${defaultNumberOfKeysToPullFromLedgerDevice})`
);
return;
}
ledgerNavigate.toDeviceBusyStep(`Requesting Bitcoin Taproot address (${index - 4}…5)`);
ledgerNavigate.toDeviceBusyStep(
`Requesting Bitcoin Taproot address (${index - 4}${defaultNumberOfKeysToPullFromLedgerDevice})`
);
},
});
dispatch(bitcoinKeysSlice.actions.addKeys(keys));
Expand Down

0 comments on commit ffd79f4

Please sign in to comment.