@@ -156,14 +156,16 @@ describe('txOut', () => {
156156 } ) ;
157157
158158 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 ) ;
163160
164- expect ( txOuts . length ) . toEqual ( 2 ) ;
161+ const babbageTxOuts = mapTxOuts ( [ txOutWithReferenceScriptAndDatumHash ] , {
162+ ...contextWithKnownAddresses ,
163+ useBabbageOutputs : true
164+ } ) ;
165165
166- expect ( txOuts ) . toEqual ( [
166+ expect ( legacyTxOuts . length ) . toEqual ( 1 ) ;
167+
168+ expect ( legacyTxOuts ) . toEqual ( [
167169 {
168170 addressParameters : {
169171 addressType : Trezor . PROTO . CardanoAddressType . BASE ,
@@ -173,7 +175,12 @@ describe('txOut', () => {
173175 amount : '10' ,
174176 datumHash : '0f3abbc8fc19c2e61bab6059bf8a466e6e754833a08a62a6c56fe0e78f19d9d5' ,
175177 format : Trezor . PROTO . CardanoTxOutputSerializationFormat . ARRAY_LEGACY
176- } ,
178+ }
179+ ] ) ;
180+
181+ expect ( babbageTxOuts . length ) . toEqual ( 1 ) ;
182+
183+ expect ( babbageTxOuts ) . toEqual ( [
177184 {
178185 addressParameters : {
179186 addressType : Trezor . PROTO . CardanoAddressType . BASE ,
@@ -332,7 +339,7 @@ describe('txOut', () => {
332339 } ) ;
333340
334341 it ( 'can map simple transaction with inline datum' , async ( ) => {
335- const out = toTxOut ( txOutWithInlineDatum , contextWithKnownAddresses ) ;
342+ const out = toTxOut ( txOutWithInlineDatum , { ... contextWithKnownAddresses , useBabbageOutputs : true } ) ;
336343
337344 expect ( out ) . toEqual ( {
338345 address :
@@ -344,7 +351,10 @@ describe('txOut', () => {
344351 } ) ;
345352
346353 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+ } ) ;
348358
349359 expect ( out ) . toEqual ( {
350360 addressParameters : {
@@ -359,7 +369,10 @@ describe('txOut', () => {
359369 } ) ;
360370
361371 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+ } ) ;
363376 expect ( out ) . toEqual ( {
364377 addressParameters : {
365378 addressType : Trezor . PROTO . CardanoAddressType . BASE ,
@@ -374,7 +387,10 @@ describe('txOut', () => {
374387 } ) ;
375388
376389 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+ } ) ;
378394 expect ( out ) . toEqual ( {
379395 addressParameters : {
380396 addressType : Trezor . PROTO . CardanoAddressType . BASE ,
0 commit comments