@@ -32,28 +32,14 @@ open import Ledger.Enact govStructure
3232open import Ledger.Gov txs
3333open import Ledger.Ledger txs abs
3434open import Ledger.Ratify txs
35- open import Ledger.Rewards govStructure
35+ open import Ledger.Rewards txs abs
3636open import Ledger.Utxo txs abs
3737
3838\end{code}
3939\begin{figure*}[ht]
4040\begin{AgdaMultiCode}
41- \begin{NoConway}
4241\begin{code}
43- record Snapshot : Set where
44- field
45- stake : Credential ⇀ Coin
46- delegations : Credential ⇀ KeyHash
47- poolParameters : KeyHash ⇀ PoolParams
48-
49- record Snapshots : Set where
50- field
51- mark set go : Snapshot
52- feeSS : Coin
5342
54- \end{code}
55- \end{NoConway}
56- \begin{code}
5743record EpochState : Type where
5844\end{code}
5945\begin{code}[hide]
@@ -66,6 +52,7 @@ record EpochState : Type where
6652 ls : LState
6753 es : EnactState
6854 fut : RatifyState
55+
6956\end{code}
7057\begin{code}[hide]
7158record HasEpochState {a} (A : Type a) : Type a where
@@ -130,10 +117,8 @@ instance
130117 HasRewards-NewEpochState : HasRewards NewEpochState
131118 HasRewards-NewEpochState .RewardsOf = RewardsOf ∘ CertStateOf
132119
133- unquoteDecl HasCast-RewardUpdate HasCast-Snapshot HasCast-Snapshots HasCast- EpochState HasCast-NewEpochState = derive-HasCast
120+ unquoteDecl HasCast-RewardUpdate HasCast-EpochState HasCast-NewEpochState = derive-HasCast
134121 ( (quote RewardUpdate , HasCast-RewardUpdate)
135- ∷ (quote Snapshot , HasCast-Snapshot)
136- ∷ (quote Snapshots , HasCast-Snapshots)
137122 ∷ (quote EpochState , HasCast-EpochState)
138123 ∷ [ (quote NewEpochState , HasCast-NewEpochState)])
139124
@@ -274,15 +259,6 @@ getOrphans es govSt = proj₁ $ iterate step ([] , govSt) (length govSt)
274259open RwdAddr using (stake)
275260\end{code}
276261\begin{code}
277- stakeDistr : UTxO → DState → PState → Snapshot
278- stakeDistr utxo stᵈ pState =
279- ⟦ aggregate₊ (stakeRelation ᶠˢ) , stakeDelegs , poolParams ⟧
280- where
281- poolParams = pState .PState.pools
282- open DState stᵈ using (stakeDelegs; rewards)
283- m = mapˢ (λ a → (a , cbalance (utxo ∣^' λ i → getStakeCred i ≡ just a))) (dom rewards)
284- stakeRelation = m ∪ ∣ rewards ∣
285-
286262gaDepositStake : GovState → Deposits → Credential ⇀ Coin
287263gaDepositStake govSt ds = aggregateBy
288264 (mapˢ (λ (gaid , addr) → (gaid , addr) , stake addr) govSt')
@@ -323,12 +299,6 @@ private variable
323299\begin{NoConway}
324300\begin{figure*}[h]
325301\begin{code}
326- data _⊢_⇀⦇_,SNAP⦈_ : LState → Snapshots → ⊤ → Snapshots → Type where
327- SNAP : let open LState lstate; open UTxOState utxoSt; open CertState certState
328- stake = stakeDistr utxo dState pState
329- in
330- lstate ⊢ ⟦ mark , set , go , feeSS ⟧ ⇀⦇ tt ,SNAP⦈ ⟦ stake , mark , set , fees ⟧
331-
332302data _⊢_⇀⦇_,EPOCH⦈_ : ⊤ → EpochState → Epoch → EpochState → Type where
333303\end{code}
334304\end{figure*}
0 commit comments