@@ -21,7 +21,7 @@ module Cardano.Tracing.OrphanInstances.Consensus () where
21
21
22
22
import Cardano.Node.Tracing.Tracers.ConsensusStartupException
23
23
(ConsensusStartupException (.. ))
24
- import Cardano.Prelude (maximumDef )
24
+ import Cardano.Prelude (Typeable , maximumDef )
25
25
import Cardano.Slotting.Slot (fromWithOrigin )
26
26
import Cardano.Tracing.OrphanInstances.Common
27
27
import Cardano.Tracing.OrphanInstances.Network ()
@@ -74,8 +74,8 @@ import Ouroboros.Consensus.Util.Condense
74
74
import Ouroboros.Consensus.Util.Enclose
75
75
import Ouroboros.Consensus.Util.Orphans ()
76
76
import qualified Ouroboros.Network.AnchoredFragment as AF
77
- import Ouroboros.Network.Block (BlockNo (.. ), ChainUpdate (.. ), MaxSlotNo ( .. ), SlotNo (.. ), StandardHash ,
78
- Tip (.. ), blockHash , pointSlot , tipFromHeader )
77
+ import Ouroboros.Network.Block (BlockNo (.. ), ChainUpdate (.. ), MaxSlotNo (.. ),
78
+ SlotNo ( .. ), StandardHash , Tip (.. ), blockHash , pointSlot , tipFromHeader )
79
79
import Ouroboros.Network.BlockFetch.ClientState (TraceLabelPeer (.. ))
80
80
import Ouroboros.Network.Point (withOrigin )
81
81
import Ouroboros.Network.SizeInBytes (SizeInBytes (.. ))
@@ -133,6 +133,12 @@ instance ConvertRawHash blk => ConvertRawHash (Header blk) where
133
133
hashSize :: proxy (Header blk ) -> Word32
134
134
hashSize _ = hashSize (Proxy @ blk )
135
135
136
+ instance ConvertRawHash blk => ConvertRawHash (HeaderWithTime blk ) where
137
+ toShortRawHash _ = toShortRawHash (Proxy @ blk )
138
+ fromShortRawHash _ = fromShortRawHash (Proxy @ blk )
139
+ hashSize :: proxy (HeaderWithTime blk ) -> Word32
140
+ hashSize _ = hashSize (Proxy @ blk )
141
+
136
142
--
137
143
-- * instances of @HasPrivacyAnnotation@ and @HasSeverityAnnotation@
138
144
--
@@ -1779,10 +1785,10 @@ instance ToObject selection => ToObject (TraceGsmEvent selection) where
1779
1785
instance HasPrivacyAnnotation (TraceGDDEvent peer blk ) where
1780
1786
instance HasSeverityAnnotation (TraceGDDEvent peer blk ) where
1781
1787
getSeverityAnnotation _ = Debug
1782
- instance (ToObject peer , ConvertRawHash blk , GetHeader blk ) => Transformable Text IO (TraceGDDEvent peer blk ) where
1788
+ instance (Typeable blk , ToObject peer , ConvertRawHash blk , GetHeader blk ) => Transformable Text IO (TraceGDDEvent peer blk ) where
1783
1789
trTransformer = trStructured
1784
1790
1785
- instance (ToObject peer , ConvertRawHash blk , GetHeader blk ) => ToObject (TraceGDDEvent peer blk ) where
1791
+ instance (Typeable blk , ToObject peer , ConvertRawHash blk , GetHeader blk ) => ToObject (TraceGDDEvent peer blk ) where
1786
1792
toObject verb (TraceGDDDebug (GDDDebugInfo {.. })) = mconcat $
1787
1793
[ " kind" .= String " TraceGDDEvent"
1788
1794
, " losingPeers" .= toJSON (map (toObject verb) losingPeers)
@@ -1828,7 +1834,7 @@ instance (ToObject peer, ConvertRawHash blk, GetHeader blk) => ToObject (TraceGD
1828
1834
, " peer" .= toJSON (map (toObject verb) $ toList peer)
1829
1835
]
1830
1836
1831
- instance (ConvertRawHash blk , GetHeader blk ) => ToObject (DensityBounds blk ) where
1837
+ instance (Typeable blk , ConvertRawHash blk , GetHeader blk ) => ToObject (DensityBounds blk ) where
1832
1838
toObject verb DensityBounds {.. } = mconcat
1833
1839
[ " kind" .= String " DensityBounds"
1834
1840
, " clippedFragment" .= toObject verb clippedFragment
0 commit comments