fix produceBlock response to return correct type (#2792)

This commit is contained in:
Jacek Sieka 2021-08-18 11:00:16 +02:00 committed by GitHub
parent 6e46445da2
commit bfe5e74607
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -201,7 +201,7 @@ proc installValidatorApiHandlers*(router: var RestRouter, node: BeaconNode) =
else:
case message.kind
of BeaconBlockFork.Phase0:
RestApiResponse.jsonResponse(message.phase0Block)
RestApiResponse.jsonResponse(message.phase0Block.message)
of BeaconBlockFork.Altair:
return RestApiResponse.jsonError(Http400, BlockProduceError)
@ -265,11 +265,11 @@ proc installValidatorApiHandlers*(router: var RestRouter, node: BeaconNode) =
case message.kind
of BeaconBlockFork.Phase0:
RestApiResponse.jsonResponse(
(version: "phase0", data: message.phase0Block)
(version: "phase0", data: message.phase0Block.message)
)
of BeaconBlockFork.Altair:
RestApiResponse.jsonResponse(
(version: "altair", data: message.altairBlock)
(version: "altair", data: message.altairBlock.message)
)
# https://ethereum.github.io/eth2.0-APIs/#/Validator/produceAttestationData