Bug DescriptionTransactionExpiry.toJSON converts a TransactionExpiry to a number as a serializable representation. However, a TransactionExpiry is implemented as a number of seconds from the UNIX epoch as a bigint. Therefore, converting to a number can give imprecise results, e.g. one might not be able to convert back to a TransactionExpiry.
336 makes the method explicitly throw if the internal bigint is outside the safe range, but ideally a toJSON method should not throw errors.
Solution
Converting to a string instead would fix the problem, but this is a breaking change.
Bug Description
TransactionExpiry.toJSON
converts aTransactionExpiry
to anumber
as a serializable representation. However, aTransactionExpiry
is implemented as a number of seconds from the UNIX epoch as abigint
. Therefore, converting to anumber
can give imprecise results, e.g. one might not be able to convert back to aTransactionExpiry
.336 makes the method explicitly throw if the internal
bigint
is outside the safe range, but ideally atoJSON
method should not throw errors.Solution Converting to a
string
instead would fix the problem, but this is a breaking change.