Revert restAccept workaround. (#3369)
Bump fixed version of nim-presto.
This commit is contained in:
parent
47b1870100
commit
b4eb150b9a
|
@ -116,9 +116,7 @@ proc getBlockPlain*(block_id: BlockIdent): RestPlainResponse {.
|
||||||
## https://ethereum.github.io/beacon-APIs/#/Beacon/getBlock
|
## https://ethereum.github.io/beacon-APIs/#/Beacon/getBlock
|
||||||
|
|
||||||
proc getBlock*(client: RestClientRef, block_id: BlockIdent,
|
proc getBlock*(client: RestClientRef, block_id: BlockIdent,
|
||||||
restAccept = preferSSZ): Future[ForkedSignedBeaconBlock] {.async.} =
|
restAccept = ""): Future[ForkedSignedBeaconBlock] {.async.} =
|
||||||
# TODO restAccept should be "" by default, but for some reason that doesn't
|
|
||||||
# work
|
|
||||||
let resp =
|
let resp =
|
||||||
if len(restAccept) > 0:
|
if len(restAccept) > 0:
|
||||||
await client.getBlockPlain(block_id, restAcceptType = restAccept)
|
await client.getBlockPlain(block_id, restAcceptType = restAccept)
|
||||||
|
@ -162,12 +160,10 @@ proc getBlockV2Plain*(block_id: BlockIdent): RestPlainResponse {.
|
||||||
|
|
||||||
proc getBlockV2*(client: RestClientRef, block_id: BlockIdent,
|
proc getBlockV2*(client: RestClientRef, block_id: BlockIdent,
|
||||||
cfg: RuntimeConfig,
|
cfg: RuntimeConfig,
|
||||||
restAccept = preferSSZ): Future[Option[ForkedSignedBeaconBlock]] {.
|
restAccept = ""): Future[Option[ForkedSignedBeaconBlock]] {.
|
||||||
async.} =
|
async.} =
|
||||||
# Return the asked-for block, or None in case 404 is returned from the server.
|
# Return the asked-for block, or None in case 404 is returned from the server.
|
||||||
# Raises on other errors
|
# Raises on other errors
|
||||||
# TODO restAccept should be "" by default, but for some reason that doesn't
|
|
||||||
# work
|
|
||||||
let resp =
|
let resp =
|
||||||
if len(restAccept) > 0:
|
if len(restAccept) > 0:
|
||||||
await client.getBlockV2Plain(block_id, restAcceptType = restAccept)
|
await client.getBlockV2Plain(block_id, restAcceptType = restAccept)
|
||||||
|
|
|
@ -20,9 +20,7 @@ proc getStatePlain*(state_id: StateIdent): RestPlainResponse {.
|
||||||
## https://ethereum.github.io/beacon-APIs/#/Beacon/getState
|
## https://ethereum.github.io/beacon-APIs/#/Beacon/getState
|
||||||
|
|
||||||
proc getState*(client: RestClientRef, state_id: StateIdent,
|
proc getState*(client: RestClientRef, state_id: StateIdent,
|
||||||
restAccept = preferSSZ): Future[phase0.BeaconState] {.async.} =
|
restAccept = ""): Future[phase0.BeaconState] {.async.} =
|
||||||
# TODO restAccept should be "" by default, but for some reason that doesn't
|
|
||||||
# work
|
|
||||||
let resp =
|
let resp =
|
||||||
if len(restAccept) > 0:
|
if len(restAccept) > 0:
|
||||||
await client.getStatePlain(state_id, restAcceptType = restAccept)
|
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
|
## https://ethereum.github.io/beacon-APIs/#/Debug/getStateV2
|
||||||
|
|
||||||
proc getStateV2*(client: RestClientRef, state_id: StateIdent,
|
proc getStateV2*(client: RestClientRef, state_id: StateIdent,
|
||||||
cfg: RuntimeConfig,
|
cfg: RuntimeConfig, restAccept = ""
|
||||||
restAccept = preferSSZ): Future[ref ForkedHashedBeaconState] {.async.} =
|
): Future[ref ForkedHashedBeaconState] {.async.} =
|
||||||
# nil is returned if the state is not found due to a 404 - `ref` is needed
|
# nil is returned if the state is not found due to a 404 - `ref` is needed
|
||||||
# to manage stack usage
|
# to manage stack usage
|
||||||
# TODO restAccept should be "" by default, but for some reason that doesn't
|
|
||||||
# work
|
|
||||||
let resp =
|
let resp =
|
||||||
if len(restAccept) > 0:
|
if len(restAccept) > 0:
|
||||||
await client.getStateV2Plain(state_id, restAcceptType = restAccept)
|
await client.getStateV2Plain(state_id, restAcceptType = restAccept)
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 22746c5cd20522176a4a4de1d660c735087517e9
|
Subproject commit 668a2369f666e0753983ae34eaa88363a6dd823c
|
Loading…
Reference in New Issue