use of com.radixdlt.consensus.Proposal in project radixdlt by radixdlt.
the class BFTEventVerifierTest method when_process_bad_signature_proposal_then_should_not_be_forwarded.
@Test
public void when_process_bad_signature_proposal_then_should_not_be_forwarded() {
Proposal proposal = mock(Proposal.class);
BFTNode author = mock(BFTNode.class);
when(proposal.getAuthor()).thenReturn(author);
when(proposal.getSignature()).thenReturn(mock(ECDSASignature.class));
when(validatorSet.containsNode(eq(author))).thenReturn(true);
when(verifier.verify(any(), any(), any())).thenReturn(false);
eventVerifier.processProposal(proposal);
verify(forwardTo, never()).processProposal(any());
}
use of com.radixdlt.consensus.Proposal in project radixdlt by radixdlt.
the class BFTEventVerifierTest method when_process_bad_author_proposal_then_should_not_be_forwarded.
@Test
public void when_process_bad_author_proposal_then_should_not_be_forwarded() {
Proposal proposal = mock(Proposal.class);
BFTNode author = mock(BFTNode.class);
when(proposal.getAuthor()).thenReturn(author);
when(proposal.getSignature()).thenReturn(mock(ECDSASignature.class));
when(validatorSet.containsNode(eq(author))).thenReturn(false);
when(verifier.verify(any(), any(), any())).thenReturn(true);
eventVerifier.processProposal(proposal);
verify(forwardTo, never()).processProposal(any());
}
Aggregations