File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -23,12 +23,11 @@ import NoThunks.Class
23
23
import Ouroboros.Consensus.Block.Abstract
24
24
25
25
newtype PerasRoundNo = PerasRoundNo { unPerasRoundNo :: Word64 }
26
- deriving stock Show
27
- deriving Generic
26
+ deriving stock (Show , Generic )
28
27
deriving newtype (Eq , Ord , NoThunks )
29
28
30
29
newtype PerasWeight = PerasWeight { unPerasWeight :: Word64 }
31
- deriving stock Show
30
+ deriving stock ( Show , Generic )
32
31
deriving newtype (Eq , Ord , NoThunks )
33
32
deriving (Semigroup , Monoid ) via Sum Word64
34
33
Original file line number Diff line number Diff line change 3
3
{-# LANGUAGE DerivingVia #-}
4
4
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
5
5
{-# LANGUAGE ScopedTypeVariables #-}
6
+ {-# LANGUAGE TypeOperators #-}
6
7
7
8
module Ouroboros.Consensus.Peras.Weight
8
9
( PerasWeightSnapshot (.. )
@@ -33,13 +34,13 @@ boostedWeightForPoint (PerasWeightSnapshot weightByPoint) pt =
33
34
Map. findWithDefault mempty pt weightByPoint
34
35
35
36
boostedWeightForFragment ::
36
- forall blk .
37
- HasHeader blk =>
37
+ forall blk h .
38
+ ( HasHeader blk , HasHeader h , HeaderHash blk ~ HeaderHash h ) =>
38
39
PerasWeightSnapshot blk ->
39
- AnchoredFragment blk ->
40
+ AnchoredFragment h ->
40
41
PerasWeight
41
42
boostedWeightForFragment weightSnap frag =
42
43
-- TODO think about whether this could be done in sublinear complexity
43
44
foldMap
44
45
(boostedWeightForPoint weightSnap)
45
- (blockPoint <$> AF. toOldestFirst frag)
46
+ (castPoint . blockPoint <$> AF. toOldestFirst frag)
You can’t perform that action at this time.
0 commit comments