File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
ouroboros-consensus/test/storage-test/Test/Ouroboros/Storage/PerasCertDB Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -94,12 +94,27 @@ instance StateModel Model where
94
94
action ->
95
95
model. open && case action of
96
96
CloseDB -> True
97
- -- Do not add equivocating certificates.
98
97
AddCert cert -> all p model. certs
99
98
where
100
- p cert' = perasCertRound cert /= perasCertRound cert' || cert == cert'
99
+ p cert' = roundNoDeterminesCert && uniqueSlotNos
100
+ where
101
+ -- Do not add an equivocating certificate.
102
+ roundNoDeterminesCert =
103
+ perasCertRound cert == perasCertRound cert' =>> cert == cert'
104
+ -- Do not add a certificate boosting a block in a slot in which we
105
+ -- have already boosted another block.
106
+ uniqueSlotNos =
107
+ pointSlot boostPt == pointSlot boostPt' =>> boostPt == boostPt'
108
+ where
109
+ boostPt = perasCertBoostedBlock cert
110
+ boostPt' = perasCertBoostedBlock cert'
101
111
GetWeightSnapshot -> True
102
112
GarbageCollect _slot -> True
113
+ where
114
+ -- Logical implication
115
+ (=>>) :: Bool -> Bool -> Bool
116
+ a =>> b = not a || b
117
+ infixr 1 =>>
103
118
104
119
deriving stock instance Show (Action Model a )
105
120
deriving stock instance Eq (Action Model a )
You can’t perform that action at this time.
0 commit comments