Skip to content

Commit ea9f31e

Browse files
committed
fix: correct unsigned tx utxos on etna import tx builder
1 parent 6e24237 commit ea9f31e

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/vms/pvm/etna-builder/builder.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,12 @@ describe('./src/vms/pvm/etna-builder/builder.test.ts', () => {
308308
);
309309

310310
expectTxs(unsignedTx.getTx(), expectedTx);
311+
312+
// Ensure that the unsigned tx utxos are the filtered utxos,
313+
// and not the inputUtxos registered in the spend helper.
314+
// This is only relevant for the ImportTx.
315+
expect(unsignedTx.utxos).toHaveLength(2);
316+
expect(unsignedTx.utxos).not.toContain(utxos[1]);
311317
});
312318

313319
test('newExportTx', () => {

src/vms/pvm/etna-builder/builder.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ export const newImportTx: TxBuilderFn<NewImportTxProps> = (
397397
context,
398398
);
399399

400-
const { changeOutputs, inputs, inputUTXOs } = spendResults;
400+
const { changeOutputs, inputs } = spendResults;
401401

402402
return new UnsignedTx(
403403
new ImportTx(
@@ -411,7 +411,7 @@ export const newImportTx: TxBuilderFn<NewImportTxProps> = (
411411
Id.fromString(sourceChainId),
412412
importedInputs.sort(TransferableInput.compare),
413413
),
414-
inputUTXOs,
414+
filteredUtxos,
415415
addressMaps,
416416
);
417417
};

0 commit comments

Comments
 (0)