ByzantiumConfig extends Eip160HFConfig { protected int getExplosion(BlockHeader curBlock, BlockHeader parent) { int periodCount = (int) (Math.max(0, curBlock.getNumber() - 3_000_000) / getConstants().getEXP_DIFFICULTY_PERIOD()); return periodCount - 2; } 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();  }
@Test public void testExplosionChanges() throws Exception { ByzantiumConfig byzantiumConfig = new ByzantiumConfig(new TestBlockchainConfig()); BlockHeader beforePauseBlock = new BlockHeaderBuilder(FAKE_HASH, 2_000_000, 0).build(); assertEquals(-2, byzantiumConfig.getExplosion(beforePauseBlock, null)); BlockHeader endOfIceAge = new BlockHeaderBuilder(FAKE_HASH, 3_000_000, 0).build(); assertEquals(-2, byzantiumConfig.getExplosion(endOfIceAge, null)); BlockHeader startExplodingBlock = new BlockHeaderBuilder(FAKE_HASH, 3_200_000, 0).build(); assertEquals(0, byzantiumConfig.getExplosion(startExplodingBlock, null)); startExplodingBlock = new BlockHeaderBuilder(FAKE_HASH, 4_000_000, 0).build(); assertEquals(8, byzantiumConfig.getExplosion(startExplodingBlock, null)); startExplodingBlock = new BlockHeaderBuilder(FAKE_HASH, 6_000_000, 0).build(); assertEquals(28, byzantiumConfig.getExplosion(startExplodingBlock, null)); }