Skip to content

Commit

Permalink
remove usellessly introduced helper
Browse files Browse the repository at this point in the history
  • Loading branch information
mmontin committed Jul 31, 2024
1 parent 9f6281e commit 39fddfc
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions src/Cooked/MockChain/Direct.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 39fddfc

Please sign in to comment.