@Test public void shouldReturnForkInfoWhenSet() throws Exception { GetFork handler = new GetFork(provider, jsonProvider); when(provider.getForkInfo()).thenReturn(getForkResponse); handler.handle(context); verify(context).result(jsonProvider.objectToJSON(getForkResponse)); verify(context).header(Header.CACHE_CONTROL, CACHE_NONE); }
@OpenApi( deprecated = true, path = ROUTE, method = HttpMethod.GET, summary = "Get the fork of the current head.", tags = {TAG_NODE}, description = "Returns information about the fork of the beacon chain head from the node’s perspective." + "Replaced by standard api endpoint /eth/v1/beacon/states/{state_id}/fork", responses = { @OpenApiResponse( status = RES_OK, content = @OpenApiContent(from = Fork.class), description = "An object containing the fork of the current head."), @OpenApiResponse(status = RES_NO_CONTENT, description = NO_CONTENT_PRE_GENESIS), @OpenApiResponse(status = RES_INTERNAL_ERROR) }) @Override public void handle(Context ctx) throws Exception { ctx.header(CACHE_CONTROL, CACHE_NONE); GetForkResponse result = provider.getForkInfo(); ctx.result(jsonProvider.objectToJSON(result)); }
GetFork implements Handler { @OpenApi( deprecated = true, path = ROUTE, method = HttpMethod.GET, summary = "Get the fork of the current head.", tags = {TAG_NODE}, description = "Returns information about the fork of the beacon chain head from the node’s perspective." + "Replaced by standard api endpoint /eth/v1/beacon/states/{state_id}/fork", responses = { @OpenApiResponse( status = RES_OK, content = @OpenApiContent(from = Fork.class), description = "An object containing the fork of the current head."), @OpenApiResponse(status = RES_NO_CONTENT, description = NO_CONTENT_PRE_GENESIS), @OpenApiResponse(status = RES_INTERNAL_ERROR) }) @Override public void handle(Context ctx) throws Exception { ctx.header(CACHE_CONTROL, CACHE_NONE); GetForkResponse result = provider.getForkInfo(); ctx.result(jsonProvider.objectToJSON(result)); } }
GetFork implements Handler { @OpenApi( deprecated = true, path = ROUTE, method = HttpMethod.GET, summary = "Get the fork of the current head.", tags = {TAG_NODE}, description = "Returns information about the fork of the beacon chain head from the node’s perspective." + "Replaced by standard api endpoint /eth/v1/beacon/states/{state_id}/fork", responses = { @OpenApiResponse( status = RES_OK, content = @OpenApiContent(from = Fork.class), description = "An object containing the fork of the current head."), @OpenApiResponse(status = RES_NO_CONTENT, description = NO_CONTENT_PRE_GENESIS), @OpenApiResponse(status = RES_INTERNAL_ERROR) }) @Override public void handle(Context ctx) throws Exception { ctx.header(CACHE_CONTROL, CACHE_NONE); GetForkResponse result = provider.getForkInfo(); ctx.result(jsonProvider.objectToJSON(result)); } GetFork(ChainDataProvider provider, JsonProvider jsonProvider); }
GetFork implements Handler { @OpenApi( deprecated = true, path = ROUTE, method = HttpMethod.GET, summary = "Get the fork of the current head.", tags = {TAG_NODE}, description = "Returns information about the fork of the beacon chain head from the node’s perspective." + "Replaced by standard api endpoint /eth/v1/beacon/states/{state_id}/fork", responses = { @OpenApiResponse( status = RES_OK, content = @OpenApiContent(from = Fork.class), description = "An object containing the fork of the current head."), @OpenApiResponse(status = RES_NO_CONTENT, description = NO_CONTENT_PRE_GENESIS), @OpenApiResponse(status = RES_INTERNAL_ERROR) }) @Override public void handle(Context ctx) throws Exception { ctx.header(CACHE_CONTROL, CACHE_NONE); GetForkResponse result = provider.getForkInfo(); ctx.result(jsonProvider.objectToJSON(result)); } GetFork(ChainDataProvider provider, JsonProvider jsonProvider); @OpenApi( deprecated = true, path = ROUTE, method = HttpMethod.GET, summary = "Get the fork of the current head.", tags = {TAG_NODE}, description = "Returns information about the fork of the beacon chain head from the node’s perspective." + "Replaced by standard api endpoint /eth/v1/beacon/states/{state_id}/fork", responses = { @OpenApiResponse( status = RES_OK, content = @OpenApiContent(from = Fork.class), description = "An object containing the fork of the current head."), @OpenApiResponse(status = RES_NO_CONTENT, description = NO_CONTENT_PRE_GENESIS), @OpenApiResponse(status = RES_INTERNAL_ERROR) }) @Override void handle(Context ctx); }
GetFork implements Handler { @OpenApi( deprecated = true, path = ROUTE, method = HttpMethod.GET, summary = "Get the fork of the current head.", tags = {TAG_NODE}, description = "Returns information about the fork of the beacon chain head from the node’s perspective." + "Replaced by standard api endpoint /eth/v1/beacon/states/{state_id}/fork", responses = { @OpenApiResponse( status = RES_OK, content = @OpenApiContent(from = Fork.class), description = "An object containing the fork of the current head."), @OpenApiResponse(status = RES_NO_CONTENT, description = NO_CONTENT_PRE_GENESIS), @OpenApiResponse(status = RES_INTERNAL_ERROR) }) @Override public void handle(Context ctx) throws Exception { ctx.header(CACHE_CONTROL, CACHE_NONE); GetForkResponse result = provider.getForkInfo(); ctx.result(jsonProvider.objectToJSON(result)); } GetFork(ChainDataProvider provider, JsonProvider jsonProvider); @OpenApi( deprecated = true, path = ROUTE, method = HttpMethod.GET, summary = "Get the fork of the current head.", tags = {TAG_NODE}, description = "Returns information about the fork of the beacon chain head from the node’s perspective." + "Replaced by standard api endpoint /eth/v1/beacon/states/{state_id}/fork", responses = { @OpenApiResponse( status = RES_OK, content = @OpenApiContent(from = Fork.class), description = "An object containing the fork of the current head."), @OpenApiResponse(status = RES_NO_CONTENT, description = NO_CONTENT_PRE_GENESIS), @OpenApiResponse(status = RES_INTERNAL_ERROR) }) @Override void handle(Context ctx); static final String ROUTE; }