Skip to content

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.

2 participants