This commits fixes the flat encoding and decoding (and consequently,
the zigzag) for large integers in the following ways:
- It removes support for encoding and decoding i128 values.
- It optionally (feature = "num-bigint") introduces encoding and
decoding of large sized integers through the num-bigint::BigInt
type.
Without the feature enabled, it is still possible to encode and decode
isize values; but the use of i128 is now prohibited (as it would
overflow on boundaries) in favor of arbitrarily sized integers.
The commit also introduces a missing property roundtrip for encoding
and decoding large integers, which was missing and thus, failed to
identify the overflow problem.
See related issue: https://github.com/aiken-lang/aiken/issues/796
Nothing new is going on within the code itself.
I simply popped the crate into pallas_codec
as a submodule `pallas_codec::flat`. I also moved
over the tests that we had in the crate. In general
this is in solid shape and hasn't had any changes for
months. That said there could be some things that require love
like dealing with BigInt.
Co-authored-by: Kasey White <kwhitemsg@gmail.com>