-
Notifications
You must be signed in to change notification settings - Fork 56
Closed
Milestone
Description
At the moment RawUInt64.compact may return a number or a number[]. This is confusing for the clients as they may expect not to overflow and always get a nice int number.
it('should compact UInt64 number', () => {
const notOverflowed = UInt64.fromNumericString('44444')
expect(notOverflowed.toString()).to.be.equal('44444');
expect(notOverflowed.compact()).to.be.equal(44444);
const overflowed = UInt64.fromNumericString('18446744073709551614')
expect(overflowed.toString()).to.be.equal('18446744073709551614');
expect(overflowed.compact()).to.be.equal([ 4294967294, 4294967295 ]);
});
TSK sdk needs to add the types here https://github.com/nemtech/symbol-sdk-typescript-javascript/blob/master/src/core/format/RawUInt64.ts#L34 and tracks down possible caller problems.
Metadata
Metadata
Assignees
Labels
No labels