Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use genErrors whenever possible
  • Loading branch information
javierdiaz72 committed Oct 7, 2024
commit 90934a8720b30990db97517a200ba4f174815e0c
5 changes: 3 additions & 2 deletions docs/agda-spec/src/Spec/ChainHead/Properties.agda
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ module Spec.ChainHead.Properties
(rs : _) (open RationalExtStructure rs)
where

open import Tactic.GenError
open import Ledger.Prelude
open import Ledger.PParams crypto es ss using (PParams; ProtVer)
open import Spec.TickForecast crypto es ss li
Expand Down Expand Up @@ -75,7 +76,7 @@ instance

computeProof : ComputationResult String (∃[ s′ ] nes ⊢ s ⇀⦇ bh ,CHAINHEAD⦈ s′)
computeProof = case ¿ prtlSeqChecks ¿² lab bh of λ where
(no _) → failure "Failed in CHAINHEAD"
(no ¬psc) → failure (genErrors ¬psc)
(yes psc) → do
(forecast , tickfStep) ← computeTICKF _ nes slot
let
Expand All @@ -84,7 +85,7 @@ instance
pp = getPParams forecast; open PParams
pd = getPoolDistr forecast
case chainChecks? MaxMajorPV (pp .maxHeaderSize , pp .maxBlockSize , pp .pv) bh of λ where
(no _) → failure "Failed in CHAINHEAD"
(no ¬cc) → failure (genErrors ¬cc)
(yes cc) → do
(⟦ η₀′ , _ ⟧ᵗˢ , ticknStep) ← computeTICKN ticknΓ ticknSt ne
(_ , prtclStep) ← computePRTCL ⟦ pd , η₀′ ⟧ᵖᵉ prtclSt bh
Expand Down
3 changes: 2 additions & 1 deletion docs/agda-spec/src/Spec/Protocol/Properties.agda
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ module Spec.Protocol.Properties

open import Data.Rational as ℚ using (1ℚ)
open import Ledger.Prelude
open import Tactic.GenError
open import Spec.Protocol crypto nonces es ss bs af rs
open import Spec.BaseTypes crypto using (OCertCounters)
open import Spec.UpdateNonce crypto nonces es
Expand Down Expand Up @@ -88,7 +89,7 @@ instance
(_ , updnStep) ← computeUPDN updnΓ updnSt slot
(_ , ocertStep) ← computeOCERT ocertΓ cs bh
success (-, Evolve-Prtcl (updnStep , ocertStep , prf))
(no _) → failure "Failed in PRTCL"
(no ¬prf) → failure (genErrors ¬prf)

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