@@ -183,9 +183,18 @@ instance LogFormatting (Conway.ConwayDelegPredFailure era) where
183183 , " credential" .= String (textShow credential)
184184 , " error" .= String " Delegated rep is not registered for provided stake key"
185185 ]
186- -- TODO: fix
187- Conway. DepositIncorrectDELEG _ -> undefined
188- Conway. RefundIncorrectDELEG _ -> undefined
186+ Conway. DepositIncorrectDELEG Mismatch {mismatchSupplied, mismatchExpected} ->
187+ [ " kind" .= String " DepositIncorrectDELEG"
188+ , " givenRefund" .= mismatchSupplied
189+ , " expectedRefund" .= mismatchExpected
190+ , " error" .= String " Deposit mismatch"
191+ ]
192+ Conway. RefundIncorrectDELEG Mismatch {mismatchSupplied, mismatchExpected} ->
193+ [ " kind" .= String " RefundIncorrectDELEG"
194+ , " givenRefund" .= mismatchSupplied
195+ , " expectedRefund" .= mismatchExpected
196+ , " error" .= String " Refund mismatch"
197+ ]
189198
190199instance
191200 ( ShelleyCompatible protocol era
@@ -380,8 +389,16 @@ instance
380389 ]
381390 )
382391 (Api. shelleyBasedEra :: Api. ShelleyBasedEra era )
383- -- TODO: fix
384- forMachine _ (ScriptIntegrityHashMismatch _ _) = undefined
392+ forMachine _ (ScriptIntegrityHashMismatch Mismatch {mismatchSupplied, mismatchExpected} mBytes) =
393+ mconcat [ " kind" .= String " ScriptIntegrityHashMismatch"
394+ , " supplied" .= renderScriptIntegrityHash (strictMaybeToMaybe mismatchSupplied)
395+ , " expected" .= renderScriptIntegrityHash (strictMaybeToMaybe mismatchExpected)
396+ , " hashHexPreimage" .= formatAsHex (strictMaybeToMaybe mBytes)
397+ ]
398+
399+ formatAsHex :: Maybe Crypto. ByteString -> String
400+ formatAsHex Nothing = " "
401+ formatAsHex (Just bs) = show bs
385402
386403instance
387404 ( Consensus. ShelleyBasedEra era
@@ -718,8 +735,12 @@ instance LogFormatting (ShelleyPoolPredFailure era) where
718735 , " poolId" .= String (textShow poolId)
719736 , " error" .= String " Wrong network ID in pool registration certificate"
720737 ]
721- -- TODO: fix
722- forMachine _dtal (VRFKeyHashAlreadyRegistered _ _) = undefined
738+ forMachine _dtal (VRFKeyHashAlreadyRegistered poolId vrfKeyHash) =
739+ mconcat [ " kind" .= String " VRFKeyHashAlreadyRegistered"
740+ , " poolId" .= String (textShow poolId)
741+ , " vrfKeyHash" .= String (textShow vrfKeyHash)
742+ , " error" .= String " Pool with the same VRF Key Hash is already registered"
743+ ]
723744
724745
725746instance LogFormatting TicknPredicateFailure where
@@ -1024,8 +1045,12 @@ instance
10241045 mconcat [ " kind" .= String " MalformedReferenceScripts"
10251046 , " scripts" .= s
10261047 ]
1027- -- TODO: fix
1028- Babbage. ScriptIntegrityHashMismatch _ _ -> undefined
1048+ Babbage. ScriptIntegrityHashMismatch Mismatch {mismatchSupplied, mismatchExpected} mBytes ->
1049+ mconcat [ " kind" .= String " ScriptIntegrityHashMismatch"
1050+ , " supplied" .= renderScriptIntegrityHash (strictMaybeToMaybe mismatchSupplied)
1051+ , " expected" .= renderScriptIntegrityHash (strictMaybeToMaybe mismatchExpected)
1052+ , " hashHexPreimage" .= formatAsHex (strictMaybeToMaybe mBytes)
1053+ ]
10291054--------------------------------------------------------------------------------
10301055-- Conway related
10311056--------------------------------------------------------------------------------
@@ -1475,8 +1500,12 @@ instance
14751500 mconcat [ " kind" .= String " MalformedReferenceScripts"
14761501 , " scripts" .= scripts
14771502 ]
1478- -- TODO: fix
1479- Conway. ScriptIntegrityHashMismatch _ _ -> undefined
1503+ Conway. ScriptIntegrityHashMismatch Mismatch {mismatchSupplied, mismatchExpected} mBytes ->
1504+ mconcat [ " kind" .= String " ScriptIntegrityHashMismatch"
1505+ , " supplied" .= renderScriptIntegrityHash (strictMaybeToMaybe mismatchSupplied)
1506+ , " expected" .= renderScriptIntegrityHash (strictMaybeToMaybe mismatchExpected)
1507+ , " hashHexPreimage" .= formatAsHex (strictMaybeToMaybe mBytes)
1508+ ]
14801509
14811510instance LogFormatting (Praos. PraosTiebreakerView crypto ) where
14821511 forMachine _dtal (Praos. PraosTiebreakerView sl issuer issueNo vrf) =
0 commit comments