Skip to content
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

Indexed array types #2060

Merged

Conversation

iamdefinitelyahuman
Copy link
Contributor

What I did

Hash non-value types when they are used as indexed topics. Closes #1699

This introduces a significant change in that we no longer convert e.g. bytes[1] to bytes1 - bytes and string arrays are always represented as bytes and string in the event ABI, regardless of length.

We can now also support use of bytes or string arrays >32 bytes, and array types.

How I did it

In vyper/parser/events.py, expanded the logic of pack_event_topics.

How to verify it

Run the tests. I had to modify quite a few based on this change, and I added some new cases to ensure that indexed topics are correct when reading variables from memory, storage, and calldata.

Cute Animal Picture

image

@iamdefinitelyahuman iamdefinitelyahuman merged commit 5357c85 into vyperlang:master Jun 28, 2020
@iamdefinitelyahuman iamdefinitelyahuman deleted the indexed-array-types branch July 4, 2020 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Array types are not hashed for event topics
2 participants