@@ -37,6 +37,7 @@ import Control.Monad.Trans.Control (MonadBaseControl)
3737import Control.Monad.Trans.Reader (ReaderT )
3838import Data.ByteString (ByteString )
3939import qualified Data.ByteString.Short as SBS
40+ import Data.Either.Extra (mapLeft )
4041import Data.Foldable (toList )
4142import Data.Int (Int64 )
4243import Data.Map (Map )
@@ -108,7 +109,7 @@ getWrongPlutusData tracer = do
108109 (fmap f . DB_V_13_0. querydatumInfo . entityKey)
109110 (DB_V_13_0. datumHash . entityVal)
110111 (Just . getDatumBytes)
111- (hashPlutusData . getDatumBytes)
112+ (mapLeft Just . hashPlutusData . getDatumBytes)
112113 redeemerDataList <-
113114 findWrongPlutusData
114115 tracer
@@ -118,7 +119,7 @@ getWrongPlutusData tracer = do
118119 (fmap f . DB_V_13_0. queryRedeemerDataInfo . entityKey)
119120 (DB_V_13_0. redeemerDataHash . entityVal)
120121 (Just . getRedeemerDataBytes)
121- (hashPlutusData . getRedeemerDataBytes)
122+ (mapLeft Just . hashPlutusData . getRedeemerDataBytes)
122123 pure $ FixData datumList redeemerDataList
123124 where
124125 f queryRes = do
@@ -144,7 +145,7 @@ findWrongPlutusData ::
144145 (a -> m (Maybe CardanoPoint )) -> -- get previous block point
145146 (a -> ByteString ) -> -- get the hash
146147 (a -> Maybe ByteString ) -> -- get the stored bytes
147- (a -> Either String ByteString ) -> -- hash the stored bytes
148+ (a -> Either ( Maybe String ) ByteString ) -> -- hash the stored bytes
148149 m [FixPlutusInfo ]
149150findWrongPlutusData tracer tableName qCount qPage qGetInfo getHash getBytes hashBytes = do
150151 liftIO $
@@ -197,7 +198,8 @@ findWrongPlutusData tracer tableName qCount qPage qGetInfo getHash getBytes hash
197198
198199 checkValidBytes :: a -> m Bool
199200 checkValidBytes a = case hashBytes a of
200- Left msg -> do
201+ Left Nothing -> pure True
202+ Left (Just msg) -> do
201203 liftIO $
202204 logWarning tracer $
203205 Text. concat [" Invalid Binary Data for hash " , textShow actualHash, " : " , Text. pack msg]
0 commit comments