Skip to content

Indexed array types#2060

Merged
iamdefinitelyahuman merged 3 commits into
vyperlang:masterfrom
iamdefinitelyahuman:indexed-array-types
Jun 28, 2020
Merged

Indexed array types#2060
iamdefinitelyahuman merged 3 commits into
vyperlang:masterfrom
iamdefinitelyahuman:indexed-array-types

Conversation

@iamdefinitelyahuman

Copy link
Copy Markdown
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