Skip to content

Commit

Permalink
chore(hardware-trezor): fix small issues raised in pr review
Browse files Browse the repository at this point in the history
  • Loading branch information
DominikGuzei committed May 30, 2023
1 parent 67e8ff7 commit d008542
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/hardware-trezor/src/transformers/tx.ts
Expand Up @@ -11,7 +11,7 @@ import { mapTxIns } from './txIn';
* this function to the Transformer interface like in the
* hardware-ledger package)
*/
const ledgerTxTransformer = async (
const trezorTxTransformer = async (
body: Cardano.TxBody,
context: TrezorTxTransformerContext
): Promise<Partial<Trezor.CardanoSignTransaction>> => ({
Expand All @@ -36,7 +36,7 @@ export const txToTrezor = async (props: TxToTrezorProps): Promise<Trezor.Cardano
// First run the depricated trezor transformers
...(await depricated.txToTrezor(props)),
// Then override them with our new implementations
...(await ledgerTxTransformer(props.cardanoTxBody, {
...(await trezorTxTransformer(props.cardanoTxBody, {
chainId: props.chainId,
inputResolver: props.inputResolver,
knownAddresses: props.knownAddresses
Expand Down
2 changes: 1 addition & 1 deletion packages/hardware-trezor/src/transformers/txIn.ts
Expand Up @@ -13,7 +13,7 @@ export const toTrezorTxIn: Transform<Cardano.TxIn, Promise<Trezor.CardanoInput>,
context?
) => ({
path: (await resolvePaymentKeyPathForTxIn(txIn, context)) ?? undefined,
prev_hash: Buffer.from(txIn.txId).toString('hex'),
prev_hash: txIn.txId,
prev_index: txIn.index
});

Expand Down
2 changes: 1 addition & 1 deletion packages/hardware-trezor/test/transformers/txIn.test.ts
Expand Up @@ -29,7 +29,7 @@ describe('tx-inputs', () => {
for (const input of txIns) {
expect(input).toEqual({
path: knownAddressKeyPath,
prev_hash: Buffer.from(txIn.txId).toString('hex'),
prev_hash: txIn.txId,
prev_index: txIn.index
});
}
Expand Down

0 comments on commit d008542

Please sign in to comment.