test getting the cj
MODIFY
WalletWasabi.Backend/Controllers/ChaumianCoinJoinController.cs
WalletWasabi.Backend/Controllers/ChaumianCoinJoinController.cs
@@ -512,9 +512,9 @@ namespace WalletWasabi.Backend.Controllers
/// <returns>Hx of the coinjoin transaction.</returns>
/// <response code="200">Returns the coinjoin transaction.</response>
/// <response code="400">The provided uniqueId or roundId was malformed.</response>
+ /// <response code="404">If Alice or the round is not found.</response>
/// <response code="409">CoinJoin can only be requested from Signing phase.</response>
/// <response code="410">CoinJoin can only be requested from a Running round.</response>
- /// <response code="404">If Alice or the round is not found.</response>
[HttpGet("coinjoin")]
[ProducesResponseType(200)]
[ProducesResponseType(400)]
@@ -553,7 +553,7 @@ namespace WalletWasabi.Backend.Controllers
CcjRoundPhase phase = round.Phase;
switch (phase)
{
- case CcjRoundPhase.InputRegistration:
+ case CcjRoundPhase.Signing:
{
return Ok(round.GetUnsignedCoinJoinHex());
}
@@ -627,7 +627,7 @@ namespace WalletWasabi.Backend.Controllers
CcjRoundPhase phase = round.Phase;
switch (phase)
{
- case CcjRoundPhase.InputRegistration:
+ case CcjRoundPhase.Signing:
{
using (await SigningLock.LockAsync())
{

MODIFY
WalletWasabi.Tests/RegTests.cs
WalletWasabi.Tests/RegTests.cs
@@ -2084,6 +2084,23 @@ namespace WalletWasabi.Tests
{
var states = await response.Content.ReadAsJsonAsync<IEnumerable<CcjRunningRoundState>>();
Assert.Equal(CcjRoundPhase.Signing, states.Single(x => x.RoundId == roundId).Phase);
+ Assert.Equal(2, states.Single(x => x.RoundId == roundId).RegisteredPeerCount);
+ Assert.Equal(2, states.Single(x => x.RoundId == roundId).RequiredPeerCount);
+ }
+
+ Transaction unsignedCoinJoin;
+ using (var response = await client.SendAsync(HttpMethod.Get, $"/api/v1/btc/chaumiancoinjoin/coinjoin?uniqueId={uniqueAliceId1}&roundId={roundId}"))
+ {
+ Assert.Equal(HttpStatusCode.OK, response.StatusCode);
+ var coinjoinHex = await response.Content.ReadAsJsonAsync<string>();
+ unsignedCoinJoin = new Transaction(coinjoinHex);
+ }
+
+ using (var response = await client.SendAsync(HttpMethod.Get, $"/api/v1/btc/chaumiancoinjoin/coinjoin?uniqueId={uniqueAliceId2}&roundId={roundId}"))
+ {
+ Assert.Equal(HttpStatusCode.OK, response.StatusCode);
+ var coinjoinHex = await response.Content.ReadAsJsonAsync<string>();
+ Assert.Equal(unsignedCoinJoin.ToHex(), coinjoinHex);
}
}
}

test getting the cj