use of com.radixdlt.recovery.MockedRecoveryModule in project radixdlt by radixdlt.
the class OneByzantineGenesisTest method given_3_correct_bfts_and_1_byzantine__then_should_make_progress.
@Test
public void given_3_correct_bfts_and_1_byzantine__then_should_make_progress() {
SimulationTest bftTest = bftTestBuilder.numNodes(4).addOverrideModuleToInitialNodes(nodes -> ImmutableList.of(nodes.get(0).getPublicKey()), new MockedRecoveryModule(HashUtils.random256())).addTestModules(ConsensusMonitors.liveness(5, TimeUnit.SECONDS)).build();
final var checkResults = bftTest.run().awaitCompletion();
assertThat(checkResults).allSatisfy((name, err) -> assertThat(err).isEmpty());
}
use of com.radixdlt.recovery.MockedRecoveryModule in project radixdlt by radixdlt.
the class OneByzantineGenesisTest method given_2_correct_bfts_and_1_byzantine__then_should_never_make_progress.
@Test
public void given_2_correct_bfts_and_1_byzantine__then_should_never_make_progress() {
SimulationTest bftTest = bftTestBuilder.numNodes(3).addOverrideModuleToInitialNodes(nodes -> ImmutableList.of(nodes.get(0).getPublicKey()), new MockedRecoveryModule(HashUtils.random256())).addTestModules(ConsensusMonitors.noneCommitted()).build();
final var checkResults = bftTest.run().awaitCompletion();
assertThat(checkResults).allSatisfy((name, err) -> AssertionsForClassTypes.assertThat(err).isEmpty());
}
Aggregations