Skip to content

Commit

Permalink
fix Validator Timing Actions delegates
Browse files Browse the repository at this point in the history
  • Loading branch information
mehdi-aouadi committed Jan 15, 2024
1 parent 78fead1 commit fc6e725
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ public void onAttestationAggregationDue(final UInt64 slot) {

@Override
public void onAttesterSlashing(final AttesterSlashing attesterSlashing) {
delegates.forEach(delegates -> delegates.onAttesterSlashing(attesterSlashing));
maybeValidatorSlashedAction.ifPresent(
validatorSlashingAction -> {
delegates.forEach(delegates -> delegates.onAttesterSlashing(attesterSlashing));
final Set<UInt64> slashedIndices = attesterSlashing.getIntersectingValidatorIndices();
final List<BLSPublicKey> slashedPublicKeys =
slashedIndices.stream()
Expand All @@ -122,9 +122,9 @@ public void onAttesterSlashing(final AttesterSlashing attesterSlashing) {

@Override
public void onProposerSlashing(final ProposerSlashing proposerSlashing) {
delegates.forEach(delegates -> delegates.onProposerSlashing(proposerSlashing));
maybeValidatorSlashedAction.ifPresent(
validatorSlashedAction -> {
delegates.forEach(delegates -> delegates.onProposerSlashing(proposerSlashing));
final UInt64 slashedIndex = proposerSlashing.getHeader1().getMessage().getProposerIndex();
validatorIndexProvider
.getPublicKey(slashedIndex.intValue())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public void shouldNotTriggerValidatorSlashingActionWhenNotEnabled_AttesterSlashi
dataStructureUtil.randomAttesterSlashing(
dataStructureUtil.randomValidatorIndex(), dataStructureUtil.randomValidatorIndex());
validatorTimingActions.onAttesterSlashing(attesterSlashing);
verifyNoInteractions(delegate);
verify(delegate).onAttesterSlashing(attesterSlashing);
verifyNoInteractions(validatorIndexProvider);
verifyNoInteractions(statusLogger);
}
Expand All @@ -147,7 +147,7 @@ public void shouldNotTriggerValidatorSlashingActionWhenNotEnabled_ProposerSlashi
dataStructureUtil.randomProposerSlashing(
dataStructureUtil.randomSlot(), dataStructureUtil.randomValidatorIndex());
validatorTimingActions.onProposerSlashing(proposerSlashing);
verifyNoInteractions(delegate);
verify(delegate).onProposerSlashing(proposerSlashing);
verifyNoInteractions(validatorIndexProvider);
verifyNoInteractions(statusLogger);
}
Expand Down

0 comments on commit fc6e725

Please sign in to comment.