@@ -37,6 +37,7 @@ import Control.Monad.Trans.Control (MonadBaseControl)
37
37
import Control.Monad.Trans.Reader (ReaderT )
38
38
import Data.ByteString (ByteString )
39
39
import qualified Data.ByteString.Short as SBS
40
+ import Data.Either.Extra (mapLeft )
40
41
import Data.Foldable (toList )
41
42
import Data.Int (Int64 )
42
43
import Data.Map (Map )
@@ -108,7 +109,7 @@ getWrongPlutusData tracer = do
108
109
(fmap f . DB_V_13_0. querydatumInfo . entityKey)
109
110
(DB_V_13_0. datumHash . entityVal)
110
111
(Just . getDatumBytes)
111
- (hashPlutusData . getDatumBytes)
112
+ (mapLeft Just . hashPlutusData . getDatumBytes)
112
113
redeemerDataList <-
113
114
findWrongPlutusData
114
115
tracer
@@ -118,7 +119,7 @@ getWrongPlutusData tracer = do
118
119
(fmap f . DB_V_13_0. queryRedeemerDataInfo . entityKey)
119
120
(DB_V_13_0. redeemerDataHash . entityVal)
120
121
(Just . getRedeemerDataBytes)
121
- (hashPlutusData . getRedeemerDataBytes)
122
+ (mapLeft Just . hashPlutusData . getRedeemerDataBytes)
122
123
pure $ FixData datumList redeemerDataList
123
124
where
124
125
f queryRes = do
@@ -144,7 +145,7 @@ findWrongPlutusData ::
144
145
(a -> m (Maybe CardanoPoint )) -> -- get previous block point
145
146
(a -> ByteString ) -> -- get the hash
146
147
(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
148
149
m [FixPlutusInfo ]
149
150
findWrongPlutusData tracer tableName qCount qPage qGetInfo getHash getBytes hashBytes = do
150
151
liftIO $
@@ -197,7 +198,8 @@ findWrongPlutusData tracer tableName qCount qPage qGetInfo getHash getBytes hash
197
198
198
199
checkValidBytes :: a -> m Bool
199
200
checkValidBytes a = case hashBytes a of
200
- Left msg -> do
201
+ Left Nothing -> pure True
202
+ Left (Just msg) -> do
201
203
liftIO $
202
204
logWarning tracer $
203
205
Text. concat [" Invalid Binary Data for hash " , textShow actualHash, " : " , Text. pack msg]
0 commit comments