@Test public void testDifficultyAdjustedForParentBlockHavingUncles() throws Exception { ByzantiumConfig byzantiumConfig = new ByzantiumConfig(new TestBlockchainConfig()); BlockHeader parent = new BlockHeaderBuilder(new byte[]{11, 12}, 0L, 0) .withTimestamp(0L) .withUncles(new byte[]{1, 2}) .build(); BlockHeader current = new BlockHeaderBuilder(parent.getHash(), 1L, 0) .withTimestamp(9L) .build(); assertEquals(1, byzantiumConfig.getCalcDifficultyMultiplier(current, parent).intValue()); }
@Override public BigInteger getCalcDifficultyMultiplier(BlockHeader curBlock, BlockHeader parent) { long unclesAdj = parent.hasUncles() ? 2 : 1; return BigInteger.valueOf(Math.max(unclesAdj - (curBlock.getTimestamp() - parent.getTimestamp()) / 9, -99)); }
ByzantiumConfig extends Eip160HFConfig { @Override public BigInteger getCalcDifficultyMultiplier(BlockHeader curBlock, BlockHeader parent) { long unclesAdj = parent.hasUncles() ? 2 : 1; return BigInteger.valueOf(Math.max(unclesAdj - (curBlock.getTimestamp() - parent.getTimestamp()) / 9, -99)); } }
ByzantiumConfig extends Eip160HFConfig { @Override public BigInteger getCalcDifficultyMultiplier(BlockHeader curBlock, BlockHeader parent) { long unclesAdj = parent.hasUncles() ? 2 : 1; return BigInteger.valueOf(Math.max(unclesAdj - (curBlock.getTimestamp() - parent.getTimestamp()) / 9, -99)); } ByzantiumConfig(BlockchainConfig parent); }
ByzantiumConfig extends Eip160HFConfig { @Override public BigInteger getCalcDifficultyMultiplier(BlockHeader curBlock, BlockHeader parent) { long unclesAdj = parent.hasUncles() ? 2 : 1; return BigInteger.valueOf(Math.max(unclesAdj - (curBlock.getTimestamp() - parent.getTimestamp()) / 9, -99)); } ByzantiumConfig(BlockchainConfig parent); @Override Constants getConstants(); @Override BigInteger calcDifficulty(BlockHeader curBlock, BlockHeader parent); @Override BigInteger getCalcDifficultyMultiplier(BlockHeader curBlock, BlockHeader parent); @Override boolean eip198(); @Override boolean eip206(); @Override boolean eip211(); @Override boolean eip212(); @Override boolean eip213(); @Override boolean eip214(); @Override boolean eip658(); }
ByzantiumConfig extends Eip160HFConfig { @Override public BigInteger getCalcDifficultyMultiplier(BlockHeader curBlock, BlockHeader parent) { long unclesAdj = parent.hasUncles() ? 2 : 1; return BigInteger.valueOf(Math.max(unclesAdj - (curBlock.getTimestamp() - parent.getTimestamp()) / 9, -99)); } ByzantiumConfig(BlockchainConfig parent); @Override Constants getConstants(); @Override BigInteger calcDifficulty(BlockHeader curBlock, BlockHeader parent); @Override BigInteger getCalcDifficultyMultiplier(BlockHeader curBlock, BlockHeader parent); @Override boolean eip198(); @Override boolean eip206(); @Override boolean eip211(); @Override boolean eip212(); @Override boolean eip213(); @Override boolean eip214(); @Override boolean eip658();  }