Skip to content

Commit a2b3c5c

Browse files
fixup! fix(ledger): fix output format mapping on ledger HW devices
1 parent 71cd456 commit a2b3c5c

File tree

1 file changed

+1
-32
lines changed

1 file changed

+1
-32
lines changed

packages/hardware-ledger/src/LedgerKeyAgent.ts

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -705,37 +705,6 @@ export class LedgerKeyAgent extends KeyAgentBase {
705705
return TransactionSigningMode.ORDINARY_TRANSACTION;
706706
}
707707

708-
/**
709-
* There are currently two types of outputs supported by the ledger:
710-
*
711-
* legacy_transaction_output =
712-
* [ address
713-
* , amount : value
714-
* , ? datum_hash : $hash32
715-
* ]
716-
*
717-
* and
718-
*
719-
* post_alonzo_transaction_output =
720-
* { 0 : address
721-
* , 1 : value
722-
* , ? 2 : datum_option ; New; datum option
723-
* , ? 3 : script_ref ; New; script reference
724-
* }
725-
*
726-
* Legacy outputs are definite length arrays of three elements, however the new babbage outputs are definite length maps
727-
* of four elements.
728-
*
729-
* @param outputs The outputs to be verified.
730-
*/
731-
hasBabbageOutput(outputs: Array<Serialization.TransactionOutput>): boolean {
732-
if (outputs.length === 0) return false;
733-
734-
const reader = new Serialization.CborReader(outputs[0].toCbor());
735-
736-
return reader.peekState() === Serialization.CborReaderState.StartMap;
737-
}
738-
739708
// TODO: LW-10571 - Allow additional key paths. This is necessary for multi-signature wallets
740709
// hardware devices inspect the transaction to determine which keys to use for signing,
741710
// however, multi sig transaction do not reference the CIP-1854 directly, but rather the script hash
@@ -757,7 +726,7 @@ export class LedgerKeyAgent extends KeyAgentBase {
757726
dRepKeyHashHex,
758727
knownAddresses,
759728
txInKeyPathMap,
760-
useBabbageOutputs: this.hasBabbageOutput(txBody.outputs())
729+
useBabbageOutputs: txBody.hasBabbageOutput()
761730
});
762731

763732
const deviceConnection = await LedgerKeyAgent.checkDeviceConnection(

0 commit comments

Comments
 (0)