Commit a24e06c
authored
Move pool deposits into StakePoolState (#5234)
* Move pool deposits from PState into StakePoolState.
* Add `spsDeposit` field to `StakePoolState`
* Remove `psDeposits` field from `PState` data constructor
* Update `mkStakePoolState` to take deposit parameter as first argument
* Replace `psDepositsL` and `psDepositsCompactL` lenses with `psDepositsG` and `psDepositsCompactG` getters
* Remove `payPoolDeposit` and `refundPoolDeposit` functions
* Update `EncCBOR`/`DecCBOR` instances for `PState` to handle new structure
* Add lenses for `StakePoolState` fields
* Update shelley to use StakePoolState deposit.
Also,
* Use `mempty` deposits for genesis stake pools per specification.
* Remove `epochStatePoolParamsL` lens.
* Add prUTxOStateL, prChainAccountStateL, prCertStateL lenses to PoolReap exports.
* Update shelley tests.
* Update ledger-test and conformance tests.
* Update test examples to handle deposits correctly.
- Replace newPool/reregPool by a singular regPool.
- Remove addPoolDeposits.
- Update test examples to use this new way of handling pool deposits.
- Update ledger state golden test.1 parent 898b0be commit a24e06c
File tree
34 files changed
+262
-283
lines changed- eras/shelley
- impl
- src/Cardano/Ledger/Shelley
- LedgerState
- Rules
- State
- testlib/Test/Cardano/Ledger/Shelley/UnitTests
- test-suite
- src/Test/Cardano/Ledger/Shelley/Rules
- test/Test/Cardano/Ledger/Shelley
- Examples
- Serialisation/Golden
- libs
- cardano-ledger-conformance/src/Test/Cardano/Ledger/Conformance/SpecTranslate/Conway
- cardano-ledger-core
- src/Cardano/Ledger/State
- testlib/Test/Cardano/Ledger/Core
- test/Test/Cardano/Ledger/State
- cardano-ledger-test/src/Test/Cardano/Ledger
- Constrained/Conway
- LedgerTypes
- Generic
34 files changed
+262
-283
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
5 | 10 | | |
6 | 11 | | |
7 | 12 | | |
| |||
Lines changed: 1 addition & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
46 | | - | |
47 | 45 | | |
48 | 46 | | |
49 | 47 | | |
| |||
102 | 100 | | |
103 | 101 | | |
104 | 102 | | |
105 | | - | |
106 | 103 | | |
107 | 104 | | |
108 | 105 | | |
| |||
115 | 112 | | |
116 | 113 | | |
117 | 114 | | |
118 | | - | |
| 115 | + | |
119 | 116 | | |
120 | 117 | | |
121 | 118 | | |
| |||
Lines changed: 1 addition & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
698 | 698 | | |
699 | 699 | | |
700 | 700 | | |
701 | | - | |
702 | | - | |
703 | | - | |
704 | | - | |
705 | | - | |
706 | | - | |
707 | 701 | | |
708 | 702 | | |
709 | 703 | | |
| |||
Lines changed: 16 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
259 | 259 | | |
260 | 260 | | |
261 | 261 | | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
266 | 265 | | |
267 | 266 | | |
268 | 267 | | |
| |||
281 | 280 | | |
282 | 281 | | |
283 | 282 | | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
293 | 295 | | |
294 | 296 | | |
295 | | - | |
| 297 | + | |
296 | 298 | | |
297 | 299 | | |
298 | 300 | | |
| |||
Lines changed: 21 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
19 | 22 | | |
20 | 23 | | |
21 | 24 | | |
22 | 25 | | |
23 | | - | |
| 26 | + | |
24 | 27 | | |
25 | 28 | | |
26 | 29 | | |
| |||
65 | 68 | | |
66 | 69 | | |
67 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
68 | 80 | | |
69 | 81 | | |
70 | 82 | | |
| |||
155 | 167 | | |
156 | 168 | | |
157 | 169 | | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
162 | 173 | | |
163 | 174 | | |
164 | 175 | | |
165 | 176 | | |
166 | 177 | | |
167 | 178 | | |
168 | | - | |
| 179 | + | |
169 | 180 | | |
170 | 181 | | |
171 | 182 | | |
172 | 183 | | |
173 | 184 | | |
174 | | - | |
| 185 | + | |
175 | 186 | | |
176 | | - | |
| 187 | + | |
177 | 188 | | |
178 | 189 | | |
179 | 190 | | |
180 | 191 | | |
181 | 192 | | |
182 | 193 | | |
183 | | - | |
184 | | - | |
| 194 | + | |
185 | 195 | | |
186 | 196 | | |
187 | 197 | | |
188 | 198 | | |
189 | 199 | | |
| 200 | + | |
190 | 201 | | |
191 | 202 | | |
192 | 203 | | |
| |||
216 | 227 | | |
217 | 228 | | |
218 | 229 | | |
219 | | - | |
220 | 230 | | |
221 | 231 | | |
222 | 232 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
80 | | - | |
| 81 | + | |
| 82 | + | |
81 | 83 | | |
82 | 84 | | |
83 | 85 | | |
| |||
Lines changed: 13 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
385 | 385 | | |
386 | 386 | | |
387 | 387 | | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
388 | 400 | | |
389 | 401 | | |
390 | 402 | | |
| |||
394 | 406 | | |
395 | 407 | | |
396 | 408 | | |
397 | | - | |
| 409 | + | |
398 | 410 | | |
399 | 411 | | |
400 | 412 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
239 | | - | |
240 | | - | |
| 239 | + | |
| 240 | + | |
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
| 83 | + | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| |||
0 commit comments