Skip to content

Commit 658f886

Browse files
serde_2026: default strict=True for Python deserializers
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent b5063c1 commit 658f886

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

wheel/python/clvm_rs/clvm_rs.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ def deser_2026(
1717
blob: bytes,
1818
*,
1919
max_atom_len: int = ...,
20-
strict: bool = False,
20+
strict: bool = True,
2121
) -> "LazyNode": ...
2222
def deser_auto(
2323
blob: bytes,
2424
*,
2525
max_atom_len: int = ...,
26-
strict: bool = False,
26+
strict: bool = True,
2727
) -> "LazyNode": ...
2828

2929
# --- Serialize functions ---

wheel/src/api.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ fn deser_backrefs(blob: &[u8]) -> PyResult<LazyNode> {
120120
/// stripped before calling the underlying decoder. This makes `ser_2026` and
121121
/// `deser_2026` a symmetric pair.
122122
#[pyfunction]
123-
#[pyo3(signature = (blob, *, max_atom_len=PY_DEFAULT_MAX_ATOM_LEN, strict=false))]
123+
#[pyo3(signature = (blob, *, max_atom_len=PY_DEFAULT_MAX_ATOM_LEN, strict=true))]
124124
fn deser_2026(blob: &[u8], max_atom_len: usize, strict: bool) -> PyResult<LazyNode> {
125125
let mut a = Allocator::new();
126126
let node = node_from_bytes_serde_2026(&mut a, blob, max_atom_len, strict).map_err(|e| {
@@ -145,7 +145,7 @@ fn deser_2026(blob: &[u8], max_atom_len: usize, strict: bool) -> PyResult<LazyNo
145145
/// an auto-switching counterpart. Consensus-aware callers should sniff the
146146
/// prefix themselves and use their own caps.
147147
#[pyfunction]
148-
#[pyo3(signature = (blob, *, max_atom_len=PY_DEFAULT_MAX_ATOM_LEN, strict=false))]
148+
#[pyo3(signature = (blob, *, max_atom_len=PY_DEFAULT_MAX_ATOM_LEN, strict=true))]
149149
fn deser_auto(blob: &[u8], max_atom_len: usize, strict: bool) -> PyResult<LazyNode> {
150150
let mut a = Allocator::new();
151151
let node = if let Some(body) = blob.strip_prefix(SERDE_2026_MAGIC_PREFIX.as_slice()) {

0 commit comments

Comments
 (0)