Commit f241979
committed
Merge rust-bitcoin#5344: Use usize for CompactSizeEncoder::new
b486c83 Use usize for CompactSizeEncoder::new (Mitchell Bagot)
Pull request description:
The current CompactSizeEncoder::new() constructor uses an impl ToU64 for its first parameter. The ToU64 trait is part of internals, and thus isn't permitted to be part of the public API of consensus_encoding.
Change the ToU64 parameter type to usize, encoding values outside of the u64 range (such as on 128 bit system) as u64::MAX.
Closes rust-bitcoin#5343
ACKs for top commit:
apoelstra:
ACK b486c83; successfully ran local tests
tcharding:
ACK b486c83
Tree-SHA512: 0a7064e3485949414590002e6fbfb6325bb6a76ce759bd6f40f4c7c1ca4817613e51e3d344f8c2b967855d2ba9d430667141f8196561c107275cbe5a63ced5caFile tree
6 files changed
+42
-21
lines changed- api/consensus_encoding
- consensus_encoding
- src/encode
- tests
- primitives/src
6 files changed
+42
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
334 | 334 | | |
335 | 335 | | |
336 | 336 | | |
337 | | - | |
| 337 | + | |
338 | 338 | | |
339 | 339 | | |
340 | 340 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
311 | 311 | | |
312 | 312 | | |
313 | 313 | | |
314 | | - | |
| 314 | + | |
315 | 315 | | |
316 | 316 | | |
317 | 317 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
248 | | - | |
| 248 | + | |
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
229 | | - | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
230 | 239 | | |
231 | 240 | | |
232 | 241 | | |
| |||
554 | 563 | | |
555 | 564 | | |
556 | 565 | | |
557 | | - | |
| 566 | + | |
558 | 567 | | |
559 | 568 | | |
560 | 569 | | |
561 | 570 | | |
562 | | - | |
| 571 | + | |
563 | 572 | | |
564 | 573 | | |
565 | 574 | | |
566 | 575 | | |
567 | 576 | | |
568 | | - | |
| 577 | + | |
569 | 578 | | |
570 | 579 | | |
571 | 580 | | |
572 | 581 | | |
573 | | - | |
| 582 | + | |
574 | 583 | | |
575 | 584 | | |
576 | 585 | | |
577 | 586 | | |
578 | 587 | | |
579 | | - | |
| 588 | + | |
580 | 589 | | |
581 | 590 | | |
582 | 591 | | |
583 | 592 | | |
584 | | - | |
| 593 | + | |
585 | 594 | | |
586 | 595 | | |
587 | 596 | | |
588 | 597 | | |
589 | 598 | | |
590 | | - | |
591 | | - | |
592 | | - | |
593 | | - | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
594 | 615 | | |
595 | 616 | | |
596 | 617 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
| 156 | + | |
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | | - | |
| 160 | + | |
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
| 164 | + | |
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
| 168 | + | |
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
333 | | - | |
| 333 | + | |
334 | 334 | | |
335 | 335 | | |
336 | 336 | | |
337 | | - | |
| 337 | + | |
338 | 338 | | |
339 | 339 | | |
340 | 340 | | |
| |||
0 commit comments