Skip to content

FF returns FF22062: Negative numeric value... for large numeric input parameters #1568

Closed
@matthew1001

Description

@matthew1001

When passing a JSON payload that contains parameters to FireFly (e.g. to deploy a contract that has constructor parameters) evmconnect returns FF22062: Negative numeric value is invalid for component %!!(MISSING)s(uint16=256)%!!(MISSING)(EXTRA string=[0]) if the numeric parameter exceeds the maximum size of a float64.

This appears to be because Golang deserialises large JSON numbers to float64 when deserialising to an interface{}, and silently loses any precision caused by the JSON number exceeding the maximum representable value of a float64.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions