@@ -81,7 +81,6 @@ import Ctl.Internal.ProcessConstraints.Error
8181 , CannotMintZero
8282 , ExpectedPlutusScriptGotNativeScript
8383 , CannotFindDatum
84- , CannotQueryDatum
8584 , CannotGetValidatorHashFromAddress
8685 , TxOutRefWrongType
8786 , CannotConvertPOSIXTimeRange
@@ -173,7 +172,7 @@ import Ctl.Internal.Types.Val as Val
173172import Data.Array (cons , partition , toUnfoldable , zip )
174173import Data.Array (mapMaybe , singleton , (:)) as Array
175174import Data.Bifunctor (lmap )
176- import Data.Either (Either (Left, Right), either , hush , isRight , note )
175+ import Data.Either (Either (Left, Right), either , note )
177176import Data.Foldable (foldM )
178177import Data.Lens ((%=), (%~), (.=), (.~), (<>=))
179178import Data.Lens.Getter (to , use )
@@ -192,7 +191,6 @@ import Effect.Aff.Class (liftAff)
192191import Effect.Class (liftEffect )
193192import Effect.Exception (throw )
194193import Partial.Unsafe (unsafePartial )
195- import Prelude (join ) as Bind
196194
197195-- The constraints don't precisely match those of Plutus:
198196-- `forall v. (FromData (DatumType v), ToData (DatumType v), ToData (RedeemerType v))`
@@ -548,15 +546,7 @@ processConstraint
548546 -- Use the datum hash inside the lookup
549547 case datum' of
550548 Just (OutputDatumHash dHash) -> do
551- dat <- ExceptT do
552- mDatumLookup <- lookupDatum dHash
553- if isRight mDatumLookup then
554- pure mDatumLookup
555- else
556- liftAff $ queryHandle.getDatumByHash dHash <#> hush
557- >>> Bind .join
558- >>> note
559- (CannotQueryDatum dHash)
549+ dat <- ExceptT $ lookupDatum dHash
560550 lift $ addDatum dat
561551 Just (OutputDatum _) -> pure unit
562552 Nothing -> throwError CannotFindDatum
0 commit comments