Commit 2f80041
program.py: route from_bytes_backrefs through deser_auto
The previous implementation went through CLVMTree.from_bytes → deserialize_as_tuples,
which is a classic-format-only parser. As a result, Program.from_bytes_backrefs()
raised ValueError on any blob using the 0xfe backref opcode, despite the method's
name implying backref support. After this change:
- still rejects the serde_2026 magic prefix up front
- delegates to deser_auto (Rust binding), which handles both classic and backref formats
- adds regression test that round-trips a tree-with-shared-subtrees through
backref encoder and from_bytes_backrefs (asserting 0xfe presence)
Fixes Cursor bot finding on PR #708.
Co-authored-by: Cursor <cursoragent@cursor.com>1 parent 658f886 commit 2f80041
2 files changed
Lines changed: 20 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
55 | | - | |
| 54 | + | |
56 | 55 | | |
57 | 56 | | |
58 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
182 | 200 | | |
183 | 201 | | |
184 | 202 | | |
| |||
0 commit comments