Skip to content

Commit

Permalink
feat: handle bidtrace 404
Browse files Browse the repository at this point in the history
  • Loading branch information
blombern committed Feb 12, 2024
1 parent 527599e commit 77dde8a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions datastore/auction_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ func GetPayloadContents(slot uint64, proposerPubkey, blockHash string) (*builder
if err != nil {
return nil, err
}
defer resp.Body.Close()

if resp.StatusCode == 404 {
return nil, ErrExecutionPayloadNotFound
Expand Down Expand Up @@ -60,6 +61,11 @@ func GetBidTrace(slot uint64, proposerPubkey, blockHash string) (*common.BidTrac
if err != nil {
return nil, err
}
defer resp.Body.Close()

if resp.StatusCode == 404 {
return nil, ErrBidTraceNotFound
}

body, err := io.ReadAll(resp.Body)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions datastore/datastore.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
)

var ErrExecutionPayloadNotFound = errors.New("execution payload not found")
var ErrBidTraceNotFound = errors.New("bidtrace not found")

type GetHeaderResponseKey struct {
Slot uint64
Expand Down

0 comments on commit 77dde8a

Please sign in to comment.