Skip to content

Commit b1cb341

Browse files
committed
Change rewardAccount to RewardAddress for stake pools
1 parent 589115c commit b1cb341

5 files changed

Lines changed: 10 additions & 4 deletions

File tree

src/Ledger/Dijkstra/Specification/Certs.lagda.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ record GovCertEnv : Type where
142142

143143
<!--
144144
```agda
145-
open StakePoolParams using (vrf; cost)
145+
open StakePoolParams
146146
147147
IsConwayCert? : IsConwayCert ⁇¹
148148
IsConwayCert? {x} .dec with x
@@ -422,6 +422,7 @@ data _⊢_⇀⦇_,POOL⦈_ : PoolEnv → PState → DCert → PState → Type wh
422422
POOL-reg :
423423
∙ ¬ (IsPoolRegistered pools kh)
424424
∙ ¬ (poolParams .vrf ∈ mapˢ vrf (range pools ∪ range fPools))
425+
∙ NetworkIdOf (poolParams .rewardAccount) ≡ NetworkId
425426
∙ pp .minPoolCost ≤ poolParams .cost
426427
────────────────────────────────
427428
⟦ e , pp ⟧ ⊢ ⟦ pools
@@ -438,6 +439,7 @@ data _⊢_⇀⦇_,POOL⦈_ : PoolEnv → PState → DCert → PState → Type wh
438439
POOL-rereg :
439440
∙ IsPoolRegistered pools kh
440441
∙ ¬ (poolParams .vrf ∈ mapˢ vrf (range (pools ∣ ❴ kh ❵ ᶜ) ∪ range (fPools ∣ ❴ kh ❵ ᶜ)))
442+
∙ NetworkIdOf (poolParams .rewardAccount) ≡ NetworkId
441443
∙ pp .minPoolCost ≤ poolParams .cost
442444
────────────────────────────────
443445
⟦ e , pp ⟧ ⊢ ⟦ pools

src/Ledger/Dijkstra/Specification/Certs/Properties/Computational.lagda.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,13 @@ instance
6262
with ¿ IsPoolRegistered (PoolsOf stᵖ) c ¿
6363
Computational-POOL .computeProof Γ stᵖ (regpool c poolParams) | yes p
6464
with ¿ ¬ (poolParams .vrf ∈ mapˢ vrf (range (PoolsOf stᵖ ∣ ❴ c ❵ ᶜ) ∪ range (FuturePoolsOf stᵖ ∣ ❴ c ❵ ᶜ)))
65+
∙ NetworkIdOf (poolParams .rewardAccount) ≡ NetworkId
6566
∙ Γ .pp .minPoolCost ≤ poolParams .cost ¿
6667
... | yes q = success (-, POOL-rereg (p , q))
6768
... | no ¬q = failure (genErrors ¬q)
6869
Computational-POOL .computeProof Γ stᵖ (regpool c poolParams) | no ¬p
6970
with ¿ ¬ (poolParams .vrf ∈ mapˢ vrf (range (PoolsOf stᵖ) ∪ range (FuturePoolsOf stᵖ)))
71+
∙ NetworkIdOf (poolParams .rewardAccount) ≡ NetworkId
7072
∙ Γ .pp .minPoolCost ≤ poolParams .cost ¿
7173
... | yes q = success (-, (POOL-reg (¬p , q)))
7274
... | no ¬q = failure (genErrors ¬q)
@@ -82,6 +84,7 @@ instance
8284
... | yes r = ⊥-elim (p r)
8385
... | no ¬r
8486
with ¿ ¬ (poolParams .vrf ∈ mapˢ vrf (range (PoolsOf stᵖ) ∪ range (FuturePoolsOf stᵖ)))
87+
∙ NetworkIdOf (poolParams .rewardAccount) ≡ NetworkId
8588
∙ Γ .pp .minPoolCost ≤ poolParams .cost ¿
8689
... | yes _ = refl
8790
... | no ¬s = ⊥-elim (¬s q)
@@ -90,6 +93,7 @@ instance
9093
... | no ¬r = ⊥-elim (¬r p)
9194
... | yes r
9295
with ¿ ¬ (poolParams .vrf ∈ mapˢ vrf (range (PoolsOf stᵖ ∣ ❴ c ❵ ᶜ) ∪ range (FuturePoolsOf stᵖ ∣ ❴ c ❵ ᶜ)))
96+
∙ NetworkIdOf (poolParams .rewardAccount) ≡ NetworkId
9397
∙ Γ .pp .minPoolCost ≤ poolParams .cost ¿
9498
... | yes _ = refl
9599
... | no ¬s = ⊥-elim (¬s q)

src/Ledger/Dijkstra/Specification/PoolReap.lagda.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ data _⊢_⇀⦇_,POOLREAP⦈_ : ⊤ → PoolReapState → Epoch → PoolReapSta
6161
retired = retiring ⁻¹ e
6262
6363
rewardAccounts : KeyHash ⇀ Credential
64-
rewardAccounts = mapValues rewardAccount (pools ∣ retired)
64+
rewardAccounts = mapValues (CredentialOf ∘ rewardAccount) (pools ∣ retired)
6565
6666
rewardAccounts' : Credential ⇀ Coin
6767
rewardAccounts' = aggregateBy (rewardAccounts ˢ) depositsᵖ

src/Ledger/Dijkstra/Specification/Ratify.lagda.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ module AcceptedBySPO (delegatees : VoteDelegs)
255255
defaultVote : KeyHash → Vote
256256
defaultVote kh = case lookupᵐ? pools kh of λ where
257257
nothing → Vote.no
258-
(just p) → case lookupᵐ? delegatees (StakePoolParams.rewardAccount p) , gaType action of
258+
(just p) → case lookupᵐ? delegatees (CredentialOf (StakePoolParams.rewardAccount p)) , gaType action of
259259
λ where
260260
( _ , TriggerHardFork ) → Vote.no
261261
( just vDelegNoConfidence , NoConfidence ) → Vote.yes

src/Ledger/Dijkstra/Specification/Rewards.lagda.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ rewardOnePool pp rewardPot n N poolParams stakeDistr σ σa tot = memberRewards
133133
(stakeDistr ∣ owners ᶜ)
134134
135135
ownersRewards : Stake
136-
ownersRewards = ❴ poolParams .StakePoolParams.rewardAccount
136+
ownersRewards = ❴ CredentialOf (poolParams .StakePoolParams.rewardAccount)
137137
, stakeMap[ rewardOwners ] ownerStake σ ❵ᵐ
138138
139139
poolStake : KeyHash → StakeDelegs → Stake → Stake

0 commit comments

Comments
 (0)