Nat & Int do not support binary encoders
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 301
- Forks
- 85
- Avg merge
- 1h 4m
- Merged PRs (30d)
- 4
Description
Nat & Int use deserialize_any in their de-serialization implementation: https://github.com/dfinity/candid/blob/master/rust/candid/src/types/number.rs#L155 https://github.com/dfinity/candid/blob/master/rust/candid/src/types/number.rs#L205
most binary encoding libraries do not support deserialize_any, example
bincode: https://github.com/bincode-org/bincode
postcard: https://github.com/jamesmunns/postcard
Is using BigUint/BigInt the only way?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with rust/candid/src/types/number.rs at the Nat and Int deserialization implementations linked in the issue. Compare their use of deserialize_any with the constraints of bincode and postcard, and define a supported approach that works for binary encoders; done means Nat and Int can deserialize through those encoders without requiring an unspecified alternative.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100