Start testing inputs request
MODIFY
WalletWasabi.Tests/RegTests.cs
WalletWasabi.Tests/RegTests.cs
@@ -30,6 +30,7 @@ using Org.BouncyCastle.Asn1.IsisMtt.X509;
using Xunit;
using WalletWasabi.Backend.Models.Responses;
using WalletWasabi.ChaumianCoinJoin;
+using WalletWasabi.Backend.Models.Requests;
namespace WalletWasabi.Tests
{
@@ -1443,6 +1444,7 @@ namespace WalletWasabi.Tests
using (var client = new TorHttpClient(new Uri(RegTestFixture.BackendEndPoint)))
{
+ // Basic status tests.
using (var response = await client.SendAsync(HttpMethod.Get, "/api/v1/btc/chaumiancoinjoin/status/"))
{
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
@@ -1461,6 +1463,18 @@ namespace WalletWasabi.Tests
Assert.Equal(CcjRoundPhase.InputRegistration, status.CurrentPhase);
Assert.Equal(0, status.RegisteredPeerCount);
}
+
+ // Inputs request tests
+ var request = new InputsRequest
+ {
+ BlindedOutput = null,
+ ChangeOutputScript = null,
+ Inputs = null,
+ };
+ using (var response = await client.SendAsync(HttpMethod.Post, "/api/v1/btc/chaumiancoinjoin/inputs/", request.ToHttpStringContent()))
+ {
+ Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode);
+ }
}
}

MODIFY
WalletWasabi/Backend/Models/Requests/InputsRequest.cs
WalletWasabi/Backend/Models/Requests/InputsRequest.cs
@@ -3,6 +3,7 @@ using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
+using System.Net.Http;
using System.Text;
using WalletWasabi.JsonConverters;
@@ -19,5 +20,11 @@ namespace WalletWasabi.Backend.Models.Requests
[Required]
public string ChangeOutputScript { get; set; }
+
+ public StringContent ToHttpStringContent()
+ {
+ string jsonString = JsonConvert.SerializeObject(this, Formatting.None);
+ return new StringContent(jsonString, Encoding.UTF8, "application/json");
+ }
}
}

Start testing inputs request