Commit 34d8210
feat: Bitswap py-cid Migration Phase 1 + Phase 2 (#1235)
* the helper function required for proper conversion the terms to the CID object
* pushed the builder part
* pushed the new functions for compute cid v0 or cid v1
* removed the unused functions
* fix: PR 1235 – add newsfragment, type aliases, narrow exceptions, parse_cid docstring
- Add newsfragments/1234.feature.rst for issue #1234
- Fix mypy: CIDInput/CIDObject as TypeAlias in libp2p/bitswap/cid.py
- Narrow except Exception to ValueError in get_cid_prefix, reconstruct_cid_from_prefix_and_data, verify_cid, parse_cid_version, parse_cid_codec
- Docstring: parse_cid accepts hex with or without 0x
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: acul71 <34693171+acul71@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>1 parent def1658 commit 34d8210
File tree
6 files changed
+229
-437
lines changed- examples/cid
- libp2p/bitswap
- newsfragments
- tests/core/bitswap
6 files changed
+229
-437
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | 12 | | |
14 | 13 | | |
15 | | - | |
16 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
68 | 56 | | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
| 57 | + | |
74 | 58 | | |
75 | 59 | | |
76 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
| 16 | + | |
15 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
16 | 22 | | |
17 | 23 | | |
18 | 24 | | |
| |||
41 | 47 | | |
42 | 48 | | |
43 | 49 | | |
| 50 | + | |
44 | 51 | | |
| 52 | + | |
45 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
46 | 58 | | |
47 | 59 | | |
48 | 60 | | |
| |||
0 commit comments