Search in sources :

Example 1 with FutureBlockRule

use of org.aion.zero.impl.valid.FutureBlockRule in project aion by aionnetwork.

the class ChainConfiguration method createBlockHeaderValidator.

public BlockHeaderValidator createBlockHeaderValidator() {
    List<BlockHeaderRule> powRules = Arrays.asList(new HeaderSealTypeRule(), new FutureBlockRule(), new AionExtraDataRule(this.getConstants().getMaximumExtraDataSize()), new EnergyConsumedRule(), new AionPOWRule(), new EquihashSolutionRule(this.getEquihashValidator()));
    List<BlockHeaderRule> posRules = Arrays.asList(new HeaderSealTypeRule(), new FutureBlockRule(), new AionExtraDataRule(this.getConstants().getMaximumExtraDataSize()), new EnergyConsumedRule(), new SignatureRule());
    Map<Seal, List<BlockHeaderRule>> unityRules = new EnumMap<>(Seal.class);
    unityRules.put(Seal.PROOF_OF_WORK, powRules);
    unityRules.put(Seal.PROOF_OF_STAKE, posRules);
    return new BlockHeaderValidator(unityRules);
}
Also used : GreatGrandParentBlockHeaderValidator(org.aion.zero.impl.valid.GreatGrandParentBlockHeaderValidator) ParentBlockHeaderValidator(org.aion.zero.impl.valid.ParentBlockHeaderValidator) GrandParentBlockHeaderValidator(org.aion.zero.impl.valid.GrandParentBlockHeaderValidator) BlockHeaderValidator(org.aion.zero.impl.valid.BlockHeaderValidator) FutureBlockRule(org.aion.zero.impl.valid.FutureBlockRule) EquihashSolutionRule(org.aion.zero.impl.valid.EquihashSolutionRule) SignatureRule(org.aion.zero.impl.valid.SignatureRule) EnergyConsumedRule(org.aion.zero.impl.valid.EnergyConsumedRule) HeaderSealTypeRule(org.aion.zero.impl.valid.HeaderSealTypeRule) AionExtraDataRule(org.aion.zero.impl.valid.AionExtraDataRule) Seal(org.aion.zero.impl.types.BlockHeader.Seal) List(java.util.List) DependentBlockHeaderRule(org.aion.zero.impl.valid.DependentBlockHeaderRule) BlockHeaderRule(org.aion.zero.impl.valid.BlockHeaderRule) GreatGrandParentDependantBlockHeaderRule(org.aion.zero.impl.valid.GreatGrandParentDependantBlockHeaderRule) GrandParentDependantBlockHeaderRule(org.aion.zero.impl.valid.GrandParentDependantBlockHeaderRule) AionPOWRule(org.aion.zero.impl.valid.AionPOWRule) EnumMap(java.util.EnumMap)

Aggregations

EnumMap (java.util.EnumMap)1 List (java.util.List)1 Seal (org.aion.zero.impl.types.BlockHeader.Seal)1 AionExtraDataRule (org.aion.zero.impl.valid.AionExtraDataRule)1 AionPOWRule (org.aion.zero.impl.valid.AionPOWRule)1 BlockHeaderRule (org.aion.zero.impl.valid.BlockHeaderRule)1 BlockHeaderValidator (org.aion.zero.impl.valid.BlockHeaderValidator)1 DependentBlockHeaderRule (org.aion.zero.impl.valid.DependentBlockHeaderRule)1 EnergyConsumedRule (org.aion.zero.impl.valid.EnergyConsumedRule)1 EquihashSolutionRule (org.aion.zero.impl.valid.EquihashSolutionRule)1 FutureBlockRule (org.aion.zero.impl.valid.FutureBlockRule)1 GrandParentBlockHeaderValidator (org.aion.zero.impl.valid.GrandParentBlockHeaderValidator)1 GrandParentDependantBlockHeaderRule (org.aion.zero.impl.valid.GrandParentDependantBlockHeaderRule)1 GreatGrandParentBlockHeaderValidator (org.aion.zero.impl.valid.GreatGrandParentBlockHeaderValidator)1 GreatGrandParentDependantBlockHeaderRule (org.aion.zero.impl.valid.GreatGrandParentDependantBlockHeaderRule)1 HeaderSealTypeRule (org.aion.zero.impl.valid.HeaderSealTypeRule)1 ParentBlockHeaderValidator (org.aion.zero.impl.valid.ParentBlockHeaderValidator)1 SignatureRule (org.aion.zero.impl.valid.SignatureRule)1