From 11348ec5a246e23912d415ea0e887b9ccf1e9e9b Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Mon, 18 May 2026 06:56:27 -0700 Subject: [PATCH] Remove redundant argument validation. --- src/lib/ledger/sign.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/lib/ledger/sign.ts b/src/lib/ledger/sign.ts index f10ec9c..db1d98c 100644 --- a/src/lib/ledger/sign.ts +++ b/src/lib/ledger/sign.ts @@ -1,7 +1,7 @@ //! SPDX-FileCopyrightText: 2025 Chris Duncan //! SPDX-License-Identifier: GPL-3.0-or-later -import { APDU_CODES, DERIVATION_PATH, LedgerSignResponse, LedgerTransport, STATUS_CODES, LISTEN_TIMEOUT, OPEN_TIMEOUT } from '.' +import { APDU_CODES, DERIVATION_PATH, LedgerSignResponse, LedgerTransport, LISTEN_TIMEOUT, OPEN_TIMEOUT, STATUS_CODES } from '.' import { Account } from '../account' import { Block } from '../block' import { HARDENED_OFFSET } from '../constants' @@ -59,9 +59,6 @@ async function signBlock (transport: LedgerTransport, index: number, block: Bloc } return queue(async () => { try { - if (typeof index !== 'number' || index < 0 || index >= HARDENED_OFFSET) { - throw new TypeError('Invalid account index') - } if (!(block.link instanceof Uint8Array)) { throw new TypeError('Invalid block link') } @@ -111,9 +108,6 @@ async function signBlock (transport: LedgerTransport, index: number, block: Bloc */ async function signNonce (transport: LedgerTransport, index: number, nonce: Uint8Array): Promise { return queue(async () => { - if (typeof index !== 'number' || index < 0 || index >= HARDENED_OFFSET) { - throw new TypeError('Invalid account index') - } if (nonce.byteLength !== 16) { throw new RangeError('Nonce must be 16-byte string') } -- 2.47.3