diff --git a/beacon_chain/spec/eth2_apis/rest_beacon_calls.nim b/beacon_chain/spec/eth2_apis/rest_beacon_calls.nim index 285b838bc..eadb36435 100644 --- a/beacon_chain/spec/eth2_apis/rest_beacon_calls.nim +++ b/beacon_chain/spec/eth2_apis/rest_beacon_calls.nim @@ -116,45 +116,6 @@ proc publishBlock*(body: bellatrix.SignedBeaconBlock): RestPlainResponse {. meth: MethodPost.} ## https://ethereum.github.io/beacon-APIs/#/Beacon/publishBlock -proc getBlockPlain*(block_id: BlockIdent): RestPlainResponse {. - rest, endpoint: "/eth/v1/beacon/blocks/{block_id}", - accept: preferSSZ, - meth: MethodGet.} - ## https://ethereum.github.io/beacon-APIs/#/Beacon/getBlock - -proc getBlock*(client: RestClientRef, block_id: BlockIdent, - restAccept = ""): Future[ForkedSignedBeaconBlock] {.async.} = - let resp = - if len(restAccept) > 0: - await client.getBlockPlain(block_id, restAcceptType = restAccept) - else: - await client.getBlockPlain(block_id) - let data = - case resp.status - of 200: - if resp.contentType.isNone() or - isWildCard(resp.contentType.get().mediaType): - raise newException(RestError, "Missing or incorrect Content-Type") - else: - let mediaType = resp.contentType.get().mediaType - if mediaType == ApplicationJsonMediaType: - let blck = decodeBytes(GetBlockResponse, resp.data, - resp.contentType).valueOr: - raise newException(RestError, $error) - ForkedSignedBeaconBlock.init(blck.data) - elif mediaType == OctetStreamMediaType: - let blck = decodeBytes(GetPhase0BlockSszResponse, resp.data, - resp.contentType).valueOr: - raise newException(RestError, $error) - ForkedSignedBeaconBlock.init(blck) - else: - raise newException(RestError, "Unsupported Content-Type") - of 400, 404, 500: - raiseGenericError(resp) - else: - raiseUnknownStatusError(resp) - return data - proc getBlockV2Plain*(block_id: BlockIdent): RestPlainResponse {. rest, endpoint: "/eth/v2/beacon/blocks/{block_id}", accept: preferSSZ, diff --git a/beacon_chain/spec/eth2_apis/rest_debug_calls.nim b/beacon_chain/spec/eth2_apis/rest_debug_calls.nim index bfec97e7e..3ced74c84 100644 --- a/beacon_chain/spec/eth2_apis/rest_debug_calls.nim +++ b/beacon_chain/spec/eth2_apis/rest_debug_calls.nim @@ -16,55 +16,6 @@ import export chronos, client, rest_types, eth2_rest_serialization -proc getStatePlain*(state_id: StateIdent): RestPlainResponse {. - rest, endpoint: "/eth/v1/debug/beacon/states/{state_id}", - accept: preferSSZ, - meth: MethodGet.} - ## https://ethereum.github.io/beacon-APIs/#/Beacon/getState - -proc getState*(client: RestClientRef, state_id: StateIdent, - restAccept = ""): Future[phase0.BeaconState] {.async.} = - let resp = - if len(restAccept) > 0: - await client.getStatePlain(state_id, restAcceptType = restAccept) - else: - await client.getStatePlain(state_id) - let data = - case resp.status - of 200: - if resp.contentType.isNone() or - isWildCard(resp.contentType.get().mediaType): - raise newException(RestError, "Missing or incorrect Content-Type") - else: - let mediaType = resp.contentType.get().mediaType - if mediaType == ApplicationJsonMediaType: - let state = decodeBytes(GetStateResponse, resp.data, - resp.contentType).valueOr: - raise newException(RestError, $error) - state.data - elif mediaType == OctetStreamMediaType: - let state = decodeBytes(GetPhase0StateSszResponse, resp.data, - resp.contentType).valueOr: - raise newException(RestError, $error) - state - else: - raise newException(RestError, "Unsupported content-type") - of 400, 404, 500: - let error = - block: - let res = decodeBytes(RestGenericError, resp.data, resp.contentType) - if res.isErr(): - let msg = "Incorrect response error format (" & $resp.status & - ") [" & $res.error() & "]" - raise newException(RestError, msg) - res.get() - let msg = "Error response (" & $resp.status & ") [" & error.message & "]" - raise newException(RestError, msg) - else: - let msg = "Unknown response status error (" & $resp.status & ")" - raise newException(RestError, msg) - return data - proc getDebugChainHeads*(): RestResponse[GetDebugChainHeadsResponse] {. rest, endpoint: "/eth/v1/debug/beacon/heads", meth: MethodGet.} diff --git a/beacon_chain/spec/eth2_apis/rest_validator_calls.nim b/beacon_chain/spec/eth2_apis/rest_validator_calls.nim index e9bebd4a1..1f74a7ce3 100644 --- a/beacon_chain/spec/eth2_apis/rest_validator_calls.nim +++ b/beacon_chain/spec/eth2_apis/rest_validator_calls.nim @@ -34,13 +34,6 @@ proc getSyncCommitteeDuties*(epoch: Epoch, meth: MethodPost.} ## https://ethereum.github.io/beacon-APIs/#/Validator/getSyncCommitteeDuties -proc produceBlock*(slot: Slot, randao_reveal: ValidatorSig, - graffiti: GraffitiBytes - ): RestResponse[ProduceBlockResponse] {. - rest, endpoint: "/eth/v1/validator/blocks/{slot}", - meth: MethodGet.} - ## https://ethereum.github.io/beacon-APIs/#/Validator/produceBlock - proc produceBlockV2*(slot: Slot, randao_reveal: ValidatorSig, graffiti: GraffitiBytes ): RestResponse[ProduceBlockResponseV2] {.