-
Notifications
You must be signed in to change notification settings - Fork 51
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
Adds a dictionary of event args/data to Event type for easier access to variables #60
Open
kibagateaux
wants to merge
25
commits into
vyperlang:master
Choose a base branch
from
kibagateaux:fix/event-data-access
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
kibagateaux
force-pushed
the
fix/event-data-access
branch
from
January 23, 2023 19:22
dc9478d
to
48641f5
Compare
kibagateaux
force-pushed
the
fix/event-data-access
branch
from
January 23, 2023 20:29
605887d
to
9c1f958
Compare
kibagateaux
force-pushed
the
fix/event-data-access
branch
from
January 24, 2023 07:46
683ade0
to
481b7f5
Compare
kibagateaux
force-pushed
the
fix/event-data-access
branch
from
January 25, 2023 15:58
426549c
to
b2da209
Compare
kibagateaux
force-pushed
the
fix/event-data-access
branch
from
January 25, 2023 16:02
b2da209
to
ee50b01
Compare
bout3fiddy
reviewed
Jan 25, 2023
boa/vyper/event.py
Outdated
return dict(self._get_ordered_args()) | ||
|
||
@functools.cached_property | ||
def _get_ordered_args(self) -> List[Tuple[str, str | int]]: |
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.
Since it is a cached property, I’d just call it something else other than a getter. ‘ordered_args’ is good enough.
It’s missing a pre-commit run. Also some simple tests using a mock contract will help quite a bit! Something like what you have in your repo, but minimal. |
so it actually demonstrates that invariant testing is working
kibagateaux
force-pushed
the
fix/event-data-access
branch
from
July 5, 2023 10:54
0454021
to
0798330
Compare
kibagateaux
force-pushed
the
fix/event-data-access
branch
from
July 5, 2023 11:01
0798330
to
7dea3c3
Compare
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.
Description
Updates Event type in
boa/vyper/events.py
Allows access to event data with event variable names e.g.
contract.get_logs()[0].args_map['my_event_variable']
Event._get_ordered_args
from currentEvent.__repr__
codeEvent.__repr__
to useEvent._get_ordered_args
args_map
property to Event typeargs_map
dictionary fromEvent._get_ordered_args
_get_ordered_args
andargs_map
TODO
[x] Convert event values to appropriate type. Currently all values are strings which makes comparing numbers cumbersome (always have to do
event.args_map['my_int'] == str(my_int)
)Testing
ape test --network=::foundry --cache-clear -m "event_emissions"