Search in sources :

Example 1 with GetBlockHeaderResponse

use of tech.pegasys.teku.api.response.v1.beacon.GetBlockHeaderResponse in project teku by ConsenSys.

the class GetBlockHeaderIntegrationTest method shouldGetBlockHeader.

@Test
public void shouldGetBlockHeader() throws IOException {
    final List<SignedBlockAndState> created = createBlocksAtSlots(10);
    final Response response = get("head");
    final GetBlockHeaderResponse body = jsonProvider.jsonToObject(response.body().string(), GetBlockHeaderResponse.class);
    final BlockHeader data = body.data;
    assertThat(data).isEqualTo(new BlockHeader(created.get(0).getBlock(), true));
}
Also used : Response(okhttp3.Response) GetBlockHeaderResponse(tech.pegasys.teku.api.response.v1.beacon.GetBlockHeaderResponse) GetBlockHeaderResponse(tech.pegasys.teku.api.response.v1.beacon.GetBlockHeaderResponse) SignedBlockAndState(tech.pegasys.teku.spec.datastructures.blocks.SignedBlockAndState) GetBlockHeader(tech.pegasys.teku.beaconrestapi.handlers.v1.beacon.GetBlockHeader) BlockHeader(tech.pegasys.teku.api.response.v1.beacon.BlockHeader) Test(org.junit.jupiter.api.Test) AbstractDataBackedRestAPIIntegrationTest(tech.pegasys.teku.beaconrestapi.AbstractDataBackedRestAPIIntegrationTest)

Aggregations

Response (okhttp3.Response)1 Test (org.junit.jupiter.api.Test)1 BlockHeader (tech.pegasys.teku.api.response.v1.beacon.BlockHeader)1 GetBlockHeaderResponse (tech.pegasys.teku.api.response.v1.beacon.GetBlockHeaderResponse)1 AbstractDataBackedRestAPIIntegrationTest (tech.pegasys.teku.beaconrestapi.AbstractDataBackedRestAPIIntegrationTest)1 GetBlockHeader (tech.pegasys.teku.beaconrestapi.handlers.v1.beacon.GetBlockHeader)1 SignedBlockAndState (tech.pegasys.teku.spec.datastructures.blocks.SignedBlockAndState)1