@@ -67,6 +67,8 @@ import Data.Void (absurd)
6767import Data.Word (Word64 )
6868import Numeric (showFFloat )
6969
70+ import LeiosDemoTypes (LeiosExtValidationError (.. ))
71+
7072-- {-# ANN module ("HLint: ignore Redundant bracket" :: Text) #-}
7173
7274-- A limiter that is not coming from configuration, because it carries a special filter
@@ -2865,18 +2867,54 @@ instance ( LogFormatting (LedgerError blk)
28652867 => LogFormatting (ExtValidationError blk ) where
28662868 forMachine dtal (ExtValidationErrorLedger err) = forMachine dtal err
28672869 forMachine dtal (ExtValidationErrorHeader err) = forMachine dtal err
2868- forMachine _ (ExtValidationErrorLeios msg) =
2869- mconcat [ " kind" .= String " ExtValidationErrorLeios"
2870- , " error" .= String (Text. pack msg)
2871- ]
2870+ forMachine dtal (ExtValidationErrorLeios err) = forMachine dtal err
28722871
28732872 forHuman (ExtValidationErrorLedger err) = forHuman err
28742873 forHuman (ExtValidationErrorHeader err) = forHuman err
2875- forHuman (ExtValidationErrorLeios msg ) = Text. pack msg
2874+ forHuman (ExtValidationErrorLeios err ) = forHuman err
28762875
28772876 asMetrics (ExtValidationErrorLedger err) = asMetrics err
28782877 asMetrics (ExtValidationErrorHeader err) = asMetrics err
2879- asMetrics (ExtValidationErrorLeios _) = []
2878+ asMetrics (ExtValidationErrorLeios err) = asMetrics err
2879+
2880+ instance LogFormatting LeiosExtValidationError where
2881+ forMachine _ (LeiosCertificateWithoutAnnouncement cert) =
2882+ mconcat [ " kind" .= String " LeiosCertificateWithoutAnnouncement"
2883+ , " certificate" .= String (Text. pack (show cert))
2884+ ]
2885+ forMachine _ (LeiosMissingCommittee point cert) =
2886+ mconcat [ " kind" .= String " LeiosMissingCommittee"
2887+ , " announcedEb" .= String (Text. pack (show point))
2888+ , " certificate" .= String (Text. pack (show cert))
2889+ ]
2890+ forMachine _ (LeiosCertificateAfterGenesis cert point) =
2891+ mconcat [ " kind" .= String " LeiosCertificateAfterGenesis"
2892+ , " certificate" .= String (Text. pack (show cert))
2893+ , " announcedEb" .= String (Text. pack (show point))
2894+ ]
2895+ forMachine _ (LeiosInvalidCertificate cert point rbHash verErr) =
2896+ mconcat [ " kind" .= String " LeiosInvalidCertificate"
2897+ , " certificate" .= String (Text. pack (show cert))
2898+ , " announcedEb" .= String (Text. pack (show point))
2899+ , " announcingRb" .= String (Text. pack (show rbHash))
2900+ , " verificationError" .= String (Text. pack (show verErr))
2901+ ]
2902+
2903+ forHuman (LeiosCertificateWithoutAnnouncement cert) =
2904+ " CertRB carries a Leios certificate but its predecessor announced no EB: "
2905+ <> Text. pack (show cert)
2906+ forHuman (LeiosMissingCommittee point cert) =
2907+ " CertRB for " <> Text. pack (show point)
2908+ <> " but there is no Leios committee to verify its certificate: " <> Text. pack (show cert)
2909+ forHuman (LeiosCertificateAfterGenesis cert point) =
2910+ " CertRB for " <> Text. pack (show point)
2911+ <> " has no announcing ranking block (would certify at genesis): " <> Text. pack (show cert)
2912+ forHuman (LeiosInvalidCertificate cert point rbHash verErr) =
2913+ " Invalid Leios certificate for " <> Text. pack (show point)
2914+ <> " announced by ranking block " <> Text. pack (show rbHash) <> " : " <> Text. pack (show verErr)
2915+ <> " (" <> Text. pack (show cert) <> " )"
2916+
2917+ asMetrics _ = []
28802918
28812919instance (Show (PBFT. PBftVerKeyHash c ))
28822920 => LogFormatting (PBFT. PBftValidationErr c ) where
0 commit comments