Skip to content

Commit

Permalink
Avoid import and increase readability
Browse files Browse the repository at this point in the history
  • Loading branch information
NadiaYvette committed Jun 5, 2023
1 parent 7b86d68 commit 5a7759b
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions bench/tx-generator/src/Cardano/TxGenerator/PureExample.hs
Expand Up @@ -7,7 +7,6 @@ module Cardano.TxGenerator.PureExample
(demo)
where

import Control.Arrow ((|||))
import Control.Monad (foldM)
import Control.Monad.Trans.Except
import Control.Monad.Trans.State.Strict
Expand Down Expand Up @@ -97,14 +96,15 @@ generateTx ::
TxEnvironment BabbageEra
-> Generator (Either TxGenError (Tx BabbageEra))
generateTx TxEnvironment{..} = do
consumeInputFunds
>>= (pure . Left) ||| \funds -> runExceptT
$ sourceToStoreTransaction
generator
funds
computeOutputValues
(makeToUTxOList $ repeat computeUTxO)
addNewOutputFunds
funds' <- consumeInputFunds
case funds' of
Left err -> pure $ Left err
Right funds -> runExceptT $ sourceToStoreTransaction
generator
funds
computeOutputValues
(makeToUTxOList $ repeat computeUTxO)
addNewOutputFunds
where
TxFeeExplicit _ fee = txEnvFee

Expand Down

0 comments on commit 5a7759b

Please sign in to comment.