You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to call a contract function with a big number in the args that is represented in the scientific format in the serialized string.
...
"A": {
"field": 7e+24,
...
}
The contract function execution fails with:
{"index":0,"kind":{"ExecutionError":"Smart contract panicked: panicked at 'Failed to deserialize input from JSON.: Error(\"expected `,` or `}`\", line: 1, column: 135)'
The column 135 is exactly the "e" character in the number "7e+24" and I think borsh can't cope with the scientific notation of numbers.
I'd expect borsh to deserialize "7e+24" into 7000000000000000000000000 just fine.
Maybe this error is also somehow intentional, because I'm trying to deserialize into a u128 and not every number with a scientific notation can be parsed into a u128. But then I'd expect a different error message, telling me that types are incompatible or so.
Hope this helps
The text was updated successfully, but these errors were encountered:
Hi there,
I'm trying to call a contract function with a big number in the args that is represented in the scientific format in the serialized string.
The contract function execution fails with:
The column 135 is exactly the "e" character in the number "7e+24" and I think borsh can't cope with the scientific notation of numbers.
I'd expect borsh to deserialize "7e+24" into 7000000000000000000000000 just fine.
Maybe this error is also somehow intentional, because I'm trying to deserialize into a u128 and not every number with a scientific notation can be parsed into a u128. But then I'd expect a different error message, telling me that types are incompatible or so.
Hope this helps
The text was updated successfully, but these errors were encountered: