Skip to content

Commit f90198c

Browse files
committed
Use genErrors whenever possible
1 parent 2935c60 commit f90198c

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

docs/agda-spec/src/Spec/ChainHead/Properties.agda

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ module Spec.ChainHead.Properties
1919
(rs : _) (open RationalExtStructure rs)
2020
where
2121

22+
open import Tactic.GenError
2223
open import Ledger.Prelude
2324
open import Ledger.PParams crypto es ss using (PParams; ProtVer)
2425
open import Spec.TickForecast crypto es ss li
@@ -75,7 +76,7 @@ instance
7576

7677
computeProof : ComputationResult String (∃[ s′ ] nes ⊢ s ⇀⦇ bh ,CHAINHEAD⦈ s′)
7778
computeProof = case ¿ prtlSeqChecks ¿² lab bh of λ where
78-
(no _) failure "Failed in CHAINHEAD"
79+
(no ¬psc) failure (genErrors ¬psc)
7980
(yes psc) do
8081
(forecast , tickfStep) computeTICKF _ nes slot
8182
let
@@ -84,7 +85,7 @@ instance
8485
pp = getPParams forecast; open PParams
8586
pd = getPoolDistr forecast
8687
case chainChecks? MaxMajorPV (pp .maxHeaderSize , pp .maxBlockSize , pp .pv) bh of λ where
87-
(no _) failure "Failed in CHAINHEAD"
88+
(no ¬cc) failure (genErrors ¬cc)
8889
(yes cc) do
8990
(⟦ η₀′ , _ ⟧ᵗˢ , ticknStep) computeTICKN ticknΓ ticknSt ne
9091
(_ , prtclStep) computePRTCL ⟦ pd , η₀′ ⟧ᵖᵉ prtclSt bh

docs/agda-spec/src/Spec/Protocol/Properties.agda

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ module Spec.Protocol.Properties
1919

2020
open import Data.Rational as ℚ using (1ℚ)
2121
open import Ledger.Prelude
22+
open import Tactic.GenError
2223
open import Spec.Protocol crypto nonces es ss bs af rs
2324
open import Spec.BaseTypes crypto using (OCertCounters)
2425
open import Spec.UpdateNonce crypto nonces es
@@ -88,7 +89,7 @@ instance
8889
(_ , updnStep) computeUPDN updnΓ updnSt slot
8990
(_ , ocertStep) computeOCERT ocertΓ cs bh
9091
success (-, Evolve-Prtcl (updnStep , ocertStep , prf))
91-
(no _) failure "Failed in PRTCL"
92+
(no ¬prf) failure (genErrors ¬prf)
9293

9394
completeness : s′ Γ ⊢ s ⇀⦇ bh ,PRTCL⦈ s′ (proj₁ <$> computeProof) ≡ success s′
9495
completeness _ (Evolve-Prtcl (updnStep , ocertStep , p))

0 commit comments

Comments
 (0)