forked from Consensys/teku
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable VC crashing on 0 keys loaded (Consensys#7751)
- Loading branch information
1 parent
38ddede
commit c7b8734
Showing
11 changed files
with
176 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
...nce-test/java/tech/pegasys/teku/test/acceptance/ValidatorClientServiceAcceptanceTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright Consensys Software Inc., 2023 | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
*/ | ||
|
||
package tech.pegasys.teku.test.acceptance; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import tech.pegasys.teku.test.acceptance.dsl.AcceptanceTestBase; | ||
import tech.pegasys.teku.test.acceptance.dsl.TekuNode; | ||
import tech.pegasys.teku.test.acceptance.dsl.TekuValidatorNode; | ||
|
||
public class ValidatorClientServiceAcceptanceTest extends AcceptanceTestBase { | ||
|
||
@Test | ||
void shouldFailWithNoValidatorKeysWhenExitOptionEnabledOnBeaconNode() throws Exception { | ||
TekuNode beaconNode = createTekuNode(config -> config.withExitWhenNoValidatorKeysEnabled(true)); | ||
beaconNode.startWithFailure( | ||
"No loaded validators when --exit-when-no-validator-keys-enabled option is false"); | ||
} | ||
|
||
@Test | ||
void shouldFailWithNoValidatorKeysWhenExitOptionEnabledOnValidatorClient() throws Exception { | ||
TekuNode beaconNode = createTekuNode(); | ||
TekuValidatorNode validatorClient = | ||
createValidatorNode( | ||
config -> config.withBeaconNode(beaconNode).withExitWhenNoValidatorKeysEnabled(true)); | ||
beaconNode.start(); | ||
validatorClient.startWithFailure( | ||
"No loaded validators when --exit-when-no-validator-keys-enabled option is false"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...lient/src/main/java/tech/pegasys/teku/validator/client/NoValidatorKeysStateException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Copyright Consensys Software Inc., 2023 | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
*/ | ||
|
||
package tech.pegasys.teku.validator.client; | ||
|
||
public class NoValidatorKeysStateException extends IllegalStateException { | ||
public NoValidatorKeysStateException(String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
|
||
public NoValidatorKeysStateException(String message) { | ||
super(message); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters