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);
}
Aggregations