Examples of calcDifficulty()


Examples of org.ethereum.core.Block.calcDifficulty()

    @Test
    public void testCalcDifficulty() {

        Blockchain blockchain = worldManager.getBlockchain();
        Block genesis = Genesis.getInstance();
        BigInteger difficulty = new BigInteger(1, genesis.calcDifficulty());
        logger.info("Genesis difficulty: [{}]", difficulty.toString());
        assertEquals(new BigInteger(1, Genesis.DIFFICULTY), difficulty);

        // Storing genesis because the parent needs to be in the DB for calculation.
        blockchain.add(genesis);
View Full Code Here

Examples of org.ethereum.core.Block.calcDifficulty()

        // Storing genesis because the parent needs to be in the DB for calculation.
        blockchain.add(genesis);

        Block block1 = new Block(Hex.decode(PoC7_GENESIS_HEX_RLP_ENCODED));
        BigInteger calcDifficulty = new BigInteger(1, block1.calcDifficulty());
        BigInteger actualDifficulty = new BigInteger(1, block1.getDifficulty());
        logger.info("Block#1 actual difficulty: [{}] ", actualDifficulty.toString());
        logger.info("Block#1 calculated difficulty: [{}] ", calcDifficulty.toString());
        assertEquals(actualDifficulty, calcDifficulty);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.