public async Task GetBlocksAsync_Test() { var blockHashes = new List <Hash>(); var chain = await _kernelTestHelper.MockChainAsync(); var blockHash = chain.BestChainHash; for (var i = 0; i < chain.BestChainHeight; i++) { var block = await _blockchainService.GetBlockByHashAsync(blockHash); if (block == null) { break; } blockHashes.Add(blockHash); blockHash = block.Header.PreviousBlockHash; } var blocks = await _blockchainService.GetBlocksAsync(blockHashes); blocks.Count.ShouldBe(blockHashes.Count); }