Fix Test nad move log arg
MODIFY
WalletWasabi.Tests/UnitTests/Tor/TorSettingsTests.cs
WalletWasabi.Tests/UnitTests/Tor/TorSettingsTests.cs
@@ -2,6 +2,7 @@ using System.Net;
using System.Runtime.InteropServices;
using WalletWasabi.Tor;
using Xunit;
+using System.IO;
namespace WalletWasabi.Tests.UnitTests.Tor
{
@@ -13,20 +14,17 @@ namespace WalletWasabi.Tests.UnitTests.Tor
[Fact]
public void GetCmdArgumentsTest()
{
- var settings = new TorSettings("temp", "temp/Tor.log", "temp/TorDaemons");
+ var settings = new TorSettings(Path.Combine("temp", "tempdata"), Path.Combine("temp", "Tor.log"), "tempdist");
var endpoint = new IPEndPoint(IPAddress.Loopback, WalletWasabi.Helpers.Constants.DefaultTorSocksPort);
string arguments = settings.GetCmdArguments(endpoint);
- string expected;
- if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
- {
- expected = @"--SOCKSPort 127.0.0.1:9050 --DataDirectory ""temp\tordata"" --GeoIPFile ""temp\tor\Data\Tor\geoip"" GeoIPv6File ""temp\tor\Data\Tor\geoip6""";
- }
- else
- {
- expected = @"--SOCKSPort 127.0.0.1:9050 --DataDirectory ""temp/tordata"" --GeoIPFile ""temp/tor/Data/Tor/geoip"" GeoIPv6File ""temp/tor/Data/Tor/geoip6""";
- }
+ string expected = string.Join(" ",
+ $"--SOCKSPort 127.0.0.1:9050",
+ $"--DataDirectory \"{Path.Combine("temp", "tempdata", "tordata")}\"",
+ $"--GeoIPFile \"{Path.Combine("tempdist", "Tor", "Geoip", "geoip")}\"",
+ $"--GeoIPv6File \"{Path.Combine("tempdist", "Tor", "Geoip", "geoip6")}\"",
+ $"--Log \"notice file {Path.Combine("temp", "Tor.log")}\"");
Assert.Equal(expected, arguments);
}

MODIFY
WalletWasabi/Tor/TorProcessManager.cs
WalletWasabi/Tor/TorProcessManager.cs
@@ -88,7 +88,7 @@ namespace WalletWasabi.Tor
return true;
}
- string torArguments = Settings.GetCmdArguments(TorSocks5EndPoint) + $" --Log \"notice file {Settings.LogFilePath}\"";
+ string torArguments = Settings.GetCmdArguments(TorSocks5EndPoint);
var startInfo = new ProcessStartInfo
{

MODIFY
WalletWasabi/Tor/TorSettings.cs
WalletWasabi/Tor/TorSettings.cs
@@ -50,9 +50,12 @@ namespace WalletWasabi.Tor
public string GetCmdArguments(EndPoint torSocks5EndPoint)
{
- return $"--SOCKSPort {torSocks5EndPoint} " +
- $"--DataDirectory \"{TorDataDir}\" " +
- $"--GeoIPFile \"{GeoIpPath}\" GeoIPv6File \"{GeoIp6Path}\"";
+ return string.Join(" ",
+ $"--SOCKSPort {torSocks5EndPoint}",
+ $"--DataDirectory \"{TorDataDir}\"",
+ $"--GeoIPFile \"{GeoIpPath}\"",
+ $"--GeoIPv6File \"{GeoIp6Path}\"",
+ $"--Log \"notice file {LogFilePath}\"");
}
}
}

Fix Test nad move log arg