Commit a76ffb5
ethclient: fix error handling for header test (ethereum#22514)
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.1 parent 2d01deb commit a76ffb5
1 file changed
+5
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
291 | | - | |
292 | | - | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
293 | 294 | | |
294 | 295 | | |
295 | 296 | | |
| |||
299 | 300 | | |
300 | 301 | | |
301 | 302 | | |
302 | | - | |
| 303 | + | |
303 | 304 | | |
304 | 305 | | |
305 | | - | |
| 306 | + | |
306 | 307 | | |
307 | 308 | | |
308 | 309 | | |
| |||
0 commit comments