(queryUrl string)
| 165 | } |
| 166 | |
| 167 | func (a *API) queryElBlockNumberAndKzg(queryUrl string) (uint64, []string, *httpError) { |
| 168 | resp, err := http.Get(queryUrl) |
| 169 | if err != nil { |
| 170 | return 0, nil, errServerError |
| 171 | } |
| 172 | defer resp.Body.Close() |
| 173 | |
| 174 | respObj := &struct { |
| 175 | Data struct { |
| 176 | Message struct { |
| 177 | Body struct { |
| 178 | ExecutionPayload struct { |
| 179 | BlockNumber string `json:"block_number"` |
| 180 | } `json:"execution_payload"` |
| 181 | BlobKzgCommitments []string `json:"blob_kzg_commitments"` |
| 182 | } `json:"body"` |
| 183 | } `json:"message"` |
| 184 | } `json:"data"` |
| 185 | }{} |
| 186 | err = json.NewDecoder(resp.Body).Decode(&respObj) |
| 187 | if err != nil { |
| 188 | return 0, nil, errUnknownBlock |
| 189 | } |
| 190 | body := respObj.Data.Message.Body |
| 191 | elBlock, err := strconv.ParseUint(body.ExecutionPayload.BlockNumber, 10, 64) |
| 192 | if err != nil { |
| 193 | return 0, nil, errUnknownBlock |
| 194 | } |
| 195 | return elBlock, body.BlobKzgCommitments, nil |
| 196 | } |
| 197 | |
| 198 | // Deprecated since Fusaka |
| 199 | func (a *API) buildSidecar(kvIndex uint64, kzgCommitment []byte, blobHash common.Hash) (*BlobSidecar, *httpError) { |
no test coverage detected