Skip to content

Commit f6e5392

Browse files
Merge pull request #5273 from BitGo/BTC-1450.rename-outputdifference-type
refactor(abstract-utxo): rename ParseOutputsResult
2 parents 35580f5 + e51777d commit f6e5392

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

modules/abstract-utxo/src/transaction/descriptor/outputDifference.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,6 @@ export type ComparableOutput = {
33
value: bigint;
44
};
55

6-
export type ParseOutputsResult<T extends ComparableOutput> = {
7-
/** These are the external outputs that were explicitly specified in the transaction */
8-
explicitExternalOutputs: T[];
9-
/**
10-
* These are the surprise external outputs that were not explicitly specified in the transaction.
11-
* They can be PayGo fees.
12-
*/
13-
implicitExternalOutputs: T[];
14-
/**
15-
* These are the outputs that were expected to be in the transaction but were not found.
16-
*/
17-
missingOutputs: T[];
18-
};
19-
206
export function equalOutput<T extends ComparableOutput>(a: T, b: T): boolean {
217
return a.value === b.value && a.script.equals(b.script);
228
}
@@ -36,6 +22,20 @@ export function outputDifference<T extends ComparableOutput>(first: T[], second:
3622
return first;
3723
}
3824

25+
export type OutputDifferenceWithExpected<T extends ComparableOutput> = {
26+
/** These are the external outputs that were expected and found in the transaction. */
27+
explicitExternalOutputs: T[];
28+
/**
29+
* These are the surprise external outputs that were not explicitly specified in the transaction.
30+
* They can be PayGo fees.
31+
*/
32+
implicitExternalOutputs: T[];
33+
/**
34+
* These are the outputs that were expected to be in the transaction but were not found.
35+
*/
36+
missingOutputs: T[];
37+
};
38+
3939
/**
4040
* @param actualExternalOutputs - external outputs in the transaction
4141
* @param expectedExternalOutputs - external outputs that were expected to be in the transaction
@@ -44,7 +44,7 @@ export function outputDifference<T extends ComparableOutput>(first: T[], second:
4444
export function outputDifferencesWithExpected<T extends ComparableOutput>(
4545
actualExternalOutputs: T[],
4646
expectedExternalOutputs: T[]
47-
): ParseOutputsResult<T> {
47+
): OutputDifferenceWithExpected<T> {
4848
const implicitExternalOutputs = outputDifference(actualExternalOutputs, expectedExternalOutputs);
4949
const explicitExternalOutputs = outputDifference(actualExternalOutputs, implicitExternalOutputs);
5050
const missingOutputs = outputDifference(expectedExternalOutputs, actualExternalOutputs);

0 commit comments

Comments
 (0)