Skip to content

RawUInt64 compact missing types. #507

@fboucquez

Description

@fboucquez

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions