package org.ethereum.jsontestsuite.builder;

import org.ethereum.core.Block;
import org.ethereum.core.BlockHeader;
import org.ethereum.jsontestsuite.Utils;
import org.ethereum.jsontestsuite.model.BlockHeaderTck;

import java.math.BigInteger;

import static org.ethereum.jsontestsuite.Utils.parseData;
import static org.ethereum.jsontestsuite.Utils.parseNumericData;

public class BlockHeaderBuilder {


    public static BlockHeader  build(BlockHeaderTck headerTck){

        BlockHeader header = new BlockHeader(
                parseData(headerTck.getParentHash()),
                parseData(headerTck.getUncleHash()),
                parseData(headerTck.getCoinbase()),
                parseData(headerTck.getBloom()),
                parseNumericData(headerTck.getDifficulty()),
                new BigInteger(parseData(headerTck.getNumber())).longValue(),
                parseData(headerTck.getGasLimit()),
                new BigInteger(parseData(headerTck.getGasUsed())).longValue(),
                new BigInteger(parseData(headerTck.getTimestamp())).longValue(),
                parseData(headerTck.getExtraData()),
                parseData(headerTck.getMixHash()),
                parseData(headerTck.getNonce())
        );

        header.setReceiptsRoot(parseData(headerTck.getReceiptTrie()));
        header.setTransactionsRoot(parseData(headerTck.getTransactionsTrie()));
        header.setStateRoot(parseData(headerTck.getStateRoot()));

        return header;
    }

}

@@ -799,32 +799,35 @@
  new BigInteger(
+1, 
 parseData(header
@@ -932,32 +932,35 @@
  new BigInteger(
+1, 
 parseData(header
@@ -1022,16 +1022,19 @@
 Integer(
+1, 
 parseDat

Fix JSON test data parsing