Closed dzmitry-lahoda closed 3 months ago
Thanks for the contribution!
I'll work on reviewing this (have to learn about borsh first). Will try to get back asap
So what I saw from impl. It is hard to get le bytes of number like u35. Really I can borsh it into 5 bytes. While doing it for 8 now. So support getting LE bytes minimally needed would be awesome, not underlying.
@danlehmann about tests. I tested that arbitrary ints work same as native primitive ints, minus some well know diff. hence I tested layout, but in the way that I did not plug exact binary values. this approach allows to extend these tests to property tests and doing meta tests over all serdes/schemas option.
I'd like to have full binary tests for these. Right now, there are many incorrect implementations that would pass those tests.
However, we can merge and I'll work on the test in a follow-up. Please give me a day or two
This patch didn't actually build (see https://github.com/danlehmann/arbitrary-int/actions/runs/10065181794/job/27823714420)
Working on a fix now
Reworked things somewhat: https://github.com/danlehmann/arbitrary-int/pull/45
@dzmitry-lahoda Please take a look at https://github.com/danlehmann/arbitrary-int/pull/45 . That adds a lot of test coverage, removes the allocation in deserialize and simplifies serialize.
Review appreciated.
ping @danlehmann.