@@ -1074,7 +1074,8 @@ fromAlonzoTxOutDatumHash _ SNothing = TxOutDatumNone
10741074fromAlonzoTxOutDatumHash w (SJust hash) = TxOutDatumHash w $ ScriptDataHash hash
10751075
10761076toBabbageTxOutDatum
1077- :: L. Era (ShelleyLedgerEra era )
1077+ :: HasCallStack
1078+ => L. Era (ShelleyLedgerEra era )
10781079 => TxOutDatum ctx era
10791080 -> Plutus. Datum (ShelleyLedgerEra era )
10801081toBabbageTxOutDatum TxOutDatumNone = Plutus. NoDatum
@@ -2590,7 +2591,7 @@ fromAlonzoTxOutDatum w txdatums = \case
25902591 SNothing -> TxOutDatumNone
25912592 SJust dh
25922593 | Just d <- Map. lookup dh txdatums ->
2593- TxOutSupplementalDatum w (fromAlonzoData d)
2594+ TxOutSupplementalDatum w (fromAlonzoData d) -- TODO
25942595 | otherwise -> TxOutDatumHash w (ScriptDataHash dh)
25952596
25962597fromBabbageTxOut
@@ -2952,6 +2953,7 @@ convScriptData
29522953 -> [TxOut CtxTx era ]
29532954 -> [(ScriptWitnessIndex , AnyScriptWitness era )]
29542955 -> TxBodyScriptData era
2956+ convScriptData _ _ _ = error " XX"
29552957convScriptData sbe txOuts scriptWitnesses =
29562958 caseShelleyToMaryOrAlonzoEraOnwards
29572959 (const TxBodyNoScriptData )
@@ -2993,7 +2995,7 @@ convScriptData sbe txOuts scriptWitnesses =
29932995 ) <-
29942996 scriptWitnesses
29952997 ]
2996- in TxBodyScriptData w datums redeemers
2998+ in TxBodyScriptData w datums redeemers -- TODO
29972999 )
29983000 sbe
29993001
@@ -3250,7 +3252,7 @@ makeShelleyTransactionBody
32503252 sbe
32513253 txbody
32523254 scripts
3253- (TxBodyScriptData AlonzoEraOnwardsAlonzo datums redeemers)
3255+ (TxBodyScriptData AlonzoEraOnwardsAlonzo datums redeemers) -- TODO
32543256 txAuxData
32553257 txScriptValidity
32563258 where
@@ -3367,7 +3369,7 @@ makeShelleyTransactionBody
33673369 sbe
33683370 txbody
33693371 scripts
3370- ( TxBodyScriptData
3372+ ( TxBodyScriptData -- TODO
33713373 AlonzoEraOnwardsBabbage
33723374 datums
33733375 redeemers
@@ -3507,7 +3509,7 @@ makeShelleyTransactionBody
35073509 sbe
35083510 txbody
35093511 scripts
3510- ( TxBodyScriptData
3512+ ( TxBodyScriptData -- TODO
35113513 AlonzoEraOnwardsConway
35123514 datums
35133515 redeemers
@@ -3868,11 +3870,18 @@ getSupplementalDatums eon [] = alonzoEraOnwardsConstraints eon mempty
38683870getSupplementalDatums eon txouts =
38693871 alonzoEraOnwardsConstraints eon $
38703872 L. TxDats $
3871- fromList
3873+ fromList $
38723874 [ (L. hashData ledgerData, ledgerData)
3873- | TxOut _ _ (TxOutSupplementalDatum _ d) _ <- txouts
3875+ | TxOut _ _ datum _ <- txouts
3876+ , Just d <- [getDatum datum]
38743877 , let ledgerData = toAlonzoData d
38753878 ]
3879+ where
3880+ getDatum = \ case
3881+ TxOutDatumNone -> Nothing
3882+ TxOutDatumHash _ _scriptHash -> Nothing -- TODO provide datum here to match with hash
3883+ TxOutSupplementalDatum _ d -> Just d
3884+ TxOutDatumInline _ d -> Just d
38763885
38773886collectTxBodyScriptWitnessRequirements
38783887 :: forall era
@@ -3889,7 +3898,7 @@ collectTxBodyScriptWitnessRequirements
38893898 } =
38903899 obtainAlonzoScriptPurposeConstraints aEon $ do
38913900 let sbe = shelleyBasedEra @ era
3892- supplementaldatums = TxScriptWitnessRequirements mempty mempty (getSupplementalDatums aEon txOuts) mempty
3901+ supplementaldatums = TxScriptWitnessRequirements mempty mempty (getSupplementalDatums aEon txOuts) mempty -- TODO
38933902 txInWits <-
38943903 first TxBodyPlutusScriptDecodeError $
38953904 legacyWitnessToScriptRequirements aEon $
0 commit comments