}
@Test
public void fork2() throws URISyntaxException, IOException {
BlockchainImpl blockchain = (BlockchainImpl) worldManager.getBlockchain();
URL massiveUpload_1 = ClassLoader
.getSystemResource("fork/scenario2.dmp");
File file = new File(massiveUpload_1.toURI());
List<String> strData = Files.readAllLines(file.toPath(), StandardCharsets.UTF_8);
for(String blockRLP : strData){
Block block = new Block(
Hex.decode(blockRLP));
logger.info("sending block.hash: {}", Hex.toHexString( block.getHash() ));
blockchain.tryToConnect(block);
}
List<Chain> altChains = blockchain.getAltChains();
List<Block> garbage = blockchain.getGarbage();
assertEquals(2, altChains.size());
// assertEquals(13, altChains.get(0).getSize());
assertEquals(new BigInteger("13238272"), altChains.get(0).getTotalDifficulty());
assertEquals(new BigInteger("13369344"), altChains.get(1).getTotalDifficulty());
assertEquals(new BigInteger("13238272"), blockchain.getTotalDifficulty() );
assertEquals(100, blockchain.getSize());
assertEquals(0, garbage.size());
System.out.println();
}