use of tech.pegasys.teku.ethereum.executionlayer.client.serialization.Bytes20Serializer in project teku by ConsenSys.
the class Web3JExecutionEngineClientTest method shouldSerializeDeserializeBytes20.
@TestTemplate
void shouldSerializeDeserializeBytes20() throws IOException {
Bytes20 originalBytes20 = dataStructureUtil.randomBytes20();
new Bytes20Serializer().serialize(originalBytes20, jsonGenerator, serializerProvider);
jsonGenerator.flush();
JsonParser parser = prepareDeserializationContext(jsonWriter.toString());
Bytes20Deserializer deserializer = new Bytes20Deserializer();
Bytes20 result = deserializer.deserialize(parser, objectMapper.getDeserializationContext());
assertThat(originalBytes20).isEqualTo(result);
}
Aggregations