From 9d025e81a55fb0617a6e45049ccf0d4d35ceb9cc Mon Sep 17 00:00:00 2001 From: Mateusz Galazyn Date: Fri, 27 Oct 2023 16:08:53 +0200 Subject: [PATCH] #406 Enable use of inline datums in Babbage era transactions --- cardano-cli/src/Cardano/CLI/EraBased/Run/Transaction.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run/Transaction.hs b/cardano-cli/src/Cardano/CLI/EraBased/Run/Transaction.hs index 46a9042ab6..e4174ea24b 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/Transaction.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/Transaction.hs @@ -766,9 +766,11 @@ toTxOutInAnyEra era (TxOutAnyEra addr' val' mDatumHash refScriptFp) = do TxOutDatumByValue sDataOrFile -> do sData <- firstExceptT TxCmdScriptDataError $ readScriptDataOrFile sDataOrFile pure (TxOutDatumInTx supp sData) - TxOutInlineDatumByValue _ -> - txFeatureMismatch era TxFeatureInlineDatums - + TxOutInlineDatumByValue sDataOrFile -> do + let cEra = alonzoEraOnwardsToCardanoEra supp + babbageOnwards <- maybe (txFeatureMismatch cEra TxFeatureInlineDatums) pure $ forEraMaybeEon cEra + sData <- firstExceptT TxCmdScriptDataError $ readScriptDataOrFile sDataOrFile + pure $ TxOutDatumInline babbageOnwards sData -- TODO: Currently we specify the policyId with the '--mint' option on the cli -- and we added a separate '--policy-id' parser that parses the policy id for the