Add unsigned integers in Env V4
These would be integers that are not better than signed integers, they just behave a bit differently on some operations, e.g. comparison.
lib_sapling
uses ctypes
which uses integers
which offers UInt8
, UInt16
, UInt32
, UInt64
, UInt
, and others. Whether it's the API we want to use is debatable.
We probably need to extend their usage in the rest of the shell codebase too, e.g. data-encoding uint
encodings could work on these types.
The goal is to make the code cleaner by using the most adapted type to the data it will handle, e.g. there are cases of unsigned integers implemented with int, asserts are used to guarantee values can't be negative, but relying on the type system seems stronger, isn't it?
Underflows and overflows are nor better neither worse than signed integers, one has to be as careful when using them.