use of io.libp2p.core.pubsub.ValidationResult in project teku by ConsenSys.
the class ProposerSlashingTopicHandlerTest method handleMessage_validSlashing.
@Test
public void handleMessage_validSlashing() {
final ProposerSlashing slashing = dataStructureUtil.randomProposerSlashing();
when(processor.process(slashing)).thenReturn(SafeFuture.completedFuture(InternalValidationResult.ACCEPT));
Bytes serialized = gossipEncoding.encode(slashing);
final SafeFuture<ValidationResult> result = topicHandler.handleMessage(topicHandler.prepareMessage(serialized));
asyncRunner.executeQueuedActions();
assertThat(result).isCompletedWithValue(ValidationResult.Valid);
}
Aggregations