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

🧪 Use toUtf8Bytes to fix some keccak256 tests #164

Merged
merged 1 commit into from
Sep 12, 2022

Conversation

larskarbo
Copy link
Contributor

@larskarbo larskarbo commented Sep 12, 2022

When decoding logs it can be useful to calculate the keccak256 hash of a string like "Transfer(address,address,uint256)".

The way you do this in ethers.js and essential-eth is:

keccak256(toUtf8Bytes("Transfer(address,address,uint256)"))

This PR uncomments some tests that had strings, and makes them run by adding a toUtf8Bytes step.

@dawsbot dawsbot merged commit 91e0434 into dawsbot:master Sep 12, 2022
@dawsbot
Copy link
Owner

dawsbot commented Sep 12, 2022

Great fix @larskarbo! Thank you for the contribution 🙏

@dawsbot dawsbot changed the title Use toUtf8Bytes to fix some keccak256 tests 🧼 Use toUtf8Bytes to fix some keccak256 tests Sep 12, 2022
@dawsbot dawsbot changed the title 🧼 Use toUtf8Bytes to fix some keccak256 tests 🧪 Use toUtf8Bytes to fix some keccak256 tests Sep 12, 2022
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.

None yet

2 participants