Skip to content

Commit b4eb150

Browse files
authored
Revert restAccept workaround. (#3369)
Bump fixed version of nim-presto.
1 parent 47b1870 commit b4eb150

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed

beacon_chain/spec/eth2_apis/rest_beacon_calls.nim

+2-6
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,7 @@ proc getBlockPlain*(block_id: BlockIdent): RestPlainResponse {.
116116
## https://ethereum.github.io/beacon-APIs/#/Beacon/getBlock
117117

118118
proc getBlock*(client: RestClientRef, block_id: BlockIdent,
119-
restAccept = preferSSZ): Future[ForkedSignedBeaconBlock] {.async.} =
120-
# TODO restAccept should be "" by default, but for some reason that doesn't
121-
# work
119+
restAccept = ""): Future[ForkedSignedBeaconBlock] {.async.} =
122120
let resp =
123121
if len(restAccept) > 0:
124122
await client.getBlockPlain(block_id, restAcceptType = restAccept)
@@ -162,12 +160,10 @@ proc getBlockV2Plain*(block_id: BlockIdent): RestPlainResponse {.
162160

163161
proc getBlockV2*(client: RestClientRef, block_id: BlockIdent,
164162
cfg: RuntimeConfig,
165-
restAccept = preferSSZ): Future[Option[ForkedSignedBeaconBlock]] {.
163+
restAccept = ""): Future[Option[ForkedSignedBeaconBlock]] {.
166164
async.} =
167165
# Return the asked-for block, or None in case 404 is returned from the server.
168166
# Raises on other errors
169-
# TODO restAccept should be "" by default, but for some reason that doesn't
170-
# work
171167
let resp =
172168
if len(restAccept) > 0:
173169
await client.getBlockV2Plain(block_id, restAcceptType = restAccept)

beacon_chain/spec/eth2_apis/rest_debug_calls.nim

+3-7
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ proc getStatePlain*(state_id: StateIdent): RestPlainResponse {.
2020
## https://ethereum.github.io/beacon-APIs/#/Beacon/getState
2121

2222
proc getState*(client: RestClientRef, state_id: StateIdent,
23-
restAccept = preferSSZ): Future[phase0.BeaconState] {.async.} =
24-
# TODO restAccept should be "" by default, but for some reason that doesn't
25-
# work
23+
restAccept = ""): Future[phase0.BeaconState] {.async.} =
2624
let resp =
2725
if len(restAccept) > 0:
2826
await client.getStatePlain(state_id, restAcceptType = restAccept)
@@ -80,12 +78,10 @@ proc getStateV2Plain*(state_id: StateIdent): RestPlainResponse {.
8078
## https://ethereum.github.io/beacon-APIs/#/Debug/getStateV2
8179

8280
proc getStateV2*(client: RestClientRef, state_id: StateIdent,
83-
cfg: RuntimeConfig,
84-
restAccept = preferSSZ): Future[ref ForkedHashedBeaconState] {.async.} =
81+
cfg: RuntimeConfig, restAccept = ""
82+
): Future[ref ForkedHashedBeaconState] {.async.} =
8583
# nil is returned if the state is not found due to a 404 - `ref` is needed
8684
# to manage stack usage
87-
# TODO restAccept should be "" by default, but for some reason that doesn't
88-
# work
8985
let resp =
9086
if len(restAccept) > 0:
9187
await client.getStateV2Plain(state_id, restAcceptType = restAccept)

0 commit comments

Comments
 (0)