@@ -35,6 +35,7 @@ module BotPlutusInterface.Effects (
35
35
calcMinUtxo ,
36
36
) where
37
37
38
+ import BotPlutusInterface.CardanoAPI qualified as BPI.CApi
38
39
import BotPlutusInterface.CardanoNode.Effects (NodeQuery , runNodeQuery )
39
40
import BotPlutusInterface.ChainIndex (handleChainIndexReq )
40
41
import BotPlutusInterface.Collateral (withCollateralHandling )
@@ -86,8 +87,6 @@ import Data.Text (Text)
86
87
import Data.Text qualified as Text
87
88
import Ledger qualified
88
89
import Ledger.Ada qualified as Ada
89
- import Ledger.Tx (TxOut (TxOut ))
90
- import Ledger.Tx.CardanoAPI (toCardanoAddressInEra , toCardanoValue )
91
90
import Ledger.Tx.CardanoAPI qualified as TxApi
92
91
import Ledger.Validation (Coin (Coin ))
93
92
import Plutus.Contract.Effects (ChainIndexQuery , ChainIndexResponse )
@@ -296,7 +295,7 @@ calcMinUtxo pabconf txout = do
296
295
297
296
ctxout <-
298
297
mapLeft (Text. pack . show ) $
299
- toCardanoTxOutPossibleZeroAda netId TxApi. toCardanoTxOutDatumHash txout
298
+ BPI.CApi. toCardanoTxOut' netId TxApi. toCardanoTxOutDatumHash txout
300
299
301
300
let (Coin minTxOut) =
302
301
evaluateMinLovelaceOutput pparamsInEra $
@@ -307,17 +306,6 @@ calcMinUtxo pabconf txout = do
307
306
if missingLovelace > 0
308
307
then calcMinUtxo pabconf (txout {Ledger. txOutValue = Ledger. txOutValue txout <> Ada. toValue missingLovelace})
309
308
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
321
309
322
310
-- Couldn't use the template haskell makeEffect here, because it caused an OverlappingInstances problem.
323
311
-- For some reason, we need to manually propagate the @w@ type variable to @send@
0 commit comments