Skip to content

Commit

Permalink
Order PR fixes
Browse files Browse the repository at this point in the history
- remove commented out code
- fix alignment broken by this PR
- add < for epochs specifically, so the PDF doesn't suffer
  • Loading branch information
WhatisRT committed Oct 2, 2023
1 parent cce1fa8 commit 4e5afed
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/Interface/HasAdd/Instance.agda
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{-# OPTIONS --safe #-}
module Interface.HasAdd.Instance where

open import Interface.HasAdd -- public
open import Interface.HasAdd
open import Data.Integer as ℤ using (ℤ)
open import Data.Nat as ℕ using (ℕ)

Expand Down
14 changes: 7 additions & 7 deletions src/Ledger/Epoch.agda
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,14 @@ record GlobalConstants : Set₁ where

ℕEpochStructure : EpochStructure
ℕEpochStructure = λ where
.Slotʳ +-*-semiring
.Epoch
.epoch slot slot / SlotsPerEpochᶜ
.firstSlot e e * SlotsPerEpochᶜ
._≤ˢ_ ℕ._≤_
.Slot-TO ≤-isTotalOrder
.Slotʳ +-*-semiring
.Epoch
.epoch slot slot / SlotsPerEpochᶜ
.firstSlot e e * SlotsPerEpochᶜ
._≤ˢ_ ℕ._≤_
.Slot-TO ≤-isTotalOrder
.StabilityWindow StabilityWindowᶜ
.sucᵉ suc
.sucᵉ suc

where open EpochStructure

Expand Down
4 changes: 0 additions & 4 deletions src/Ledger/Foreign/HSLedger.agda
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ HSEpochStructure = EpochStructure ∋ ℕEpochStructure HSGlobalConstants
open import Ledger.PParams HSEpochStructure

-- Dummy private key crypto scheme
-- open PKKScheme
HSPKKScheme : PKKScheme
HSPKKScheme = record
{ Implementation
Expand All @@ -100,23 +99,20 @@ HSPKKScheme = record
; isSigned-correct = λ where (sk , sk , refl) _ _ h h
}

-- open Crypto
HSCrypto : Crypto
HSCrypto = record
{ Implementation
; pkk = HSPKKScheme
}

-- No scripts for now
-- open P1ScriptStructure
HSP1ScriptStructure : P1ScriptStructure ℕ ℕ ℕ
HSP1ScriptStructure = record
{ Implementation
; validP1Script = λ _ _ ()
; validP1Script? = λ _ _ ()
}

-- open PlutusStructure
HSP2ScriptStructure : PlutusStructure ℕ ℕ ℕ
HSP2ScriptStructure = record
{ Implementation
Expand Down
10 changes: 7 additions & 3 deletions src/Ledger/Gov.lagda
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ private variable
addr : RwdAddr
a : GovAction
prev : NeedsHash a

private -- FIXME: this should be part of a typeclass
_<_ : Epoch → Epoch → Set
a < b = a ≤ b × a ≢ b
\end{code}
\begin{code}
-- could be implemented using a function of type:
Expand Down Expand Up @@ -85,7 +89,7 @@ data _⊢_⇀⦇_,GOV'⦈_ : GovEnv × ℕ → GovState → GovVote ⊎ GovPropo
actionWellFormed a ≡ true
→ d ≡ govActionDeposit
→ (∀ {new rem q} → a ≡ NewCommittee new rem q
→ ∀[ e ∈ range (new ˢ) ] epoch ≤ᵉ e × ¬ (epoch ≡ e) × dom (new ˢ) ∩ rem ≡ᵉ ∅)
→ ∀[ e ∈ range (new ˢ) ] epoch < e × dom (new ˢ) ∩ rem ≡ᵉ ∅)
────────────────────────────────
let sig = inj₂ record { returnAddr = addr ; action = a ; anchor = x
; deposit = d ; prevAction = prev }
Expand Down Expand Up @@ -135,7 +139,7 @@ instance
case ¿ actionWellFormed a ≡ true × d ≡ pparams .PParams.govActionDeposit ¿
,′ isNewCommittee a of λ where
(yesᵈ (wf , dep) , yesᵈ (new , rem , q , refl)) →
case ¿ ∀[ e ∈ range (new ˢ) ] epoch ≤ᵉ e × ¬ (epoch ≡ e) × dom (new ˢ) ∩ rem ≡ᵉ ∅ ¿ of λ where
case ¿ ∀[ e ∈ range (new ˢ) ] epoch < e × dom (new ˢ) ∩ rem ≡ᵉ ∅ ¿ of λ where
(yesᵈ newOk) → just (_ , GOV-Propose wf dep λ where refl → newOk)
(noᵈ _) → nothing
(yesᵈ (wf , dep) , noᵈ notNewComm) → just (_ , GOV-Propose wf dep λ isNewComm → ⊥-elim (notNewComm (_ , _ , _ , isNewComm)))
Expand All @@ -149,7 +153,7 @@ instance
with ¿ actionWellFormed a ≡ true × d ≡ pparams .PParams.govActionDeposit ¿ | isNewCommittee a
... | noᵈ ¬p | _ = ⊥-elim (¬p (wf , dep))
... | yesᵈ _ | noᵈ notNewComm = refl
... | yesᵈ _ | yesᵈ (new , rem , q , refl) with ¿ ∀[ e ∈ range (new ˢ) ] epoch ≤ᵉ e × ¬ (epoch ≡ e) × dom (new ˢ) ∩ rem ≡ᵉ ∅ ¿ | ""
... | yesᵈ _ | yesᵈ (new , rem , q , refl) with ¿ ∀[ e ∈ range (new ˢ) ] epoch < e × dom (new ˢ) ∩ rem ≡ᵉ ∅ ¿ | ""
... | yesᵈ newOk | _ = refl
... | noᵈ notOk | _ = ⊥-elim (notOk (newOk refl))

Expand Down
1 change: 0 additions & 1 deletion src/Ledger/GovernanceActions.lagda
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,6 @@ data _⊢_⇀⦇_,ENACT⦈_ : EnactEnv → EnactState → GovAction → EnactSta
\end{figure*}

\begin{code}[hide]
-- open import Interface.Decidable.Instance
open Computational' ⦃...⦄

instance
Expand Down

0 comments on commit 4e5afed

Please sign in to comment.