use of com.github.rosklyar.client.blockchain.domain.block.BlockHeight in project nem-library by rosklyar.
the class BlockchainClientTest method getBlock.
@Test
void getBlock() {
Block lastBlock = blockchainClient.lastBlock();
Block block = blockchainClient.block(new BlockHeight(lastBlock.height));
assertEquals(lastBlock, block);
}
use of com.github.rosklyar.client.blockchain.domain.block.BlockHeight in project nem-library by rosklyar.
the class BlockchainClientTest method getBlocks.
@Test
@Disabled("only for local NIS")
void getBlocks() {
Block lastBlock = blockchainClient.lastBlock();
assertTrue(lastBlock.height > 0);
Block block = blockchainClient.block(new BlockHeight(lastBlock.height));
assertEquals(lastBlock, block);
BlocksAfterResponse blocksAfterResponse = blockchainClient.blocksAfter(new BlockHeight(lastBlock.height - 10));
assertEquals(10, blocksAfterResponse.data.size());
assertEquals(lastBlock, blocksAfterResponse.data.stream().filter(blockInfo -> blockInfo.block.height == lastBlock.height).findFirst().orElseThrow(RuntimeException::new).block);
}
use of com.github.rosklyar.client.blockchain.domain.block.BlockHeight in project nem-library by rosklyar.
the class NodeClientTest method getMaxChainHeight.
@Test
void getMaxChainHeight() {
BlockHeight blockHeight = nodeClient.maxChainHeight();
assertTrue(blockHeight.height > 0);
}
Aggregations