Commit b486c83
committed
Use usize for CompactSizeEncoder::new
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.1 parent 9bc2919 commit b486c83
File 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 | |
|---|---|---|---|
| |||
326 | 326 | | |
327 | 327 | | |
328 | 328 | | |
329 | | - | |
| 329 | + | |
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
303 | 303 | | |
304 | 304 | | |
305 | 305 | | |
306 | | - | |
| 306 | + | |
307 | 307 | | |
308 | 308 | | |
309 | 309 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
240 | | - | |
| 240 | + | |
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
| |||
| 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 | | |
| 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