From 071e38b09ce42b861cf39a9ccc7744b1724efce3 Mon Sep 17 00:00:00 2001 From: Enrico Del Fante Date: Fri, 13 Dec 2024 10:22:57 +0100 Subject: [PATCH] fix config provider --- .../teku/beaconrestapi/handlers/v1/config/GetSpec.java | 2 +- .../main/java/tech/pegasys/teku/api/ConfigProvider.java | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v1/config/GetSpec.java b/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v1/config/GetSpec.java index 4dbc4ce083c..f50128e6279 100644 --- a/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v1/config/GetSpec.java +++ b/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v1/config/GetSpec.java @@ -53,7 +53,7 @@ public GetSpec(final DataProvider dataProvider) { @Override public void handleRequest(final RestApiRequest request) throws JsonProcessingException { try { - final SpecConfigData responseContext = new SpecConfigData(configProvider.getGenesisSpec()); + final SpecConfigData responseContext = new SpecConfigData(configProvider.getSpecConfig()); request.respondOk(responseContext.getConfigMap()); } catch (JsonProcessingException e) { String message = diff --git a/data/provider/src/main/java/tech/pegasys/teku/api/ConfigProvider.java b/data/provider/src/main/java/tech/pegasys/teku/api/ConfigProvider.java index 5770ec16ca9..2f0688ba368 100644 --- a/data/provider/src/main/java/tech/pegasys/teku/api/ConfigProvider.java +++ b/data/provider/src/main/java/tech/pegasys/teku/api/ConfigProvider.java @@ -30,12 +30,13 @@ public ConfigProvider(final Spec spec) { } public Map getConfig() { - final SpecConfigData configuration = new SpecConfigData(spec.getGenesisSpecConfig()); + final SpecConfigData configuration = + new SpecConfigData(spec.getSpecConfigAndParent().specConfig()); return configuration.getConfigMap(); } - public SpecConfig getGenesisSpec() { - return spec.atEpoch(UInt64.ZERO).getConfig(); + public SpecConfig getSpecConfig() { + return spec.getSpecConfigAndParent().specConfig(); } public static String formatValue(final Object v) {