@@ -31,11 +31,13 @@ open Equivalence
3131open GovActionState
3232open Inverse
3333
34- private
35- lookupActionId : (pparams : PParams) (role : GovRole) (aid : GovActionID) (s : GovState) →
36- Dec (Any (λ (aid' , ast) → aid ≡ aid' × canVote pparams (action ast) role) s)
37- lookupActionId pparams role aid = any? λ _ → ¿ _ ¿
34+ lookupActionId : (pparams : PParams) (role : GovRole) (aid : GovActionID) (epoch : Epoch) (s : GovState) →
35+ Dec (Any (λ (aid' , ast) → aid ≡ aid' × canVote pparams (action ast) role × ¬ (expired epoch ast)) s)
36+ lookupActionId pparams role aid epoch =
37+ let instance _ = λ {e ga} → ⁇ (expired? e ga)
38+ in any? λ _ → ¿ _ ¿
3839
40+ private
3941 isUpdateCommittee : (a : GovAction) → Dec (∃[ new ] ∃[ rem ] ∃[ q ] a ≡ UpdateCommittee new rem q)
4042 isUpdateCommittee NoConfidence = no λ ()
4143 isUpdateCommittee (UpdateCommittee new rem q) = yes (new , rem , q , refl)
@@ -111,19 +113,19 @@ instance
111113 module GoVote sig where
112114 open GovVote sig
113115
114- computeProof = case lookupActionId pparams (proj₁ voter) gid s ,′ isRegistered? (proj₁ Γ) voter of λ where
116+ computeProof = case lookupActionId pparams (proj₁ voter) gid epoch s ,′ isRegistered? (proj₁ Γ) voter of λ where
115117 (yes p , yes p') → case Any↔ .from p of λ where
116- (_ , mem , refl , cV) → success (_ , GOV-Vote (∈-fromList .to mem , cV , p'))
118+ (_ , mem , refl , cV , ¬exp ) → success (_ , GOV-Vote (∈-fromList .to mem , cV , p' , ¬exp ))
117119 (yes _ , no ¬p) → failure (genErrors ¬p)
118- (no ¬p , _) → failure (genErrors ¬p)
120+ (no ¬p , _ ) → failure (genErrors ¬p)
119121
120122 completeness : ∀ s' → Γ ⊢ s ⇀⦇ inj₁ sig ,GOV'⦈ s' → map proj₁ computeProof ≡ success s'
121- completeness s' (GOV-Vote (mem , cV , reg))
122- with lookupActionId pparams (proj₁ voter) gid s | isRegistered? (proj₁ Γ) voter
123- ... | no ¬p | _ = ⊥-elim (¬p (Any↔ .to (_ , ∈-fromList .from mem , refl , cV)))
123+ completeness s' (GOV-Vote {ast = ast} (mem , cV , reg , ¬expired ))
124+ with lookupActionId pparams (proj₁ voter) gid epoch s | isRegistered? (proj₁ Γ) voter
125+ ... | no ¬p | _ = ⊥-elim (¬p (Any↔ .to (_ , ∈-fromList .from mem , refl , cV , ¬expired )))
124126 ... | yes _ | no ¬p = ⊥-elim $ ¬p reg
125- ... | yes p | yes p' with Any↔ .from p
126- ... | (_ , mem , refl , cV) = refl
127+ ... | yes p | yes q with Any↔ .from p
128+ ... | ((_ , ast') , mem , refl , cV) = refl
127129
128130 module GoProp prop where
129131 open GovProposal prop
@@ -138,16 +140,17 @@ instance
138140 × d ≡ govActionDeposit
139141 × validHFAction prop s enactState
140142 × hasParent' enactState s a prev
141- × addr .RwdAddr.net ≡ NetworkId ¿
143+ × addr .RwdAddr.net ≡ NetworkId
144+ × addr .RwdAddr.stake ∈ rewardCreds ¿
142145 ,′ isUpdateCommittee a
143146
144147 computeProof = case H of λ where
145- (yes (wf , dep , vHFA , HasParent' en , goodAddr) , yes (new , rem , q , refl)) →
148+ (yes (wf , dep , vHFA , HasParent' en , goodAddr , regReturn ) , yes (new , rem , q , refl)) →
146149 case ¿ ∀[ e ∈ range new ] epoch < e × dom new ∩ rem ≡ᵉ ∅ ¿ of λ where
147- (yes newOk) → success (_ , GOV-Propose (wf , dep , vHFA , en , goodAddr))
150+ (yes newOk) → success (_ , GOV-Propose (wf , dep , vHFA , en , goodAddr , regReturn ))
148151 (no ¬p) → failure (genErrors ¬p)
149- (yes (wf , dep , vHFA , HasParent' en , goodAddr) , no notNewComm) → success
150- (-, GOV-Propose (wf , dep , vHFA , en , goodAddr))
152+ (yes (wf , dep , vHFA , HasParent' en , goodAddr , returnReg ) , no notNewComm) → success
153+ (-, GOV-Propose (wf , dep , vHFA , en , goodAddr , returnReg ))
151154 (no ¬p , _) → failure (genErrors ¬p)
152155
153156 completeness : ∀ s' → Γ ⊢ s ⇀⦇ inj₂ prop ,GOV'⦈ s' → map proj₁ computeProof ≡ success s'
0 commit comments