Search in sources :

Example 1 with ExecutionPayloadV1

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

the class Web3JExecutionEngineClientTest method shouldSerializeDeserializeExecutionPayloadV1.

@TestTemplate
void shouldSerializeDeserializeExecutionPayloadV1() throws IOException {
    ExecutionPayload internalExecutionPayload = dataStructureUtil.randomExecutionPayload();
    ExecutionPayloadV1 executionPayloadV1Orig = ExecutionPayloadV1.fromInternalExecutionPayload(internalExecutionPayload);
    String executionPayloadV1OrigSerialized = objectMapper.writeValueAsString(executionPayloadV1Orig);
    ExecutionPayloadV1 executionPayloadV1New = objectMapper.readValue(executionPayloadV1OrigSerialized, ExecutionPayloadV1.class);
    assertThat(executionPayloadV1Orig).isEqualTo(executionPayloadV1New);
    assertThat(executionPayloadV1Orig.asInternalExecutionPayload(internalExecutionPayload.getSchema())).isEqualTo(internalExecutionPayload);
}
Also used : ExecutionPayloadV1(tech.pegasys.teku.ethereum.executionlayer.client.schema.ExecutionPayloadV1) ExecutionPayload(tech.pegasys.teku.spec.datastructures.execution.ExecutionPayload) TestTemplate(org.junit.jupiter.api.TestTemplate)

Aggregations

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