From f9cd98702e94b551259f36f5941a58204214775c Mon Sep 17 00:00:00 2001 From: Eugene Kabanov Date: Sat, 24 Jul 2021 20:22:05 +0300 Subject: [PATCH] Fix getBlockHeaders() should return array. (#2732) Fix tests. --- beacon_chain/rpc/beacon_rest_api.nim | 4 ++-- ncli/resttest-rules.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/beacon_chain/rpc/beacon_rest_api.nim b/beacon_chain/rpc/beacon_rest_api.nim index 53c5fb250..4e49f599e 100644 --- a/beacon_chain/rpc/beacon_rest_api.nim +++ b/beacon_chain/rpc/beacon_rest_api.nim @@ -538,7 +538,7 @@ proc installBeaconApiHandlers*(router: var RestRouter, node: BeaconNode) = node.dag.get(blockSlot.blck) return RestApiResponse.jsonResponse( - ( + [( # TODO Altair insofar as it should detect the error condition rather # than crashing. This API is only specified for phase 0 root: bdata.data.phase0Block.root, @@ -553,7 +553,7 @@ proc installBeaconApiHandlers*(router: var RestRouter, node: BeaconNode) = ), signature: bdata.data.phase0Block.signature ) - ) + )] ) # https://ethereum.github.io/eth2.0-APIs/#/Beacon/getBlockHeader diff --git a/ncli/resttest-rules.json b/ncli/resttest-rules.json index fb7d3506f..0c29c8586 100644 --- a/ncli/resttest-rules.json +++ b/ncli/resttest-rules.json @@ -1555,7 +1555,7 @@ "response": { "status": {"operator": "equals", "value": "200"}, "headers": [{"key": "Content-Type", "value": "application/json", "operator": "equals"}], - "body": [{"operator": "jstructcmps", "start": ["data"], "value": {"root": "", "canonical": true, "header": {"message": {"slot": "", "proposer_index": "", "parent_root": "", "state_root": "", "body_root": ""}, "signature": ""}}}] + "body": [{"operator": "jstructcmps", "start": ["data"], "value": [{"root": "", "canonical": true, "header": {"message": {"slot": "", "proposer_index": "", "parent_root": "", "state_root": "", "body_root": ""}, "signature": ""}}]}] } }, { @@ -1567,7 +1567,7 @@ "response": { "status": {"operator": "equals", "value": "200"}, "headers": [{"key": "Content-Type", "value": "application/json", "operator": "equals"}], - "body": [{"operator": "jstructcmps", "start": ["data"], "value": {"root": "", "canonical": true, "header": {"message": {"slot": "", "proposer_index": "", "parent_root": "", "state_root": "", "body_root": ""}, "signature": ""}}}] + "body": [{"operator": "jstructcmps", "start": ["data"], "value": [{"root": "", "canonical": true, "header": {"message": {"slot": "", "proposer_index": "", "parent_root": "", "state_root": "", "body_root": ""}, "signature": ""}}]}] } }, {