use of tech.pegasys.teku.networking.eth2.gossip.encoding.DecodingException in project teku by ConsenSys.
the class Eth2TopicHandlerTest method handleMessage_errorWhileProcessing_wrappedDecodingException.
@Test
public void handleMessage_errorWhileProcessing_wrappedDecodingException() {
MockEth2TopicHandler topicHandler = new MockEth2TopicHandler(recentChainData, spec, asyncRunner, (b) -> SafeFuture.completedFuture(InternalValidationResult.ACCEPT));
topicHandler.setDeserializer((b) -> {
throw new CompletionException(new DecodingException("oops"));
});
final SafeFuture<ValidationResult> result = topicHandler.handleMessage(topicHandler.prepareMessage(blockBytes));
asyncRunner.executeQueuedActions();
assertThatSafeFuture(result).isCompletedWithValue(ValidationResult.Invalid);
}
Aggregations