@Test public void testEcip1010ExplosionChanges() throws Exception { ETCFork3M etcFork3M = new ETCFork3M(new TestBlockchainConfig()); BlockHeader beforePauseBlock = new BlockHeaderBuilder(new byte[]{11, 12}, 2_500_000, 0).build(); int unimplementedPrePauseBlockExplosion = 28; assertEquals(unimplementedPrePauseBlockExplosion, etcFork3M.getExplosion(beforePauseBlock, null)); BlockHeader endOfIceAge = new BlockHeaderBuilder(new byte[]{11, 12}, 5_000_000, 0).build(); assertEquals(28, etcFork3M.getExplosion(endOfIceAge, null)); BlockHeader startExplodingBlock = new BlockHeaderBuilder(new byte[]{11, 12}, 5_200_000, 0).build(); assertEquals(30, etcFork3M.getExplosion(startExplodingBlock, null)); startExplodingBlock = new BlockHeaderBuilder(new byte[]{11, 12}, 6_000_000, 0).build(); assertEquals(38, etcFork3M.getExplosion(startExplodingBlock, null)); }
protected int getExplosion(BlockHeader curBlock, BlockHeader parent) { int pauseBlock = 3000000; int contBlock = 5000000; int delay = (contBlock - pauseBlock) / 100000; int fixedDiff = (pauseBlock / 100000) - 2; if (curBlock.getNumber() < contBlock) { return fixedDiff; } else { return (int) ((curBlock.getNumber() / 100000) - delay - 2); } }
ETCFork3M extends Eip160HFConfig { protected int getExplosion(BlockHeader curBlock, BlockHeader parent) { int pauseBlock = 3000000; int contBlock = 5000000; int delay = (contBlock - pauseBlock) / 100000; int fixedDiff = (pauseBlock / 100000) - 2; if (curBlock.getNumber() < contBlock) { return fixedDiff; } else { return (int) ((curBlock.getNumber() / 100000) - delay - 2); } } }
ETCFork3M extends Eip160HFConfig { protected int getExplosion(BlockHeader curBlock, BlockHeader parent) { int pauseBlock = 3000000; int contBlock = 5000000; int delay = (contBlock - pauseBlock) / 100000; int fixedDiff = (pauseBlock / 100000) - 2; if (curBlock.getNumber() < contBlock) { return fixedDiff; } else { return (int) ((curBlock.getNumber() / 100000) - delay - 2); } } ETCFork3M(BlockchainConfig parent); }
ETCFork3M extends Eip160HFConfig { protected int getExplosion(BlockHeader curBlock, BlockHeader parent) { int pauseBlock = 3000000; int contBlock = 5000000; int delay = (contBlock - pauseBlock) / 100000; int fixedDiff = (pauseBlock / 100000) - 2; if (curBlock.getNumber() < contBlock) { return fixedDiff; } else { return (int) ((curBlock.getNumber() / 100000) - delay - 2); } } ETCFork3M(BlockchainConfig parent); @Override Integer getChainId(); @Override boolean eip161(); @Override BigInteger calcDifficulty(BlockHeader curBlock, BlockHeader parent); @Override BigInteger getCalcDifficultyMultiplier(BlockHeader curBlock, BlockHeader parent); }
ETCFork3M extends Eip160HFConfig { protected int getExplosion(BlockHeader curBlock, BlockHeader parent) { int pauseBlock = 3000000; int contBlock = 5000000; int delay = (contBlock - pauseBlock) / 100000; int fixedDiff = (pauseBlock / 100000) - 2; if (curBlock.getNumber() < contBlock) { return fixedDiff; } else { return (int) ((curBlock.getNumber() / 100000) - delay - 2); } } ETCFork3M(BlockchainConfig parent); @Override Integer getChainId(); @Override boolean eip161(); @Override BigInteger calcDifficulty(BlockHeader curBlock, BlockHeader parent); @Override BigInteger getCalcDifficultyMultiplier(BlockHeader curBlock, BlockHeader parent);  }