Revert restAccept workaround. (#3369)

Bump fixed version of nim-presto.
This commit is contained in:
Eugene Kabanov 2022-02-11 13:01:45 +02:00 committed by GitHub
parent 47b1870100
commit b4eb150b9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 14 deletions

View File

@ -116,9 +116,7 @@ proc getBlockPlain*(block_id: BlockIdent): RestPlainResponse {.
## https://ethereum.github.io/beacon-APIs/#/Beacon/getBlock
proc getBlock*(client: RestClientRef, block_id: BlockIdent,
restAccept = preferSSZ): Future[ForkedSignedBeaconBlock] {.async.} =
# TODO restAccept should be "" by default, but for some reason that doesn't
# work
restAccept = ""): Future[ForkedSignedBeaconBlock] {.async.} =
let resp =
if len(restAccept) > 0:
await client.getBlockPlain(block_id, restAcceptType = restAccept)
@ -162,12 +160,10 @@ proc getBlockV2Plain*(block_id: BlockIdent): RestPlainResponse {.
proc getBlockV2*(client: RestClientRef, block_id: BlockIdent,
cfg: RuntimeConfig,
restAccept = preferSSZ): Future[Option[ForkedSignedBeaconBlock]] {.
restAccept = ""): Future[Option[ForkedSignedBeaconBlock]] {.
async.} =
# Return the asked-for block, or None in case 404 is returned from the server.
# Raises on other errors
# TODO restAccept should be "" by default, but for some reason that doesn't
# work
let resp =
if len(restAccept) > 0:
await client.getBlockV2Plain(block_id, restAcceptType = restAccept)

View File

@ -20,9 +20,7 @@ proc getStatePlain*(state_id: StateIdent): RestPlainResponse {.
## https://ethereum.github.io/beacon-APIs/#/Beacon/getState
proc getState*(client: RestClientRef, state_id: StateIdent,
restAccept = preferSSZ): Future[phase0.BeaconState] {.async.} =
# TODO restAccept should be "" by default, but for some reason that doesn't
# work
restAccept = ""): Future[phase0.BeaconState] {.async.} =
let resp =
if len(restAccept) > 0:
await client.getStatePlain(state_id, restAcceptType = restAccept)
@ -80,12 +78,10 @@ proc getStateV2Plain*(state_id: StateIdent): RestPlainResponse {.
## https://ethereum.github.io/beacon-APIs/#/Debug/getStateV2
proc getStateV2*(client: RestClientRef, state_id: StateIdent,
cfg: RuntimeConfig,
restAccept = preferSSZ): Future[ref ForkedHashedBeaconState] {.async.} =
cfg: RuntimeConfig, restAccept = ""
): Future[ref ForkedHashedBeaconState] {.async.} =
# nil is returned if the state is not found due to a 404 - `ref` is needed
# to manage stack usage
# TODO restAccept should be "" by default, but for some reason that doesn't
# work
let resp =
if len(restAccept) > 0:
await client.getStateV2Plain(state_id, restAcceptType = restAccept)

2
vendor/nim-presto vendored

@ -1 +1 @@
Subproject commit 22746c5cd20522176a4a4de1d660c735087517e9
Subproject commit 668a2369f666e0753983ae34eaa88363a6dd823c