Esempio n. 1
0
        public async Task Get_GetBlockHashes_ReturnEmpty()
        {
            var chain = await _fullBlockchainService.GetChainAsync();

            var notExistHash = Hash.FromString("not exist");

            var result = await _fullBlockchainService.GetBlockHashesAsync(chain, notExistHash, 1, chain.BestChainHash);

            result.Count.ShouldBe(0);

            result = await _fullBlockchainService.GetBlockHashesAsync(chain, notExistHash, 1, chain.LongestChainHash);

            result.Count.ShouldBe(0);

            result = await _fullBlockchainService.GetBlockHashesAsync(chain, notExistHash, 1,
                                                                      _kernelTestHelper.ForkBranchBlockList.Last().GetHash());

            result.Count.ShouldBe(0);

            await _fullBlockchainService.GetBlockHashesAsync(chain, chain.BestChainHash, 10, chain.BestChainHash)
            .ContinueWith(p => p.Result.Count.ShouldBe(0));

            await _fullBlockchainService.GetBlockHashesAsync(chain, chain.LongestChainHash, 10, chain.LongestChainHash)
            .ContinueWith(p => p.Result.Count.ShouldBe(0));

            await _fullBlockchainService.GetBlockHashesAsync(chain,
                                                             _kernelTestHelper.ForkBranchBlockList.Last().GetHash(), 10,
                                                             _kernelTestHelper.ForkBranchBlockList.Last().GetHash())
            .ContinueWith(p => p.Result.Count.ShouldBe(0));
        }