Remove BackendHttpClient.
MODIFY
WalletWasabi.Tests/RegressionTests/BackendTests.cs
WalletWasabi.Tests/RegressionTests/BackendTests.cs
@@ -30,16 +30,16 @@ namespace WalletWasabi.Tests.RegressionTests
{
RegTestFixture = regTestFixture;
BackendHttpClient = new ClearnetHttpClient(() => RegTestFixture.BackendEndPointUri);
- BackendApiHttpClient = new BackendHttpClient(new ClearnetHttpClient(() => RegTestFixture.BackendEndPointApiUri));
+ BackendApiHttpClient = new ClearnetHttpClient(() => RegTestFixture.BackendEndPointApiUri);
}
private RegTestFixture RegTestFixture { get; }
/// <summary>Clearnet HTTP client with predefined base URI for Wasabi Backend (note: <c>/api</c> is not part of base URI).</summary>
- public ClearnetHttpClient BackendHttpClient { get; }
+ public IHttpClient BackendHttpClient { get; }
/// <summary>Clearnet HTTP client with predefined base URI for Wasabi Backend API queries.</summary>
- private BackendHttpClient BackendApiHttpClient { get; }
+ private IHttpClient BackendApiHttpClient { get; }
#region BackendTests

DELETE
WalletWasabi/Tor/Http/BackendHttpClient.cs
-using System;
-using System.Net.Http;
-using System.Threading;
-using System.Threading.Tasks;
-
-namespace WalletWasabi.Tor.Http
-{
- /// <summary>
- /// Convenience class that allows sending HTTP request to Wasabi Backend using relative URIs.
- /// </summary>
- public class BackendHttpClient
- {
- /// <summary>
- /// Creates a new instance of the object.
- /// </summary>
- /// <param name="httpClient">Use <see cref="ClearnetHttpClient"/> or <see cref="TorHttpClient"/> to initialize.</param>
- public BackendHttpClient(IHttpClient httpClient)
- {
- HttpClient = httpClient;
- }
-
- private IHttpClient HttpClient { get; }
-
- /// <summary>
- /// Sends an HTTP request to Wasabi Backend.
- /// </summary>
- /// <param name="method">HTTP method</param>
- /// <param name="apiQuery">API query part to append to <see cref="IHttpClient.BaseUriGetter"/>.</param>
- /// <param name="content">HTTP request content. Only for <see cref="HttpMethod.Post"/> method.</param>
- /// <param name="token">Cancellation token to cancel the asynchronous operation.</param>
- public Task<HttpResponseMessage> SendAsync(HttpMethod method, string apiQuery, HttpContent? content = null, CancellationToken token = default)
- {
- if (apiQuery.StartsWith("/"))
- {
- throw new ArgumentException("Forward slash would lead to http://backend:port/<relativeUri> URI instead of http://backend:port/api/v<version>/<relativeUri>.", nameof(apiQuery));
- }
-
- return HttpClient.SendAsync(method, apiQuery, content, token);
- }
- }
-}

Remove BackendHttpClient.

Signed-off-by: Kiminuo <kiminuo@protonmail.com>