Search in sources :

Example 1 with ExecutionPayloadHeaderV1

use of tech.pegasys.teku.ethereum.executionlayer.client.schema.ExecutionPayloadHeaderV1 in project teku by ConsenSys.

the class Web3JExecutionEngineClientTest method shouldSerializeDeserializeExecutionPayloadHeaderV1.

@TestTemplate
void shouldSerializeDeserializeExecutionPayloadHeaderV1() throws IOException {
    ExecutionPayloadHeader internalExecutionPayloadHeader = dataStructureUtil.randomExecutionPayloadHeader();
    ExecutionPayloadHeaderV1 executionPayloadHeaderV1Orig = ExecutionPayloadHeaderV1.fromInternalExecutionPayloadHeader(internalExecutionPayloadHeader);
    String executionPayloadHeaderV1OrigSerialized = objectMapper.writeValueAsString(executionPayloadHeaderV1Orig);
    ExecutionPayloadHeaderV1 executionPayloadHeaderV1New = objectMapper.readValue(executionPayloadHeaderV1OrigSerialized, ExecutionPayloadHeaderV1.class);
    assertThat(executionPayloadHeaderV1Orig).isEqualTo(executionPayloadHeaderV1New);
    assertThat(executionPayloadHeaderV1Orig.asInternalExecutionPayloadHeader(internalExecutionPayloadHeader.getSchema())).isEqualTo(internalExecutionPayloadHeader);
}
Also used : ExecutionPayloadHeaderV1(tech.pegasys.teku.ethereum.executionlayer.client.schema.ExecutionPayloadHeaderV1) ExecutionPayloadHeader(tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadHeader) TestTemplate(org.junit.jupiter.api.TestTemplate)

Aggregations

TestTemplate (org.junit.jupiter.api.TestTemplate)1 ExecutionPayloadHeaderV1 (tech.pegasys.teku.ethereum.executionlayer.client.schema.ExecutionPayloadHeaderV1)1 ExecutionPayloadHeader (tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadHeader)1