@@ -35,6 +35,7 @@ module BotPlutusInterface.Effects (
3535 calcMinUtxo ,
3636) where
3737
38+ import BotPlutusInterface.CardanoAPI qualified as BPI.CApi
3839import BotPlutusInterface.CardanoNode.Effects (NodeQuery , runNodeQuery )
3940import BotPlutusInterface.ChainIndex (handleChainIndexReq )
4041import BotPlutusInterface.Collateral (withCollateralHandling )
@@ -86,8 +87,6 @@ import Data.Text (Text)
8687import Data.Text qualified as Text
8788import Ledger qualified
8889import Ledger.Ada qualified as Ada
89- import Ledger.Tx (TxOut (TxOut ))
90- import Ledger.Tx.CardanoAPI (toCardanoAddressInEra , toCardanoValue )
9190import Ledger.Tx.CardanoAPI qualified as TxApi
9291import Ledger.Validation (Coin (Coin ))
9392import Plutus.Contract.Effects (ChainIndexQuery , ChainIndexResponse )
@@ -296,7 +295,7 @@ calcMinUtxo pabconf txout = do
296295
297296 ctxout <-
298297 mapLeft (Text. pack . show ) $
299- toCardanoTxOutPossibleZeroAda netId TxApi. toCardanoTxOutDatumHash txout
298+ BPI.CApi. toCardanoTxOut' netId TxApi. toCardanoTxOutDatumHash txout
300299
301300 let (Coin minTxOut) =
302301 evaluateMinLovelaceOutput pparamsInEra $
@@ -307,17 +306,6 @@ calcMinUtxo pabconf txout = do
307306 if missingLovelace > 0
308307 then calcMinUtxo pabconf (txout {Ledger. txOutValue = Ledger. txOutValue txout <> Ada. toValue missingLovelace})
309308 else return txout
310- where
311- -- We need to redefine this to remove error reporting with 0 ada outputs.
312- toCardanoTxOutValuePossibleZeroAda value = do
313- -- when (Ada.fromValue value == mempty) (Left OutputHasZeroAda)
314- CApi. TxOutValue CApi. MultiAssetInBabbageEra <$> toCardanoValue value
315-
316- toCardanoTxOutPossibleZeroAda networkId fromHash (TxOut addr value datumHash) =
317- CApi. TxOut <$> toCardanoAddressInEra networkId addr
318- <*> toCardanoTxOutValuePossibleZeroAda value
319- <*> fromHash datumHash
320- <*> pure CApi.S. ReferenceScriptNone
321309
322310-- Couldn't use the template haskell makeEffect here, because it caused an OverlappingInstances problem.
323311-- For some reason, we need to manually propagate the @w@ type variable to @send@
0 commit comments