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

ethclient: fix error handling for header test #22514

Merged

Conversation

meowsbits
Copy link
Contributor

The wantErr field was disused, and the error
returned by ec.HeaderByNumber was not properly
tested.

This simplifies the error checking using
errors.Is and asserts that getting an expected
missing header returns ethereum.NotFound.

Also adds a nil check condition for header.Number
before using big.Int's Sign method.

Date: 2021-03-17 07:57:26-05:00
Signed-off-by: meows b5c6@protonmail.com

The wantErr field was disused, and the error
returned by ec.HeaderByNumber was not properly
tested.

This simplifies the error checking using
errors.Is and asserts that getting an expected
missing header returns ethereum.NotFound.

Also adds a nil check condition for header.Number
before using big.Int's Sign method.

Date: 2021-03-17 07:57:26-05:00
Signed-off-by: meows <b5c6@protonmail.com>
@fjl fjl merged commit aa8b218 into ethereum:master Mar 19, 2021
atif-konasl pushed a commit to frozeman/pandora-execution-engine that referenced this pull request Oct 15, 2021
The wantErr field was disused, and the error returned by HeaderByNumber
was not properly tested.

This simplifies the error checking using errors.Is and asserts that getting
an expected missing header returns ethereum.NotFound. Also adds a nil
check condition for header.Number before using big.Int's Sign method.
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