Skip to content

Commit f5e7854

Browse files
committed
Change acceptedByCC to accept in case threshold is nothing
1 parent 3f4100e commit f5e7854

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/Ledger/Conway/Specification/Ratify.lagda.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,8 @@ module AcceptedByCC (currentEpoch : Epoch)
363363
acceptedStake = ∑[ x ← stakeDistr ∣ actualVotes ⁻¹ Vote.yes ] x
364364
totalStake = ∑[ x ← stakeDistr ∣ dom (actualVotes ∣^ (❴ Vote.yes ❵ ∪ ❴ Vote.no ❵)) ] x
365365
366-
accepted = (acceptedStake /₀ totalStake) ≥ t
367-
× (sizeActiveCC ≥ ccMinSize ⊎ (Is-nothing mT × ccMinSize ≡ 0))
366+
accepted = Is-just mT → (acceptedStake /₀ totalStake) ≥ t
367+
× (sizeActiveCC ≥ ccMinSize)
368368
```
369369

370370
```agda
@@ -667,8 +667,12 @@ opaque
667667
Is-nothing? {x = x} = All.dec (const $ no id) x
668668
where import Data.Maybe.Relation.Unary.All as All
669669
670+
Is-just? : ∀ {A : Set} {x : Maybe A} → Dec (Is-just x)
671+
Is-just? {x = x} = Any.dec (const $ yes tt) x
672+
where import Data.Maybe.Relation.Unary.Any as Any
673+
670674
acceptedByCC? : ∀ Γ es st → Dec (acceptedByCC Γ es st)
671-
acceptedByCC? _ _ _ = _ ℚ.≤? _ ×-dec (_ ≥? _ ⊎-dec (Is-nothing? ×-dec ¿ _ ¿))
675+
acceptedByCC? _ _ _ = Is-just? →-dec (_ ℚ.≤? _ ×-dec (_ ≥? _))
672676
673677
acceptedByDRep? : ∀ Γ es st → Dec (acceptedByDRep Γ es st)
674678
acceptedByDRep? _ _ _ = _ ℚ.≤? _

0 commit comments

Comments
 (0)