Search in sources :

Example 1 with StakingSeedRule

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

the class ChainConfiguration method createUnityGreatGrandParentHeaderValidator.

public GreatGrandParentBlockHeaderValidator createUnityGreatGrandParentHeaderValidator() {
    List<GreatGrandParentDependantBlockHeaderRule> powRules = Collections.singletonList(new UnityDifficultyRule(this));
    List<GreatGrandParentDependantBlockHeaderRule> posRules = Arrays.asList(new UnityDifficultyRule(this), new StakingSeedRule());
    Map<Seal, List<GreatGrandParentDependantBlockHeaderRule>> unityRules = new EnumMap<>(Seal.class);
    unityRules.put(Seal.PROOF_OF_WORK, powRules);
    unityRules.put(Seal.PROOF_OF_STAKE, posRules);
    return new GreatGrandParentBlockHeaderValidator(unityRules);
}
Also used : UnityDifficultyRule(org.aion.zero.impl.valid.UnityDifficultyRule) StakingSeedRule(org.aion.zero.impl.valid.StakingSeedRule) GreatGrandParentDependantBlockHeaderRule(org.aion.zero.impl.valid.GreatGrandParentDependantBlockHeaderRule) GreatGrandParentBlockHeaderValidator(org.aion.zero.impl.valid.GreatGrandParentBlockHeaderValidator) Seal(org.aion.zero.impl.types.BlockHeader.Seal) List(java.util.List) EnumMap(java.util.EnumMap)

Aggregations

EnumMap (java.util.EnumMap)1 List (java.util.List)1 Seal (org.aion.zero.impl.types.BlockHeader.Seal)1 GreatGrandParentBlockHeaderValidator (org.aion.zero.impl.valid.GreatGrandParentBlockHeaderValidator)1 GreatGrandParentDependantBlockHeaderRule (org.aion.zero.impl.valid.GreatGrandParentDependantBlockHeaderRule)1 StakingSeedRule (org.aion.zero.impl.valid.StakingSeedRule)1 UnityDifficultyRule (org.aion.zero.impl.valid.UnityDifficultyRule)1