(rw http.ResponseWriter, r *http.Request)
| 193 | } |
| 194 | |
| 195 | func (a *explorerAPI) GetBlockV3(rw http.ResponseWriter, r *http.Request) { |
| 196 | vars := mux.Vars(r) |
| 197 | |
| 198 | dbID, err := a.getDBID(vars) |
| 199 | if err != nil { |
| 200 | sendResponse(400, false, err, nil, rw) |
| 201 | return |
| 202 | } |
| 203 | |
| 204 | h, err := a.getHash(vars) |
| 205 | if err != nil { |
| 206 | sendResponse(400, false, err, nil, rw) |
| 207 | return |
| 208 | } |
| 209 | |
| 210 | count, height, block, err := a.service.getBlock(dbID, h) |
| 211 | if err != nil { |
| 212 | sendResponse(500, false, err, nil, rw) |
| 213 | return |
| 214 | } |
| 215 | |
| 216 | op := newPaginationFromReq(r) |
| 217 | |
| 218 | sendResponse(200, true, "", a.formatBlockV3(count, height, block, op), rw) |
| 219 | } |
| 220 | |
| 221 | func (a *explorerAPI) GetBlockByCount(rw http.ResponseWriter, r *http.Request) { |
| 222 | vars := mux.Vars(r) |
nothing calls this directly
no test coverage detected