Commit 0b8bea9
committed
Merge #534: Update GetBlockStats fields to be optional
94f6a4f Update the docs for GetBlockStats (Abeeujah)
ec827c2 Update GetBlockStats fields to be optional (Abeeujah)
Pull request description:
This PR aims to update the `GetBlockStats` model/response to match the core's spec for [Docs fix](https://bitcoincore.org/en/doc/23.0.0/rpc/blockchain/getblockstats/) the rpc spec for getblockstats specifies that it takes in two arguments
1. hash_or_height (string or numeric, required) The block hash or height of the target block
2. stats (json array, optional, default=all values)
If the stats arg is provided, only the value for the stats is returned, if not provided it defaults to all, and all the fields values are returned; indicating that all the fields for `GetBlockStats` is optional.
To better model and represent this, all the fields in v17, v25, and `model::GetBlockStats` are now wrapped in `Option`.
- The docs has been updated to include the optional stats argument
- Tests has also been updated to accept the stats argument, and confirm it behaves as specified for all versions of core.
ACKs for top commit:
jamillambert:
ACK 94f6a4f
tcharding:
ACK 94f6a4f
Tree-SHA512: 8154b831897f85ffdceedb02a28dd00f7980d08d3daf1fcd7d793b46d266aa3c2e962a8f3b072a5f14339cc3b94ccd5d4af05fa1ceee3d3753baebb54ca05c567 files changed
Lines changed: 223 additions & 177 deletions
File tree
- client/src/client_sync/v17
- integration_test/tests
- types/src
- model
- v17/blockchain
- v25/blockchain
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
116 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
117 | 121 | | |
118 | 122 | | |
119 | | - | |
120 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
121 | 129 | | |
122 | 130 | | |
123 | 131 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
200 | | - | |
201 | | - | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
202 | 207 | | |
203 | | - | |
204 | | - | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
205 | 211 | | |
206 | 212 | | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
211 | 216 | | |
212 | | - | |
213 | 217 | | |
214 | | - | |
| 218 | + | |
215 | 219 | | |
216 | | - | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
217 | 225 | | |
218 | 226 | | |
219 | | - | |
220 | | - | |
221 | | - | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
222 | 233 | | |
223 | 234 | | |
224 | | - | |
225 | | - | |
226 | | - | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
227 | 240 | | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
| 241 | + | |
232 | 242 | | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
239 | 247 | | |
240 | 248 | | |
241 | 249 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
384 | 384 | | |
385 | 385 | | |
386 | 386 | | |
| 387 | + | |
| 388 | + | |
387 | 389 | | |
388 | 390 | | |
389 | 391 | | |
390 | | - | |
| 392 | + | |
391 | 393 | | |
392 | 394 | | |
393 | 395 | | |
394 | | - | |
| 396 | + | |
395 | 397 | | |
396 | | - | |
| 398 | + | |
397 | 399 | | |
398 | | - | |
| 400 | + | |
399 | 401 | | |
400 | | - | |
| 402 | + | |
401 | 403 | | |
402 | | - | |
| 404 | + | |
403 | 405 | | |
404 | | - | |
| 406 | + | |
405 | 407 | | |
406 | 408 | | |
407 | 409 | | |
408 | | - | |
| 410 | + | |
409 | 411 | | |
410 | | - | |
| 412 | + | |
411 | 413 | | |
412 | | - | |
| 414 | + | |
413 | 415 | | |
414 | | - | |
| 416 | + | |
415 | 417 | | |
416 | | - | |
| 418 | + | |
417 | 419 | | |
418 | 420 | | |
419 | 421 | | |
420 | | - | |
| 422 | + | |
421 | 423 | | |
422 | | - | |
| 424 | + | |
423 | 425 | | |
424 | | - | |
| 426 | + | |
425 | 427 | | |
426 | | - | |
| 428 | + | |
427 | 429 | | |
428 | 430 | | |
429 | 431 | | |
430 | | - | |
| 432 | + | |
431 | 433 | | |
432 | | - | |
| 434 | + | |
433 | 435 | | |
434 | | - | |
| 436 | + | |
435 | 437 | | |
436 | | - | |
| 438 | + | |
437 | 439 | | |
438 | 440 | | |
439 | 441 | | |
440 | | - | |
| 442 | + | |
441 | 443 | | |
442 | | - | |
| 444 | + | |
443 | 445 | | |
444 | | - | |
| 446 | + | |
445 | 447 | | |
446 | | - | |
| 448 | + | |
447 | 449 | | |
448 | 450 | | |
449 | 451 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
225 | | - | |
226 | | - | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
227 | 228 | | |
228 | 229 | | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
234 | 233 | | |
235 | 234 | | |
236 | | - | |
237 | | - | |
| 235 | + | |
| 236 | + | |
238 | 237 | | |
239 | 238 | | |
240 | | - | |
| 239 | + | |
241 | 240 | | |
242 | | - | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
243 | 245 | | |
244 | 246 | | |
245 | | - | |
246 | | - | |
247 | | - | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
248 | 250 | | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
254 | 259 | | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
259 | 270 | | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
264 | 275 | | |
265 | | - | |
266 | | - | |
| 276 | + | |
| 277 | + | |
267 | 278 | | |
268 | 279 | | |
269 | 280 | | |
| |||
0 commit comments