Refactor ABI generation#2284
Merged
iamdefinitelyahuman merged 8 commits intoJan 25, 2021
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2284 +/- ##
==========================================
+ Coverage 85.42% 85.49% +0.06%
==========================================
Files 84 84
Lines 8586 8583 -3
Branches 2078 2076 -2
==========================================
+ Hits 7335 7338 +3
+ Misses 748 745 -3
+ Partials 503 500 -3
Continue to review full report at Codecov.
|
fubuloubu
approved these changes
Jan 25, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What I did
Refactor the ABI generation logic to happen within the new type objects.
How I did it
_metadataattribute to all node objects. This is an all-purpose dict for annotating nodes with information that doesn't strictly belong in the AST. For now it's being used very sparingly, but this is the approach I'm envisioning for passing type-check info into LLL gen. So good to discuss it now while there aren't many places to change it, if desired.to_abi_dictmethods toContractFunction,EventandInterfacePrimitiveobjects. The logic is largely copied from the oldEventSignatureandFunctionSignatureobjects.InterfacePrimitivefrom the top-level node during type checking, and add it to the_metadataso it can be used to build the ABI.signatures/How to verify it
Run the test suite. There is already extensive coverage around ABI generation.
Cute Animal Picture