public async Task RequestBlockAsync_Success() { var block = await _grpcPeer.RequestBlockAsync(Hash.Generate()); block.ShouldBeNull(); var blockHeader = await _blockchainService.GetBestChainLastBlockHeaderAsync(); block = await _grpcPeer.RequestBlockAsync(blockHeader.GetHash()); block.ShouldNotBeNull(); }
public async Task RequestBlockAsync_Failed() { _grpcPeer = CreateNewPeer("127.0.0.1:3000", false); _pool.AddPeer(_grpcPeer); var blockHeader = await _blockchainService.GetBestChainLastBlockHeaderAsync(); var block = await _grpcPeer.RequestBlockAsync(blockHeader.GetHash()); block.ShouldBeNull(); }