use of org.aion.zero.impl.valid.ParentBlockHeaderValidator in project aion by aionnetwork.
the class ChainConfiguration method createPreUnityParentBlockHeaderValidator.
public ParentBlockHeaderValidator createPreUnityParentBlockHeaderValidator() {
List<DependentBlockHeaderRule> rules = Arrays.asList(new BlockNumberRule(), new TimeStampRule(), new EnergyLimitRule(getConstants().getEnergyDivisorLimitLong(), getConstants().getEnergyLowerBoundLong()));
Map<Seal, List<DependentBlockHeaderRule>> unityRules = new EnumMap<>(Seal.class);
unityRules.put(Seal.PROOF_OF_WORK, rules);
unityRules.put(Seal.PROOF_OF_STAKE, rules);
return new ParentBlockHeaderValidator(unityRules);
}
use of org.aion.zero.impl.valid.ParentBlockHeaderValidator in project aion by aionnetwork.
the class ChainConfiguration method createUnityParentBlockHeaderValidator.
public ParentBlockHeaderValidator createUnityParentBlockHeaderValidator() {
List<DependentBlockHeaderRule> PoWrules = Arrays.asList(new BlockNumberRule(), new ParentOppositeTypeRule(), new TimeStampRule(), new EnergyLimitRule(getConstants().getEnergyDivisorLimitLong(), getConstants().getEnergyLowerBoundLong()));
List<DependentBlockHeaderRule> PoSrules = Arrays.asList(new BlockNumberRule(), new ParentOppositeTypeRule(), new StakingBlockTimeStampRule(), new TimeStampRule(), new EnergyLimitRule(getConstants().getEnergyDivisorLimitLong(), getConstants().getEnergyLowerBoundLong()));
Map<Seal, List<DependentBlockHeaderRule>> unityRules = new EnumMap<>(Seal.class);
unityRules.put(Seal.PROOF_OF_WORK, PoWrules);
unityRules.put(Seal.PROOF_OF_STAKE, PoSrules);
return new ParentBlockHeaderValidator(unityRules);
}
Aggregations