Search in sources :

Example 1 with BlockHeaderTck

use of org.ethereum.jsontestsuite.model.BlockHeaderTck in project rskj by rsksmart.

the class BlockBuilder method build.

public static Block build(BlockHeaderTck header, List<TransactionTck> transactionsTck, List<BlockHeaderTck> unclesTck) {
    if (header == null)
        return null;
    List<BlockHeader> uncles = new ArrayList<>();
    if (unclesTck != null)
        for (BlockHeaderTck uncle : unclesTck) uncles.add(BlockHeaderBuilder.build(uncle));
    List<Transaction> transactions = new ArrayList<>();
    if (transactionsTck != null)
        for (TransactionTck tx : transactionsTck) transactions.add(TransactionBuilder.build(tx));
    BlockHeader blockHeader = BlockHeaderBuilder.build(header);
    Block block = new Block(blockHeader, transactions, uncles);
    return block;
}
Also used : Transaction(org.ethereum.core.Transaction) ArrayList(java.util.ArrayList) BlockHeaderTck(org.ethereum.jsontestsuite.model.BlockHeaderTck) Block(org.ethereum.core.Block) BlockHeader(org.ethereum.core.BlockHeader) TransactionTck(org.ethereum.jsontestsuite.model.TransactionTck)

Aggregations

ArrayList (java.util.ArrayList)1 Block (org.ethereum.core.Block)1 BlockHeader (org.ethereum.core.BlockHeader)1 Transaction (org.ethereum.core.Transaction)1 BlockHeaderTck (org.ethereum.jsontestsuite.model.BlockHeaderTck)1 TransactionTck (org.ethereum.jsontestsuite.model.TransactionTck)1