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

Fix bug in CREATE2 address generation + add test #1378

Merged
merged 1 commit into from Oct 9, 2018

Conversation

cburgdorf
Copy link
Contributor

@cburgdorf cburgdorf commented Oct 9, 2018

What was wrong?

The generated address for the new CREATE2 opcode turned out to be wrong. By the time that I implemented it, there were no test cases so the implementation was a shot in the dark (and still kinda is, as this only partly covers what CREATE2 does).

Now we do have test cases and they discovered a bug in our implementation.

How was it fixed?

Correctly interpret salt + add tests.

Cute Animal Picture

put a cute animal picture link inside the parentheses

@cburgdorf cburgdorf force-pushed the christoph/fix/create2 branch 3 times, most recently from fdd5b3a to 09bcbd8 Compare October 9, 2018 14:55
@cburgdorf cburgdorf changed the title Christoph/fix/create2 Fix bug in CREATE2 address generation + add test Oct 9, 2018
decode_hex(code)
)

assert to_checksum_address(encode_hex(address)) == expected
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is generally fine, but our idiomatic way to compare addresses is to use eth_utils.is_same_address which handles comparison of differently formatted addresses.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, now that you mentions it, I remember you mentioned it before 😅 Fixed it.

@cburgdorf cburgdorf merged commit e02e066 into ethereum:master Oct 9, 2018
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