@@ -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-
206export 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:
4444export 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