Closed quocle108 closed 1 year ago
Thanks for the excellent bug report.
There appears to be an oversight in fc's json conversion that doesn't stringify small values that can't be represented in a javascript number: -90909090909090909 is smaller than -(253 - 1)
This would only be a problem when consuming the JSON returned from a trace via javascript though (i.e. cleos is fine); but that's likely what is happening here since using reporter is using qtest
This would only be a problem when consuming the JSON returned from a trace via javascript though (i.e. cleos is fine); but that's likely what is happening here since using reporter is using qtest
it might be. Qtest gets the return value from eosjs. And javascript use Number (64-bit Floating Point) to present the number value, so rounding the number might be the issue?
BTW, it should be returned string in both cases even the value i > 0xffffffff or <= 0xffffffff.
Right, that number cannot be represented in a javascript primitive type. Just running
let x = -90909090909090909;
console.log(x);
in node,
$ node num.js
-90909090909090910
It would need to be represented as a bigint (or string).
I expected to receive an action value is -90909090909090909. But the action return the value is -90909090909090910
You can reproduce this issue through this repo https://github.com/quocle108/return-error