-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
bugVerified to be an issue.Verified to be an issue.fixed/completeThis Bug is fixed or Enhancement is complete and published.This Bug is fixed or Enhancement is complete and published.
Description
When decoding an event like Foo(uint256 a)
, I end up with an object like:
{ /*...*/, values: { a: { _hex: '0x5' } } }
I would have expected a BigNumber here, or barring that a hex encoded string. _
prefixed property names are usually internal, so I am hesitant to write code that relies or reading that. Also, non-number values are stored without the inner-most object, so just { b: '0xabcd1234' }
, which makes number values odd.
After a significant amount of digging I found the issue is in the way it "freezes" the values
key. It does JSON.stringify
then JSON.parse
on it, which results in stripping the prototype from all of the methods and leaving only the _hex
internal variable of the original BigNumber object.
Metadata
Metadata
Assignees
Labels
bugVerified to be an issue.Verified to be an issue.fixed/completeThis Bug is fixed or Enhancement is complete and published.This Bug is fixed or Enhancement is complete and published.