Skip to content

Commit

Permalink
Allow Attached rules to be flagged 'light' (PegaSysEng#580)
Browse files Browse the repository at this point in the history
  • Loading branch information
rain-on authored and iikirilov committed Jan 24, 2019
1 parent 6e66f79 commit 7f16827
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,8 @@ public interface AttachedBlockHeaderValidationRule<C> {
* @return {@code true} if valid; otherwise {@code false}
*/
boolean validate(BlockHeader header, BlockHeader parent, ProtocolContext<C> protocolContext);

default boolean includeInLightValidation() {
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public static class Builder<C> {
private final List<Rule<C>> rules = new ArrayList<>();

public Builder<C> addRule(final AttachedBlockHeaderValidationRule<C> rule) {
this.rules.add(new Rule<>(false, rule, true));
this.rules.add(new Rule<>(false, rule, rule.includeInLightValidation()));
return this;
}

Expand Down

0 comments on commit 7f16827

Please sign in to comment.