StartCoinJoinAsync reports success status
MODIFY
WalletWasabi.Tests/UnitTests/WabiSabi/Integration/WabiSabiHttpApiIntegrationTests.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Integration/WabiSabiHttpApiIntegrationTests.cs
@@ -118,7 +118,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Integration
var coinJoinClient = new CoinJoinClient(apiClient, coins, kitchen, keyManager, roundStateUpdater);
// Run the coinjoin client task.
- await coinJoinClient.StartCoinJoinAsync(cts.Token, outputs?.Select(s => Money.Satoshis(s)));
+ Assert.True(await coinJoinClient.StartCoinJoinAsync(cts.Token, outputs?.Select(s => Money.Satoshis(s))));
var boadcastedTx = await transactionCompleted.Task.ConfigureAwait(false); // wait for the transaction to be broadcasted.
Assert.NotNull(boadcastedTx);

MODIFY
WalletWasabi/WabiSabi/Client/CoinJoinClient.cs
WalletWasabi/WabiSabi/Client/CoinJoinClient.cs
@@ -43,7 +43,7 @@ namespace WalletWasabi.WabiSabi.Client
public KeyManager Keymanager { get; }
private RoundStateUpdater RoundStatusUpdater { get; }
- public async Task StartCoinJoinAsync(CancellationToken cancellationToken, IEnumerable<Money>? forcedOutputDenominations = null)
+ public async Task<bool> StartCoinJoinAsync(CancellationToken cancellationToken, IEnumerable<Money>? forcedOutputDenominations = null)
{
var roundState = await RoundStatusUpdater.CreateRoundAwaiter(roundState => roundState.Phase == Phase.InputRegistration, cancellationToken).ConfigureAwait(false);
var constructionState = roundState.Assert<ConstructionState>();
@@ -90,6 +90,14 @@ namespace WalletWasabi.WabiSabi.Client
// Send signature.
await SignTransactionAsync(aliceClients, unsignedCoinJoin, cancellationToken).ConfigureAwait(false);
+
+ // TODO wait for round to end when it is pruned from the Arena:
+ // 1. success: round disappears without a trace (wait for it to appear in mempool?)
+ // 2. failed: a new round with isBlameOf appears
+
+ var finalRoundState = await RoundStatusUpdater.CreateRoundAwaiter(s => s.Id == roundState.Id && ( s.Phase == Phase.Failed || s.Phase == Phase.TransactionBroadcasting ), cancellationToken).ConfigureAwait(false);
+
+ return finalRoundState.Phase == Phase.TransactionBroadcasting;
}
private List<AliceClient> CreateAliceClients(RoundState roundState)

StartCoinJoinAsync reports success status