@@ -51,7 +51,7 @@ import Control.Monad.Trans.Either (EitherT, eitherT, firstEitherT, hoistEither,
5151import Control.Monad.Trans.Except (ExceptT , throwE )
5252import Data.Aeson (ToJSON , Value (Array , Bool , Null , Number , Object , String ))
5353import Data.Aeson.Extras (encodeByteString )
54- import Data.Either.Combinators (maybeToRight , swapEither )
54+ import Data.Either.Combinators (maybeToLeft , swapEither )
5555import Data.Function (fix )
5656import Data.HashMap.Strict qualified as HM
5757import Data.Kind (Type )
@@ -452,7 +452,7 @@ handleCollateral cEnv = do
452452 do
453453 collateralNotInMem <-
454454 newEitherT $
455- swapEither . maybeToRight " Collateral UTxO not found in contract env."
455+ maybeToLeft " Collateral UTxO not found in contract env."
456456 <$> getInMemCollateral @ w
457457
458458 helperLog collateralNotInMem
@@ -463,7 +463,7 @@ handleCollateral cEnv = do
463463 (" Collateral UTxO not found or failed to be found in wallet: " <> pretty collateralNotInWallet)
464464
465465 helperLog " Creating collateral UTxO."
466- --
466+
467467 notCreatedCollateral <- newEitherT $ swapEither <$> makeCollateral @ w cEnv
468468
469469 helperLog
@@ -520,12 +520,12 @@ findCollateralAtOwnPKH cEnv =
520520 changeAddr =
521521 Ledger. pubKeyHashAddress
522522 (PaymentPubKeyHash pabConf. pcOwnPubKeyHash)
523- ( pabConf. pcOwnStakePubKeyHash)
523+ pabConf. pcOwnStakePubKeyHash
524524
525525 r <- newEitherT $ CardanoCLI. utxosAt @ w pabConf changeAddr
526526 let refsAndOuts = Map. toList $ Tx. toTxOut <$> r
527527 hoistEither $ case filter check refsAndOuts of
528- [] -> Left " Couldn't find colalteral UTxO"
528+ [] -> Left " Couldn't find collateral UTxO"
529529 ((oref, _) : _) -> Right oref
530530 where
531531 check (_, txOut) = Tx. txOutValue txOut == collateralValue (cePABConfig cEnv)
0 commit comments