Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

Skip events when parsing the ABI from JSON #17

Merged
merged 5 commits into from
Nov 19, 2018

Conversation

maxholman
Copy link
Contributor

@maxholman maxholman commented Nov 18, 2018

This PR stops the ABI parsing from looking at anything but functions, avoiding some erroneous errors.

Bonus: typings + trailing whitespace fixes

Fixes #13

@simolus3
Copy link
Owner

Hm, if we use that approach, constructors and the default fallback function will no longer be available, right? What if we just put that

var type = element["type"];
if (type == "event") 
        continue;

right at the beginning of that for-loop? That should fix the mentioned issue as well without breaking constructors and fallback functions. Or is there anything I'm not seeing here?

@maxholman
Copy link
Contributor Author

What if we just put that right at the beginning of that for-loop?

Oops, I didn't spot that code. That works nicely. Changes pushed 👍

@maxholman maxholman changed the title Only analyse contract functions when parsing the ABI from JSON Skip events when parsing the ABI from JSON Nov 19, 2018
Copy link
Owner

@simolus3 simolus3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good to me now. I'll try to look into the string decoding error tomorrow and then publish these changes on pub.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

StateMutability error when parsing json abi that contains an event
2 participants