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

common: Added {Address,Hash}.IsZero() #29740

Closed
wants to merge 1 commit into from

Conversation

lmittmann
Copy link
Contributor

Small PR that adds the utility functions Address.IsZero and Hash.IsZero that report if the address or hash has the zero value. The check for the zero value is common and kind of unpleasant (addr == (common.Address{})). Geth alone contains 218 such checks (v1.14.2).

@karalabe
Copy link
Member

karalabe commented May 9, 2024

You're not the first one. I don't think this is gonna fly :)

#29645

@karalabe karalabe closed this May 9, 2024
@lmittmann
Copy link
Contributor Author

I understand that you don't want to touch so many places in the code at once (this PR doesn't). People are using this code base as a lib as well, and this is a small but nice extension, that fits with the third common primitive type uint256.Int. cc @holiman

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