Search in sources :

Example 1 with TekuVoluntaryExit

use of tech.pegasys.teku.test.acceptance.dsl.TekuVoluntaryExit in project teku by ConsenSys.

the class VoluntaryExitAcceptanceTest method shouldChangeValidatorStatusAfterSubmittingVoluntaryExit.

@Test
void shouldChangeValidatorStatusAfterSubmittingVoluntaryExit() throws Exception {
    final String networkName = "less-swift";
    final BesuNode eth1Node = createBesuNode();
    eth1Node.start();
    final ValidatorKeystores validatorKeystores = createTekuDepositSender(networkName).sendValidatorDeposits(eth1Node, 4);
    final TekuNode beaconNode = createTekuNode(config -> config.withNetwork(networkName).withDepositsFrom(eth1Node));
    final TekuVoluntaryExit voluntaryExitProcessFailing = createVoluntaryExit(config -> config.withBeaconNode(beaconNode)).withValidatorKeystores(validatorKeystores);
    final TekuVoluntaryExit voluntaryExitProcessSuccessful = createVoluntaryExit(config -> config.withBeaconNode(beaconNode)).withValidatorKeystores(validatorKeystores);
    final TekuValidatorNode validatorClient = createValidatorNode(config -> config.withNetwork(networkName).withInteropModeDisabled().withBeaconNode(beaconNode)).withValidatorKeystores(validatorKeystores);
    beaconNode.start();
    validatorClient.start();
    validatorClient.waitForLogMessageContaining("Published block");
    validatorClient.waitForLogMessageContaining("Published attestation");
    validatorClient.waitForLogMessageContaining("Published aggregate");
    beaconNode.waitForLogMessageContaining("Epoch: 1");
    voluntaryExitProcessFailing.start();
    beaconNode.waitForLogMessageContaining("Epoch: 3");
    voluntaryExitProcessSuccessful.start();
    validatorClient.waitForLogMessageContaining("has changed status from");
    assertThat(voluntaryExitProcessFailing.getLoggedErrors()).contains("Failed to submit exit for validator");
}
Also used : Test(org.junit.jupiter.api.Test) AcceptanceTestBase(tech.pegasys.teku.test.acceptance.dsl.AcceptanceTestBase) TekuNode(tech.pegasys.teku.test.acceptance.dsl.TekuNode) TekuValidatorNode(tech.pegasys.teku.test.acceptance.dsl.TekuValidatorNode) ValidatorKeystores(tech.pegasys.teku.test.acceptance.dsl.tools.deposits.ValidatorKeystores) BesuNode(tech.pegasys.teku.test.acceptance.dsl.BesuNode) TekuVoluntaryExit(tech.pegasys.teku.test.acceptance.dsl.TekuVoluntaryExit) AssertionsForClassTypes.assertThat(org.assertj.core.api.AssertionsForClassTypes.assertThat) BesuNode(tech.pegasys.teku.test.acceptance.dsl.BesuNode) TekuVoluntaryExit(tech.pegasys.teku.test.acceptance.dsl.TekuVoluntaryExit) TekuNode(tech.pegasys.teku.test.acceptance.dsl.TekuNode) TekuValidatorNode(tech.pegasys.teku.test.acceptance.dsl.TekuValidatorNode) ValidatorKeystores(tech.pegasys.teku.test.acceptance.dsl.tools.deposits.ValidatorKeystores) Test(org.junit.jupiter.api.Test)

Aggregations

AssertionsForClassTypes.assertThat (org.assertj.core.api.AssertionsForClassTypes.assertThat)1 Test (org.junit.jupiter.api.Test)1 AcceptanceTestBase (tech.pegasys.teku.test.acceptance.dsl.AcceptanceTestBase)1 BesuNode (tech.pegasys.teku.test.acceptance.dsl.BesuNode)1 TekuNode (tech.pegasys.teku.test.acceptance.dsl.TekuNode)1 TekuValidatorNode (tech.pegasys.teku.test.acceptance.dsl.TekuValidatorNode)1 TekuVoluntaryExit (tech.pegasys.teku.test.acceptance.dsl.TekuVoluntaryExit)1 ValidatorKeystores (tech.pegasys.teku.test.acceptance.dsl.tools.deposits.ValidatorKeystores)1