Improve error handling in TestBlockSync

I managed to run into this error case and was unsure about the reason
until I added this error handling. So I think it is worth it to spend the
extra three lines to get a proper error message.
This commit is contained in:
Karl Bartel 2024-08-21 13:57:13 +02:00
parent 733fcbbc65
commit 51c42bc2ba

View file

@ -70,7 +70,10 @@ func TestBlockSync(t *testing.T) {
t.Helper() t.Helper()
var expNumber, headNumber uint64 var expNumber, headNumber uint64
if expHead != nil { if expHead != nil {
p, _ := expHead.ExecutionPayload() p, err := expHead.ExecutionPayload()
if err != nil {
t.Fatalf("expHead.ExecutionPayload() failed: %v", err)
}
expNumber = p.NumberU64() expNumber = p.NumberU64()
} }
select { select {