From 39fddfc290ad4aa50a7d05f7b6dcf46ca361f135 Mon Sep 17 00:00:00 2001 From: mmontin Date: Wed, 31 Jul 2024 16:35:55 +0200 Subject: [PATCH] remove usellessly introduced helper --- src/Cooked/MockChain/Direct.hs | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/Cooked/MockChain/Direct.hs b/src/Cooked/MockChain/Direct.hs index ec98c56b..fb1a1f5f 100644 --- a/src/Cooked/MockChain/Direct.hs +++ b/src/Cooked/MockChain/Direct.hs @@ -310,22 +310,6 @@ getIndex = Cardano.TxOutDatumInline s sd -> Cardano.TxOutDatumInline s sd in Cardano.TxOut addr val dat refS -toIndex :: Map Api.TxOutRef Ledger.TxOut -> Either Ledger.ToCardanoError Ledger.UtxoIndex -toIndex innerMap = do - let (txOutRefL, txOutL) = unzip $ Map.toList innerMap - txInL <- forM txOutRefL Ledger.toCardanoTxIn - txOutL' <- forM (Ledger.getTxOut <$> txOutL) toCtxUTxOTxOut - return $ Cardano.UTxO $ Map.fromList $ zip txInL txOutL' - where - toCtxUTxOTxOut :: Cardano.TxOut Cardano.CtxTx era -> Either Ledger.ToCardanoError (Cardano.TxOut Cardano.CtxUTxO era) - toCtxUTxOTxOut (Cardano.TxOut addr val d refS) = do - dat <- case d of - Cardano.TxOutDatumNone -> return Cardano.TxOutDatumNone - Cardano.TxOutDatumInTx _ _ -> Left $ Ledger.TxBodyError "Wrong datum kind" - Cardano.TxOutDatumHash s h -> return $ Cardano.TxOutDatumHash s h - Cardano.TxOutDatumInline s sd -> return $ Cardano.TxOutDatumInline s sd - return $ Cardano.TxOut addr val dat refS - instance (Monad m) => MonadBlockChainBalancing (MockChainT m) where getParams = gets mcstParams validatorFromHash valHash = gets $ Map.lookup valHash . mcstValidators