-
-
Notifications
You must be signed in to change notification settings - Fork 793
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: adding Enum #2874
feat: adding Enum #2874
Conversation
This pull request introduces 6 alerts when merging e5487e1 into 42a372e - view on LGTM.com new alerts:
|
vyper/semantics/types/user/enum.py
Outdated
return Enum(abi["name"], abi["inputs"]) | ||
|
||
@classmethod | ||
def from_EnumDef(cls, base_node: vy_ast.EventDef) -> "Enum": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def from_EnumDef(cls, base_node: vy_ast.EventDef) -> "Enum": | |
def from_EnumDef(cls, base_node: vy_ast.EnumDef) -> "Enum": |
vyper/semantics/types/user/enum.py
Outdated
|
||
Arguments | ||
--------- | ||
base_node : EventDef |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
base_node : EventDef | |
base_node : EnumDef |
vyper/semantics/types/user/enum.py
Outdated
@classmethod | ||
def from_EnumDef(cls, base_node: vy_ast.EventDef) -> "Enum": | ||
""" | ||
Generate an `Event` object from a Vyper ast node. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generate an `Event` object from a Vyper ast node. | |
Generate an `Enum` object from a Vyper ast node. |
This pull request introduces 6 alerts when merging 612d2bd into 67bb98a - view on LGTM.com new alerts:
|
This pull request introduces 5 alerts when merging 4f07fa6 into 67bb98a - view on LGTM.com new alerts:
|
Codecov Report
@@ Coverage Diff @@
## master #2874 +/- ##
==========================================
+ Coverage 87.69% 87.95% +0.26%
==========================================
Files 94 95 +1
Lines 10196 10355 +159
Branches 2504 2498 -6
==========================================
+ Hits 8941 9108 +167
- Misses 790 792 +2
+ Partials 465 455 -10
Continue to review full report at Codecov.
|
This pull request introduces 10 alerts when merging af12e16 into 67bb98a - view on LGTM.com new alerts:
|
This pull request introduces 10 alerts when merging de0717a into 67bb98a - view on LGTM.com new alerts:
|
This pull request introduces 10 alerts when merging 843b19d into 67bb98a - view on LGTM.com new alerts:
|
This pull request introduces 9 alerts when merging 61cedc7 into 67bb98a - view on LGTM.com new alerts:
|
This pull request introduces 9 alerts when merging f2dd34a into 67bb98a - view on LGTM.com new alerts:
|
This pull request introduces 8 alerts and fixes 5 when merging 4fb2ede into f5051e1 - view on LGTM.com new alerts:
fixed alerts:
|
whoops, re-requested review but maybe needs some more tests. still in draft mode |
This pull request introduces 2 alerts when merging 2593c62 into f5051e1 - view on LGTM.com new alerts:
|
lgtm, but i contributed some work to this and so we should get a review from @fubuloubu as well. |
one q i have is whether we should introduce any conventions around naming of enum members. options: enum Action:
buy
sell enum Action:
Buy
Sell enum Action:
BUY
SELL |
Typically this is the way enums are usually specified enum Action:
BUY
SELL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nits on naming
Co-authored-by: El De-dog-lo <3859395+fubuloubu@users.noreply.github.com>
What I did
Adding enums to vyper
fixes: #2319
How I did it
How to verify it
Commit message
Commit message for the final, squashed PR. (Optional, but reviewers will appreciate it! Please see our commit message style guide for what we would ideally like to see in a commit message.)
Description for the changelog
Cute Animal Picture