From ba4f707861855cbc622f118a4c2496fcea51e196 Mon Sep 17 00:00:00 2001 From: Pawel Jakubas Date: Fri, 11 Aug 2023 16:02:40 +0200 Subject: [PATCH] conclude toCardanoTxOut --- .../Cardano/Wallet/Shelley/Compatibility.hs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/lib/wallet/src/Cardano/Wallet/Shelley/Compatibility.hs b/lib/wallet/src/Cardano/Wallet/Shelley/Compatibility.hs index e9ea5edeee9..d4d6d4f58ed 100644 --- a/lib/wallet/src/Cardano/Wallet/Shelley/Compatibility.hs +++ b/lib/wallet/src/Cardano/Wallet/Shelley/Compatibility.hs @@ -1474,7 +1474,14 @@ toCardanoTxOut era refScriptM = case era of datumHash refScript where - refScript = Cardano.ReferenceScriptNone + refScript = case refScriptM of + Nothing -> + Cardano.ReferenceScriptNone + Just script -> + let aux = Cardano.ReferenceTxInsScriptsInlineDatumsInBabbageEra + scriptApi = Cardano.toScriptInAnyLang $ Cardano.SimpleScript $ + toCardanoSimpleScript script + in Cardano.ReferenceScript aux scriptApi datumHash = Cardano.TxOutDatumNone addrInEra = tina "toCardanoTxOut: malformed address" [ Cardano.AddressInEra @@ -1495,7 +1502,14 @@ toCardanoTxOut era refScriptM = case era of datumHash refScript where - refScript = Cardano.ReferenceScriptNone + refScript = case refScriptM of + Nothing -> + Cardano.ReferenceScriptNone + Just script -> + let aux = Cardano.ReferenceTxInsScriptsInlineDatumsInConwayEra + scriptApi = Cardano.toScriptInAnyLang $ Cardano.SimpleScript $ + toCardanoSimpleScript script + in Cardano.ReferenceScript aux scriptApi datumHash = Cardano.TxOutDatumNone addrInEra = tina "toCardanoTxOut: malformed address" [ Cardano.AddressInEra