Search in sources :

Example 16 with BlockResultDTO

use of org.ethereum.rpc.dto.BlockResultDTO in project rskj by rsksmart.

the class Web3Impl method eth_getUncleByBlockHashAndIndex.

@Override
public BlockResultDTO eth_getUncleByBlockHashAndIndex(String blockHash, String uncleIdx) {
    BlockResultDTO s = null;
    try {
        Block block = blockchain.getBlockByHash(stringHexToByteArray(blockHash));
        if (block == null) {
            return null;
        }
        s = getUncleResultDTO(uncleIdx, block);
        return s;
    } finally {
        if (logger.isDebugEnabled()) {
            logger.debug("eth_getUncleByBlockHashAndIndex({}, {}): {}", blockHash, uncleIdx, s);
        }
    }
}
Also used : BlockResultDTO(org.ethereum.rpc.dto.BlockResultDTO) Block(org.ethereum.core.Block)

Aggregations

BlockResultDTO (org.ethereum.rpc.dto.BlockResultDTO)16 World (co.rsk.test.World)14 Test (org.junit.Test)14 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)14 BlockBuilder (co.rsk.test.builders.BlockBuilder)12 AccountBuilder (co.rsk.test.builders.AccountBuilder)4 TransactionBuilder (co.rsk.test.builders.TransactionBuilder)4 Keccak256 (co.rsk.crypto.Keccak256)3 Block (org.ethereum.core.Block)2