Search in sources :

Example 1 with Bytes8Deserializer

use of tech.pegasys.teku.ethereum.executionlayer.client.serialization.Bytes8Deserializer in project teku by ConsenSys.

the class Web3JExecutionEngineClientTest method shouldDeserializeBytes8.

@TestTemplate
void shouldDeserializeBytes8() throws IOException {
    Bytes8 originalBytes8 = dataStructureUtil.randomBytes8();
    JsonParser parser = prepareDeserializationContext("\"" + originalBytes8.toHexString() + "\"");
    Bytes8Deserializer deserializer = new Bytes8Deserializer();
    Bytes8 result = deserializer.deserialize(parser, objectMapper.getDeserializationContext());
    assertThat(originalBytes8).isEqualTo(result);
}
Also used : Bytes8Deserializer(tech.pegasys.teku.ethereum.executionlayer.client.serialization.Bytes8Deserializer) Bytes8(tech.pegasys.teku.infrastructure.bytes.Bytes8) JsonParser(com.fasterxml.jackson.core.JsonParser) TestTemplate(org.junit.jupiter.api.TestTemplate)

Aggregations

JsonParser (com.fasterxml.jackson.core.JsonParser)1 TestTemplate (org.junit.jupiter.api.TestTemplate)1 Bytes8Deserializer (tech.pegasys.teku.ethereum.executionlayer.client.serialization.Bytes8Deserializer)1 Bytes8 (tech.pegasys.teku.infrastructure.bytes.Bytes8)1