Updated Utils and BigNumberFormatter to handle hex edge cases #306
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The current web3.php was mysteriously returning numbers like this:
70706864786e6862
instead of the full hex from numbers like70706864786e6862000000000000000000000000000000000000000000000026
. It happens only in the edge case where the hex has a single 'e' in it. These changes fix that scenario.If you're wondering how we found this out, we ran into an edge case with
tokenIds
in our NFT Smart Contract when we started generating token IDs of the formseriesId + autoIndex
. It just so happened that ourseriesId
had a singlee
in it. And PHP'sis_numeric
interprets numbers of the form '123e456' to be decimal representations of large numbers!