In primitives/src/coin.rs there is a comment in the Deserialize implementation which says:
Check that the value does not exceed Javascript's Number.MAX_SAFE_INTEGER.
Shouldn't we check that then on serialization too? Serialization is currently auto-derived and thus just serializes the u64 even if it's greater than Javascripts MAX_SAFE_INTEGER.
In
primitives/src/coin.rs
there is a comment in theDeserialize
implementation which says:Shouldn't we check that then on serialization too? Serialization is currently auto-derived and thus just serializes the
u64
even if it's greater than JavascriptsMAX_SAFE_INTEGER
.Also the
checked_add
should check this.