Add roundId checks
MODIFY
WalletWasabi.Backend/Controllers/ChaumianCoinJoinController.cs
WalletWasabi.Backend/Controllers/ChaumianCoinJoinController.cs
@@ -66,7 +66,7 @@ namespace WalletWasabi.Backend.Controllers
/// Alice registers her inputs.
/// </summary>
/// <returns>BlindedOutputSignature, UniqueId</returns>
- /// <response code="200">BlindedOutputSignature, UniqueId</response>
+ /// <response code="200">BlindedOutputSignature, UniqueId, RoundId</response>
/// <response code="400">If request is invalid.</response>
/// <response code="503">If the round status changed while fulfilling the request.</response>
[HttpPost("inputs")]
@@ -256,7 +256,8 @@ namespace WalletWasabi.Backend.Controllers
var resp = new InputsResponse
{
UniqueId = alice.UniqueId,
- BlindedOutputSignature = signature
+ BlindedOutputSignature = signature,
+ RoundId = round.RoundId
};
return Ok(resp);
}
@@ -402,6 +403,26 @@ namespace WalletWasabi.Backend.Controllers
return Ok();
}
+ /// <summary>
+ /// Bob registers his output.
+ /// </summary>
+ [HttpPost("output")]
+ [ProducesResponseType(204)]
+ public IActionResult PostOutput()
+ {
+ return NoContent();
+ }
+
+ /// <summary>
+ /// Alice posts her partial signatures.
+ /// </summary>
+ [HttpPost("signatures")]
+ [ProducesResponseType(204)]
+ public IActionResult PostSignatures()
+ {
+ return NoContent();
+ }
+
private void CheckUniqueId(string uniqueId, out IActionResult returnFailureResponse)
{
returnFailureResponse = null;
@@ -426,25 +447,5 @@ namespace WalletWasabi.Backend.Controllers
returnFailureResponse = BadRequest("Invalid uniqueId provided.");
}
}
-
- /// <summary>
- /// Bob registers his output.
- /// </summary>
- [HttpPost("output")]
- [ProducesResponseType(204)]
- public IActionResult PostOutput()
- {
- return NoContent();
- }
-
- /// <summary>
- /// Alice posts her partial signatures.
- /// </summary>
- [HttpPost("signatures")]
- [ProducesResponseType(204)]
- public IActionResult PostSignatures()
- {
- return NoContent();
- }
}
}
\ No newline at end of file

MODIFY
WalletWasabi.Tests/RegTests.cs
WalletWasabi.Tests/RegTests.cs
@@ -1636,6 +1636,7 @@ namespace WalletWasabi.Tests
var inputsResp = await response.Content.ReadAsJsonAsync<InputsResponse>();
Assert.NotNull(inputsResp.BlindedOutputSignature);
Assert.NotEqual(Guid.Empty, inputsResp.UniqueId);
+ Assert.Equal(9, inputsResp.RoundId);
}
using (var response = await client.SendAsync(HttpMethod.Get, "/api/v1/btc/chaumiancoinjoin/status/"))
@@ -1695,6 +1696,7 @@ namespace WalletWasabi.Tests
var inputsResp = await response.Content.ReadAsJsonAsync<InputsResponse>();
Assert.NotNull(inputsResp.BlindedOutputSignature);
Assert.NotEqual(Guid.Empty, inputsResp.UniqueId);
+ Assert.Equal(9, inputsResp.RoundId);
}
using (var response = await client.SendAsync(HttpMethod.Get, "/api/v1/btc/chaumiancoinjoin/status/"))
@@ -1755,6 +1757,7 @@ namespace WalletWasabi.Tests
var inputsResp = await response.Content.ReadAsJsonAsync<InputsResponse>();
Assert.NotNull(inputsResp.BlindedOutputSignature);
Assert.NotEqual(Guid.Empty, inputsResp.UniqueId);
+ Assert.NotEqual(9, inputsResp.RoundId);
}
using (var response = await client.SendAsync(HttpMethod.Get, "/api/v1/btc/chaumiancoinjoin/status/"))

MODIFY
WalletWasabi/Backend/Models/Responses/InputsResponse.cs
WalletWasabi/Backend/Models/Responses/InputsResponse.cs
@@ -13,5 +13,7 @@ namespace WalletWasabi.Backend.Models.Responses
[JsonConverter(typeof(GuidJsonConverter))]
public Guid UniqueId { get; set; }
+
+ public long RoundId { get; set; }
}
}

Add roundId checks