@Test public void testExplosionChanges() throws Exception { BlockHeader beforePauseBlock = new BlockHeaderBuilder(FAKE_HASH, 4_000_000, 0).build(); assertEquals(-2, constantinopleConfig.getExplosion(beforePauseBlock, null)); BlockHeader endOfIceAge = new BlockHeaderBuilder(FAKE_HASH, 5_000_000, 0).build(); assertEquals(-2, constantinopleConfig.getExplosion(endOfIceAge, null)); BlockHeader startExplodingBlock = new BlockHeaderBuilder(FAKE_HASH, 5_200_000, 0).build(); assertEquals(0, constantinopleConfig.getExplosion(startExplodingBlock, null)); startExplodingBlock = new BlockHeaderBuilder(FAKE_HASH, 6_000_000, 0).build(); assertEquals(8, constantinopleConfig.getExplosion(startExplodingBlock, null)); startExplodingBlock = new BlockHeaderBuilder(FAKE_HASH, 8_000_000, 0).build(); assertEquals(28, constantinopleConfig.getExplosion(startExplodingBlock, null)); }
@Override protected int getExplosion(BlockHeader curBlock, BlockHeader parent) { int periodCount = (int) (Math.max(0, curBlock.getNumber() - 5_000_000) / getConstants().getEXP_DIFFICULTY_PERIOD()); return periodCount - 2; }
ConstantinopleConfig extends ByzantiumConfig { @Override protected int getExplosion(BlockHeader curBlock, BlockHeader parent) { int periodCount = (int) (Math.max(0, curBlock.getNumber() - 5_000_000) / getConstants().getEXP_DIFFICULTY_PERIOD()); return periodCount - 2; } }
ConstantinopleConfig extends ByzantiumConfig { @Override protected int getExplosion(BlockHeader curBlock, BlockHeader parent) { int periodCount = (int) (Math.max(0, curBlock.getNumber() - 5_000_000) / getConstants().getEXP_DIFFICULTY_PERIOD()); return periodCount - 2; } ConstantinopleConfig(BlockchainConfig parent); }
ConstantinopleConfig extends ByzantiumConfig { @Override protected int getExplosion(BlockHeader curBlock, BlockHeader parent) { int periodCount = (int) (Math.max(0, curBlock.getNumber() - 5_000_000) / getConstants().getEXP_DIFFICULTY_PERIOD()); return periodCount - 2; } ConstantinopleConfig(BlockchainConfig parent); @Override Constants getConstants(); @Override boolean eip1052(); @Override boolean eip145(); @Override boolean eip1283(); @Override boolean eip1014(); }
ConstantinopleConfig extends ByzantiumConfig { @Override protected int getExplosion(BlockHeader curBlock, BlockHeader parent) { int periodCount = (int) (Math.max(0, curBlock.getNumber() - 5_000_000) / getConstants().getEXP_DIFFICULTY_PERIOD()); return periodCount - 2; } ConstantinopleConfig(BlockchainConfig parent); @Override Constants getConstants(); @Override boolean eip1052(); @Override boolean eip145(); @Override boolean eip1283(); @Override boolean eip1014();  }