File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
cardano-db-sync/src/Cardano/DbSync Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ httpGetOffChainPoolData manager request purl expectedMetaHash = do
56
56
case unPoolMetaHash <$> expectedMetaHash of
57
57
Just expectedMetaHashBs
58
58
| metadataHash /= expectedMetaHashBs ->
59
- left $ OCFErrHashMismatch url (renderByteArray expectedMetaHashBs) (renderByteArray metadataHash)
59
+ left $ OCFErrHashMismatch ( Just url) (renderByteArray expectedMetaHashBs) (renderByteArray metadataHash)
60
60
_ -> pure ()
61
61
decodedMetadata <-
62
62
case Aeson. eitherDecode' respLBS of
@@ -105,8 +105,10 @@ parseAndValidateVoteData :: ByteString -> LBS.ByteString -> Maybe VoteMetaHash -
105
105
parseAndValidateVoteData bs lbs metaHash anchorType murl = do
106
106
let metadataHash = Crypto. digest (Proxy :: Proxy Crypto. Blake2b_256 ) bs
107
107
(hsh, mWarning) <- case unVoteMetaHash <$> metaHash of
108
- Nothing -> pure (metadataHash, Nothing )
109
- Just expectedMetaHash -> pure (expectedMetaHash, Just " Failed to validate metadata hash" ) -- TODO: Conway
108
+ Just expectedMetaHashBs
109
+ | metadataHash /= expectedMetaHashBs ->
110
+ left $ OCFErrHashMismatch murl (renderByteArray expectedMetaHashBs) (renderByteArray metadataHash)
111
+ _ -> pure (metadataHash, Nothing )
110
112
decodedValue <-
111
113
case Aeson. eitherDecode' @ Aeson. Value lbs of
112
114
Left err -> left $ OCFErrJsonDecodeFail murl (Text. pack err)
Original file line number Diff line number Diff line change @@ -220,7 +220,7 @@ showUrl =
220
220
-- OffChain Fetch error for the HTTP client fetching the pool offchain metadata.
221
221
-------------------------------------------------------------------------------------
222
222
data OffChainFetchError
223
- = OCFErrHashMismatch ! OffChainUrlType ! Text ! Text
223
+ = OCFErrHashMismatch ! ( Maybe OffChainUrlType ) ! Text ! Text
224
224
| OCFErrDataTooLong ! OffChainUrlType
225
225
| OCFErrUrlParseFail ! OffChainUrlType ! Text
226
226
| OCFErrJsonDecodeFail (Maybe OffChainUrlType ) ! Text
You can’t perform that action at this time.
0 commit comments