Test until connection confirmation
MODIFY
HiddenWallet.ChaumianTumbler/Controllers/TumblerController.cs
HiddenWallet.ChaumianTumbler/Controllers/TumblerController.cs
@@ -385,6 +385,7 @@ namespace HiddenWallet.ChaumianTumbler.Controllers
{
failed = false;
state = CoinJoinTransactionState.Succeeded;
+ Console.WriteLine($"Propagated transaction: {Global.StateMachine.CoinJoin.GetHash()}");
}
Global.CoinJoinStore.Transactions.Add(new CoinJoinTransaction
{

MODIFY
HiddenWallet/ChaumianCoinJoin/ChaumianTumblerClient.cs
HiddenWallet/ChaumianCoinJoin/ChaumianTumblerClient.cs
@@ -84,6 +84,84 @@ namespace HiddenWallet.ChaumianCoinJoin
}
}
+ public async Task PostConnectionConfirmationAsync(ConnectionConfirmationRequest request, CancellationToken cancel)
+ {
+ using (await _asyncLock.LockAsync())
+ {
+ string requestJsonString = JsonConvert.SerializeObject(request);
+ var content = new StringContent(
+ requestJsonString,
+ Encoding.UTF8,
+ "application/json");
+
+ HttpResponseMessage response =
+ await HttpClient.PostAsync("connection-confirmation", content, cancel);
+
+ if (!response.IsSuccessStatusCode) throw new HttpRequestException(response.StatusCode.ToString());
+ string responseString = await response.Content.ReadAsStringAsync();
+ AssertSuccess(responseString);
+ }
+ }
+
+ public async Task PostOutputAsync(OutputRequest request, CancellationToken cancel)
+ {
+ using (await _asyncLock.LockAsync())
+ {
+ string requestJsonString = JsonConvert.SerializeObject(request);
+ var content = new StringContent(
+ requestJsonString,
+ Encoding.UTF8,
+ "application/json");
+
+ HttpResponseMessage response =
+ await HttpClient.PostAsync("output", content, cancel);
+
+ if (!response.IsSuccessStatusCode) throw new HttpRequestException(response.StatusCode.ToString());
+ string responseString = await response.Content.ReadAsStringAsync();
+ AssertSuccess(responseString);
+ }
+ }
+
+ public async Task<CoinJoinResponse> PostCoinJoinAsync(CoinJoinRequest request, CancellationToken cancel)
+ {
+ using (await _asyncLock.LockAsync())
+ {
+ string requestJsonString = JsonConvert.SerializeObject(request);
+ var content = new StringContent(
+ requestJsonString,
+ Encoding.UTF8,
+ "application/json");
+
+ HttpResponseMessage response =
+ await HttpClient.PostAsync("coinjoin", content, cancel);
+
+ if (!response.IsSuccessStatusCode) throw new HttpRequestException(response.StatusCode.ToString());
+ string responseString = await response.Content.ReadAsStringAsync();
+ AssertSuccess(responseString);
+
+ return JsonConvert.DeserializeObject<CoinJoinResponse>(responseString);
+ }
+ }
+
+ public async Task PostSignatureAsync(SignatureRequest request, CancellationToken cancel)
+ {
+ using (await _asyncLock.LockAsync())
+ {
+ string requestJsonString = JsonConvert.SerializeObject(request);
+ var content = new StringContent(
+ requestJsonString,
+ Encoding.UTF8,
+ "application/json");
+
+ HttpResponseMessage response =
+ await HttpClient.PostAsync("signature", content, cancel);
+
+ if (!response.IsSuccessStatusCode) throw new HttpRequestException(response.StatusCode.ToString());
+ string responseString = await response.Content.ReadAsStringAsync();
+ AssertSuccess(responseString);
+ }
+ }
+
public async Task<InputRegistrationStatusResponse> GetInputRegistrationStatusAsync(CancellationToken cancel)
{
using (await _asyncLock.LockAsync())

Test until connection confirmation