use of tech.pegasys.teku.infrastructure.bytes.Bytes20 in project teku by ConsenSys.
the class ForkChoiceNotifierTest method getExpectedPayloadAttributes.
private PayloadAttributes getExpectedPayloadAttributes(final BeaconState headState, final UInt64 blockSlot, final Optional<Bytes20> overrideFeeRecipient) {
final Bytes20 feeRecipient = overrideFeeRecipient.orElse(dataStructureUtil.randomBytes20());
final UInt64 timestamp = spec.computeTimeAtSlot(headState, blockSlot);
final Bytes32 random = spec.getRandaoMix(headState, UInt64.ZERO);
return new PayloadAttributes(timestamp, random, feeRecipient);
}
use of tech.pegasys.teku.infrastructure.bytes.Bytes20 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