@@ -156,14 +156,16 @@ describe('txOut', () => {
156
156
} ) ;
157
157
158
158
it ( 'can map a set of transaction outputs with both output formats' , async ( ) => {
159
- const txOuts = mapTxOuts (
160
- [ txOutWithDatumHashAndOwnedAddress , txOutWithReferenceScriptAndDatumHash ] ,
161
- contextWithKnownAddresses
162
- ) ;
159
+ const legacyTxOuts = mapTxOuts ( [ txOutWithDatumHashAndOwnedAddress ] , contextWithKnownAddresses ) ;
163
160
164
- expect ( txOuts . length ) . toEqual ( 2 ) ;
161
+ const babbageTxOuts = mapTxOuts ( [ txOutWithReferenceScriptAndDatumHash ] , {
162
+ ...contextWithKnownAddresses ,
163
+ useBabbageOutputs : true
164
+ } ) ;
165
165
166
- expect ( txOuts ) . toEqual ( [
166
+ expect ( legacyTxOuts . length ) . toEqual ( 1 ) ;
167
+
168
+ expect ( legacyTxOuts ) . toEqual ( [
167
169
{
168
170
addressParameters : {
169
171
addressType : Trezor . PROTO . CardanoAddressType . BASE ,
@@ -173,7 +175,12 @@ describe('txOut', () => {
173
175
amount : '10' ,
174
176
datumHash : '0f3abbc8fc19c2e61bab6059bf8a466e6e754833a08a62a6c56fe0e78f19d9d5' ,
175
177
format : Trezor . PROTO . CardanoTxOutputSerializationFormat . ARRAY_LEGACY
176
- } ,
178
+ }
179
+ ] ) ;
180
+
181
+ expect ( babbageTxOuts . length ) . toEqual ( 1 ) ;
182
+
183
+ expect ( babbageTxOuts ) . toEqual ( [
177
184
{
178
185
addressParameters : {
179
186
addressType : Trezor . PROTO . CardanoAddressType . BASE ,
@@ -332,7 +339,7 @@ describe('txOut', () => {
332
339
} ) ;
333
340
334
341
it ( 'can map simple transaction with inline datum' , async ( ) => {
335
- const out = toTxOut ( txOutWithInlineDatum , contextWithKnownAddresses ) ;
342
+ const out = toTxOut ( txOutWithInlineDatum , { ... contextWithKnownAddresses , useBabbageOutputs : true } ) ;
336
343
337
344
expect ( out ) . toEqual ( {
338
345
address :
@@ -344,7 +351,10 @@ describe('txOut', () => {
344
351
} ) ;
345
352
346
353
it ( 'can map simple transaction with inline datum to owned address' , async ( ) => {
347
- const out = toTxOut ( txOutWithInlineDatumAndOwnedAddress , contextWithKnownAddresses ) ;
354
+ const out = toTxOut ( txOutWithInlineDatumAndOwnedAddress , {
355
+ ...contextWithKnownAddresses ,
356
+ useBabbageOutputs : true
357
+ } ) ;
348
358
349
359
expect ( out ) . toEqual ( {
350
360
addressParameters : {
@@ -359,7 +369,10 @@ describe('txOut', () => {
359
369
} ) ;
360
370
361
371
it ( 'can map a simple transaction output with reference script and datum hash' , async ( ) => {
362
- const out = toTxOut ( txOutWithReferenceScriptAndDatumHash , contextWithKnownAddresses ) ;
372
+ const out = toTxOut ( txOutWithReferenceScriptAndDatumHash , {
373
+ ...contextWithKnownAddresses ,
374
+ useBabbageOutputs : true
375
+ } ) ;
363
376
expect ( out ) . toEqual ( {
364
377
addressParameters : {
365
378
addressType : Trezor . PROTO . CardanoAddressType . BASE ,
@@ -374,7 +387,10 @@ describe('txOut', () => {
374
387
} ) ;
375
388
376
389
it ( 'can map a simple transaction output with reference script and inline datum' , async ( ) => {
377
- const out = toTxOut ( txOutWithReferenceScriptAndInlineDatum , contextWithKnownAddresses ) ;
390
+ const out = toTxOut ( txOutWithReferenceScriptAndInlineDatum , {
391
+ ...contextWithKnownAddresses ,
392
+ useBabbageOutputs : true
393
+ } ) ;
378
394
expect ( out ) . toEqual ( {
379
395
addressParameters : {
380
396
addressType : Trezor . PROTO . CardanoAddressType . BASE ,
0 commit comments