File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Protocol Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ module Ouroboros.Consensus.Protocol.Abstract
27
27
) where
28
28
29
29
import Control.Monad.Except
30
+ import Data.Function (on )
30
31
import Data.Kind (Type )
31
32
import Data.Proxy (Proxy )
32
33
import Data.Typeable (Typeable )
@@ -279,7 +280,12 @@ deriving stock instance Eq (TiebreakerView p) => Eq (SelectView p)
279
280
instance NoThunks (TiebreakerView p ) => NoThunks (SelectView p )
280
281
281
282
-- | First compare block numbers, then compare the 'TiebreakerView'.
282
- deriving stock instance Ord (TiebreakerView p ) => Ord (SelectView p )
283
+ instance Ord (TiebreakerView p ) => Ord (SelectView p ) where
284
+ compare =
285
+ mconcat
286
+ [ compare `on` svBlockNo
287
+ , compare `on` svTiebreakerView
288
+ ]
283
289
284
290
-- | @cand@ is preferred to @ours@ if either @cand@ is longer than @ours@, or
285
291
-- @cand@ and @ours@ are of equal length and we have
You can’t perform that action at this time.
0 commit comments