Search in sources :

Example 1 with GrandParentDependantBlockHeaderRule

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

the class ChainConfiguration method createVRFValidator.

public GrandParentBlockHeaderValidator createVRFValidator() {
    List<GrandParentDependantBlockHeaderRule> posRules = Collections.singletonList(new VRFProofRule());
    Map<Seal, List<GrandParentDependantBlockHeaderRule>> vrfProofRules = new EnumMap<>(Seal.class);
    vrfProofRules.put(Seal.PROOF_OF_STAKE, posRules);
    return new GrandParentBlockHeaderValidator(vrfProofRules);
}
Also used : GreatGrandParentDependantBlockHeaderRule(org.aion.zero.impl.valid.GreatGrandParentDependantBlockHeaderRule) GrandParentDependantBlockHeaderRule(org.aion.zero.impl.valid.GrandParentDependantBlockHeaderRule) VRFProofRule(org.aion.zero.impl.valid.VRFProofRule) Seal(org.aion.zero.impl.types.BlockHeader.Seal) List(java.util.List) GreatGrandParentBlockHeaderValidator(org.aion.zero.impl.valid.GreatGrandParentBlockHeaderValidator) GrandParentBlockHeaderValidator(org.aion.zero.impl.valid.GrandParentBlockHeaderValidator) EnumMap(java.util.EnumMap)

Example 2 with GrandParentDependantBlockHeaderRule

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

the class ChainConfiguration method createPreUnityGrandParentHeaderValidator.

public GrandParentBlockHeaderValidator createPreUnityGrandParentHeaderValidator() {
    List<GrandParentDependantBlockHeaderRule> powRules = Collections.singletonList(new AionDifficultyRule(this));
    Map<Seal, List<GrandParentDependantBlockHeaderRule>> unityRules = new EnumMap<>(Seal.class);
    unityRules.put(Seal.PROOF_OF_WORK, powRules);
    return new GrandParentBlockHeaderValidator(unityRules);
}
Also used : GreatGrandParentDependantBlockHeaderRule(org.aion.zero.impl.valid.GreatGrandParentDependantBlockHeaderRule) GrandParentDependantBlockHeaderRule(org.aion.zero.impl.valid.GrandParentDependantBlockHeaderRule) AionDifficultyRule(org.aion.zero.impl.valid.AionDifficultyRule) Seal(org.aion.zero.impl.types.BlockHeader.Seal) List(java.util.List) GreatGrandParentBlockHeaderValidator(org.aion.zero.impl.valid.GreatGrandParentBlockHeaderValidator) GrandParentBlockHeaderValidator(org.aion.zero.impl.valid.GrandParentBlockHeaderValidator) EnumMap(java.util.EnumMap)

Aggregations

EnumMap (java.util.EnumMap)2 List (java.util.List)2 Seal (org.aion.zero.impl.types.BlockHeader.Seal)2 GrandParentBlockHeaderValidator (org.aion.zero.impl.valid.GrandParentBlockHeaderValidator)2 GrandParentDependantBlockHeaderRule (org.aion.zero.impl.valid.GrandParentDependantBlockHeaderRule)2 GreatGrandParentBlockHeaderValidator (org.aion.zero.impl.valid.GreatGrandParentBlockHeaderValidator)2 GreatGrandParentDependantBlockHeaderRule (org.aion.zero.impl.valid.GreatGrandParentDependantBlockHeaderRule)2 AionDifficultyRule (org.aion.zero.impl.valid.AionDifficultyRule)1 VRFProofRule (org.aion.zero.impl.valid.VRFProofRule)1