-
Notifications
You must be signed in to change notification settings - Fork 80
Description
Is there an existing issue for this?
- I have searched the existing issues
Code of Conduct
- I agree to follow this project's Code of Conduct
Current Behaviour
I am getting the error Semantic(None, "invalid type: bytes, expected bytes")
Expected Behaviour
deserialization works
Environment Information
Linux 6.5.4-76060504-generic #202309191142169599894322.04~070916d SMP PREEMPT_DYNAMIC Fri S x86_64 x86_64 x86_64 GNU/Linux
Steps To Reproduce
The error is launched from here
ciborium/ciborium/src/de/mod.rs
Line 379 in 2ac91ce
| header => Err(header.expected("bytes")), |
scratch is not enough
I can reproduce the error in a downstream crate with a type implementing custom serde Serialize/Deserialize: ElementsProject/rust-elements@45bd2bf
This type is longer than 4k bytes
When I try to reproduce without the downstream crate using something like Wrap(vec) where vec is bigger than 4k bytes, things work because in this line:
ciborium/ciborium/src/de/mod.rs
Line 369 in 2ac91ce
| Header::Bytes(Some(len)) if len <= self.scratch.len() => { |
the scratch space has grown to accommodate the len of the bytes, (it is 8k even though it is initialized to 4k) while in the case of the error it's probably not growing for some reason I could not grasp yet.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status