-
Notifications
You must be signed in to change notification settings - Fork 160
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
Events: Support indexed array attributes in tests #87
Labels
Comments
We would gladly merge a PR that adds this functionality! |
sz-piotr
added
good first issue
Good for newcomers
help wanted
Extra attention is needed
labels
Dec 20, 2019
@sz-piotr I have a simple PR for that. Can you give me the creds to push a branch ? |
@zgorizzo69 You can fork the repository and open a PR this way :) |
Shouldn't this one be closed? @sz-piotr ? |
Thanks @wachulski |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The current
to.emit().withArgs()
matcher does not support indexed (variable length) arrays. Indexed attributes must be fixed size (32 bytes), so solidity stores a hash of the array content. This is not checked for and the comparison in a test fails.Example contract:
Example test case:
The
actualArgs.values
in matchers.ts line 113 contains the following:Which is not unexpected, but the comparison fails for the indexed argument. When passing an object in the test (i.e.
{ hash: '0xb10...' }
instead of the0x0..01
string), the comparison fails as well.It would be great to have a simple way to test indexed attributes.
The text was updated successfully, but these errors were encountered: