Commit 096a9ee
committed
refactor(algod-client): restructure block models to align with JS SDK
Align Python block model structure with the JavaScript SDK and OpenAPI
spec for cross-SDK consistency.
Structural changes:
- Rename GetBlock -> BlockResponse (matches OAS spec + JS/TS SDKs)
- Add TxnCommitments nested type for transaction roots (txn, txn256)
- Add RewardState nested type for reward fields (fees, rwd, earn, etc.)
- Add UpgradeState nested type for protocol upgrade state
- Add UpgradeVote nested type for upgrade vote parameters
- Refactor BlockHeader to use flattened nested types
- Change BlockEvalDelta.bytes -> bytes_value (avoid Python keyword)
- Fix inner_txns type: SignedTxnInBlock -> SignedTxnWithAD
- Make previous_block_hash and genesis_hash non-optional with defaults
- Fix get_block() to return BlockResponse (typed) instead of Block
- Export typed BlockResponse from _block.py instead of untyped version
BREAKING CHANGE:
- GetBlock removed, use BlockResponse instead
- Field access patterns changed in BlockHeader:
- header.fee_sink -> header.reward_state.fee_sink
- header.current_protocol -> header.upgrade_state.current_protocol
- header.upgrade_propose -> header.upgrade_vote.upgrade_propose
- header.transactions_root -> header.txn_commitments.transactions_root
- Block response structure: result.header -> result.block.header1 parent 9de43f5 commit 096a9ee
File tree
9 files changed
+192
-64
lines changed- api/oas-generator/src/oas_generator
- renderer
- templates/models
- src/algokit_algod_client
- models
- tests/modules/algod_client/manual
9 files changed
+192
-64
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
936 | 936 | | |
937 | 937 | | |
938 | 938 | | |
939 | | - | |
| 939 | + | |
940 | 940 | | |
941 | 941 | | |
942 | 942 | | |
943 | | - | |
| 943 | + | |
944 | 944 | | |
945 | 945 | | |
946 | 946 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | 20 | | |
27 | 21 | | |
28 | 22 | | |
29 | 23 | | |
30 | 24 | | |
31 | | - | |
| 25 | + | |
32 | 26 | | |
33 | 27 | | |
34 | 28 | | |
| |||
Lines changed: 67 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
29 | 33 | | |
30 | 34 | | |
31 | 35 | | |
32 | 36 | | |
33 | 37 | | |
34 | 38 | | |
35 | | - | |
| 39 | + | |
36 | 40 | | |
37 | 41 | | |
38 | 42 | | |
| |||
118 | 122 | | |
119 | 123 | | |
120 | 124 | | |
121 | | - | |
| 125 | + | |
122 | 126 | | |
123 | 127 | | |
124 | 128 | | |
| |||
179 | 183 | | |
180 | 184 | | |
181 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
182 | 226 | | |
183 | 227 | | |
184 | 228 | | |
| |||
216 | 260 | | |
217 | 261 | | |
218 | 262 | | |
219 | | - | |
| 263 | + | |
220 | 264 | | |
221 | 265 | | |
222 | 266 | | |
223 | 267 | | |
224 | | - | |
| 268 | + | |
225 | 269 | | |
226 | 270 | | |
227 | 271 | | |
| |||
232 | 276 | | |
233 | 277 | | |
234 | 278 | | |
235 | | - | |
236 | 279 | | |
237 | | - | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
238 | 285 | | |
239 | 286 | | |
240 | | - | |
241 | 287 | | |
242 | 288 | | |
243 | 289 | | |
244 | | - | |
| 290 | + | |
245 | 291 | | |
246 | 292 | | |
247 | 293 | | |
248 | 294 | | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
263 | 307 | | |
264 | 308 | | |
265 | 309 | | |
| |||
294 | 338 | | |
295 | 339 | | |
296 | 340 | | |
297 | | - | |
| 341 | + | |
298 | 342 | | |
299 | 343 | | |
300 | 344 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
455 | 455 | | |
456 | 456 | | |
457 | 457 | | |
458 | | - | |
| 458 | + | |
459 | 459 | | |
460 | 460 | | |
461 | 461 | | |
| |||
483 | 483 | | |
484 | 484 | | |
485 | 485 | | |
486 | | - | |
| 486 | + | |
487 | 487 | | |
488 | 488 | | |
489 | 489 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
36 | | - | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
39 | 43 | | |
40 | 44 | | |
41 | | - | |
42 | 45 | | |
43 | 46 | | |
44 | 47 | | |
| |||
155 | 158 | | |
156 | 159 | | |
157 | 160 | | |
158 | | - | |
159 | 161 | | |
160 | 162 | | |
161 | 163 | | |
| |||
191 | 193 | | |
192 | 194 | | |
193 | 195 | | |
| 196 | + | |
194 | 197 | | |
195 | 198 | | |
196 | 199 | | |
| |||
217 | 220 | | |
218 | 221 | | |
219 | 222 | | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
220 | 226 | | |
221 | 227 | | |
0 commit comments