Add TorProcessManager, bring the IsTorRunning function to it and start implementing StartAsync
MODIFY
WalletWasabi.Tests/TorTests.cs
WalletWasabi.Tests/TorTests.cs
@@ -189,8 +189,8 @@ namespace WalletWasabi.Tests
[Fact]
public async Task TorRunningAsync()
{
- Assert.True(await TorHttpClient.IsTorRunningAsync());
- Assert.False(await TorHttpClient.IsTorRunningAsync(new IPEndPoint(IPAddress.Loopback, 9054)));
+ Assert.True(await TorProcessManager.IsTorRunningAsync());
+ Assert.False(await TorProcessManager.IsTorRunningAsync(new IPEndPoint(IPAddress.Loopback, 9054)));
}
private static async Task<List<string>> QBitTestAsync(TorHttpClient client, int times, bool alterRequests = false)

MODIFY
WalletWasabi/TorSocks5/TorHttpClient.cs
WalletWasabi/TorSocks5/TorHttpClient.cs
@@ -45,23 +45,6 @@ namespace WalletWasabi.TorSocks5
IsolateStream = isolateStream;
}
- public static async Task<bool> IsTorRunningAsync(IPEndPoint torSocks5EndPoint = null)
- {
- using (var client = new TorSocks5Client(torSocks5EndPoint))
- {
- try
- {
- await client.ConnectAsync();
- await client.HandshakeAsync();
- }
- catch (ConnectionException)
- {
- return false;
- }
- return true;
- }
- }
-
/// <remarks>
/// Throws OperationCancelledException if <paramref name="cancel"/> is set.
/// </remarks>

Add TorProcessManager, bring the IsTorRunning function to it and start implementing StartAsync