6
6
AssetInfoWithAmount ,
7
7
AssetProvider ,
8
8
Milliseconds ,
9
+ TransactionSummaryInspection ,
9
10
createTxInspector ,
10
11
transactionSummaryInspector
11
12
} from '../../src' ;
@@ -339,7 +340,7 @@ describe('Transaction Summary Inspector', () => {
339
340
const { summary } = await inspectTx ( tx ) ;
340
341
341
342
// Assert
342
- expect ( summary ) . toEqual ( {
343
+ expect ( summary ) . toEqual < TransactionSummaryInspection > ( {
343
344
assets : buildAssetInfoWithAmount ( [
344
345
[ assetInfos [ AssetInfoIdx . A ] , 1n ] ,
345
346
[ assetInfos [ AssetInfoIdx . C ] , - 1n ] ,
@@ -352,6 +353,20 @@ describe('Transaction Summary Inspector', () => {
352
353
collateral : 0n ,
353
354
deposit : 0n ,
354
355
fee,
356
+ resolvedInputs : [
357
+ {
358
+ ...tx . body . inputs [ 0 ] ,
359
+ value : histTx [ 0 ] . body . outputs [ 0 ] . value
360
+ } ,
361
+ {
362
+ ...tx . body . inputs [ 1 ] ,
363
+ value : histTx [ 0 ] . body . outputs [ 1 ] . value
364
+ } ,
365
+ {
366
+ ...tx . body . inputs [ 2 ] ,
367
+ value : histTx [ 0 ] . body . outputs [ 2 ] . value
368
+ }
369
+ ] ,
355
370
returnedDeposit : 0n ,
356
371
unresolved : {
357
372
inputs : [ ] ,
@@ -444,6 +459,12 @@ describe('Transaction Summary Inspector', () => {
444
459
collateral : 10_000_000n ,
445
460
deposit : 0n ,
446
461
fee,
462
+ resolvedInputs : [
463
+ {
464
+ ...tx . body . inputs [ 0 ] ,
465
+ value : histTx [ 0 ] . body . outputs [ 0 ] . value
466
+ }
467
+ ] ,
447
468
returnedDeposit : 0n ,
448
469
unresolved : {
449
470
inputs : [ ] ,
@@ -538,6 +559,12 @@ describe('Transaction Summary Inspector', () => {
538
559
collateral : 25_000_000n ,
539
560
deposit : 0n ,
540
561
fee,
562
+ resolvedInputs : [
563
+ {
564
+ ...tx . body . inputs [ 0 ] ,
565
+ value : histTx [ 0 ] . body . outputs [ 0 ] . value
566
+ }
567
+ ] ,
541
568
returnedDeposit : 0n ,
542
569
unresolved : {
543
570
inputs : [ ] ,
@@ -624,6 +651,12 @@ describe('Transaction Summary Inspector', () => {
624
651
collateral : 5_000_000n ,
625
652
deposit : 0n ,
626
653
fee,
654
+ resolvedInputs : [
655
+ {
656
+ ...tx . body . inputs [ 0 ] ,
657
+ value : histTx [ 0 ] . body . outputs [ 0 ] . value
658
+ }
659
+ ] ,
627
660
returnedDeposit : 0n ,
628
661
unresolved : {
629
662
inputs : [ ] ,
@@ -693,6 +726,12 @@ describe('Transaction Summary Inspector', () => {
693
726
collateral : 0n ,
694
727
deposit : 2_000_000n ,
695
728
fee,
729
+ resolvedInputs : [
730
+ {
731
+ ...tx . body . inputs [ 0 ] ,
732
+ value : histTx [ 0 ] . body . outputs [ 0 ] . value
733
+ }
734
+ ] ,
696
735
returnedDeposit : 0n ,
697
736
unresolved : {
698
737
inputs : [ ] ,
@@ -762,6 +801,12 @@ describe('Transaction Summary Inspector', () => {
762
801
collateral : 0n ,
763
802
deposit : 0n ,
764
803
fee,
804
+ resolvedInputs : [
805
+ {
806
+ ...tx . body . inputs [ 0 ] ,
807
+ value : histTx [ 0 ] . body . outputs [ 0 ] . value
808
+ }
809
+ ] ,
765
810
returnedDeposit : 2_000_000n ,
766
811
unresolved : {
767
812
inputs : [ ] ,
@@ -840,6 +885,12 @@ describe('Transaction Summary Inspector', () => {
840
885
collateral : 0n ,
841
886
deposit : 15_000_000n ,
842
887
fee,
888
+ resolvedInputs : [
889
+ {
890
+ ...tx . body . inputs [ 0 ] ,
891
+ value : histTx [ 0 ] . body . outputs [ 0 ] . value
892
+ }
893
+ ] ,
843
894
returnedDeposit : 0n ,
844
895
unresolved : {
845
896
inputs : [ ] ,
@@ -918,6 +969,12 @@ describe('Transaction Summary Inspector', () => {
918
969
collateral : 0n ,
919
970
deposit : 0n ,
920
971
fee,
972
+ resolvedInputs : [
973
+ {
974
+ ...tx . body . inputs [ 0 ] ,
975
+ value : histTx [ 0 ] . body . outputs [ 0 ] . value
976
+ }
977
+ ] ,
921
978
returnedDeposit : 15_000_000n ,
922
979
unresolved : {
923
980
inputs : [ ] ,
@@ -1011,6 +1068,12 @@ describe('Transaction Summary Inspector', () => {
1011
1068
collateral : 0n ,
1012
1069
deposit : 0n ,
1013
1070
fee,
1071
+ resolvedInputs : [
1072
+ {
1073
+ ...tx . body . inputs [ 0 ] ,
1074
+ value : histTx [ 0 ] . body . outputs [ 0 ] . value
1075
+ }
1076
+ ] ,
1014
1077
returnedDeposit : 0n ,
1015
1078
unresolved : {
1016
1079
inputs : [
@@ -1100,6 +1163,7 @@ describe('Transaction Summary Inspector', () => {
1100
1163
collateral : 0n ,
1101
1164
deposit : 0n ,
1102
1165
fee,
1166
+ resolvedInputs : [ ] ,
1103
1167
returnedDeposit : 0n ,
1104
1168
unresolved : {
1105
1169
inputs : [
@@ -1199,6 +1263,19 @@ describe('Transaction Summary Inspector', () => {
1199
1263
"collateral": 0n,
1200
1264
"deposit": 0n,
1201
1265
"fee": 170000n,
1266
+ "resolvedInputs": Array [
1267
+ Object {
1268
+ "address": "addr1z8phkx6acpnf78fuvxn0mkew3l0fd058hzquvz7w36x4gten0d3vllmyqwsx5wktcd8cc3sq835lu7drv2xwl2wywfgs9yc0hh",
1269
+ "index": 0,
1270
+ "txId": "bb217abaca60fc0ca68c1555eca6a96d2478547818ae76ce6836133f3cc546e0",
1271
+ "value": Object {
1272
+ "assets": Map {
1273
+ "659f2917fb63f12b33667463ee575eeac1845bbc736b9c0bbc40ba8254534c41" => 5n,
1274
+ },
1275
+ "coins": 3000000n,
1276
+ },
1277
+ },
1278
+ ],
1202
1279
"returnedDeposit": 0n,
1203
1280
"unresolved": Object {
1204
1281
"inputs": Array [],
0 commit comments