Add overloads for coins dequeue
MODIFY
WalletWasabi.Tests/RegTests.cs
WalletWasabi.Tests/RegTests.cs
@@ -2209,15 +2209,14 @@ namespace WalletWasabi.Tests
Assert.Throws<SecurityException>(() => chaumianClient.QueueCoinsToMix("asdasdasd", smartCoin1, smartCoin2));
// Make sure it doesn't throw.
- await chaumianClient.DequeueCoinsFromMixAsync();
await chaumianClient.DequeueCoinsFromMixAsync((smartCoin1.TransactionId, smartCoin1.Index));
Assert.True(2 == chaumianClient.QueueCoinsToMix(password, smartCoin1, smartCoin2).Count());
await chaumianClient.DequeueCoinsFromMixAsync((smartCoin1.TransactionId, 111));
- await chaumianClient.DequeueCoinsFromMixAsync((smartCoin1.TransactionId, smartCoin1.Index), (smartCoin2.TransactionId, smartCoin2.Index));
+ await chaumianClient.DequeueCoinsFromMixAsync(smartCoin1, smartCoin2);
Assert.True(2 == chaumianClient.QueueCoinsToMix(password, smartCoin1, smartCoin2).Count());
- await chaumianClient.DequeueCoinsFromMixAsync((smartCoin1.TransactionId, smartCoin1.Index));
- await chaumianClient.DequeueCoinsFromMixAsync((smartCoin2.TransactionId, smartCoin2.Index));
+ await chaumianClient.DequeueCoinsFromMixAsync(smartCoin1);
+ await chaumianClient.DequeueCoinsFromMixAsync(smartCoin2);
}
finally
{

MODIFY
WalletWasabi/Services/CcjClient.cs
WalletWasabi/Services/CcjClient.cs
@@ -247,6 +247,22 @@ namespace WalletWasabi.Services
}
}
+ /// <summary>
+ /// Unlock coin after dequeuing it.
+ /// </summary>
+ public async Task DequeueCoinsFromMixAsync(params MixCoin[] coins)
+ {
+ await DequeueCoinsFromMixAsync(coins.Select(x => (x.SmartCoin.TransactionId, x.SmartCoin.Index)).ToArray());
+ }
+
+ /// <summary>
+ /// Unlock coin after dequeuing it.
+ /// </summary>
+ public async Task DequeueCoinsFromMixAsync(params SmartCoin[] coins)
+ {
+ await DequeueCoinsFromMixAsync(coins.Select(x => (x.TransactionId, x.Index)).ToArray());
+ }
+
/// <summary>
/// Unlock coin after dequeuing it.
/// </summary>
@@ -325,7 +341,7 @@ namespace WalletWasabi.Services
try
{
// Try to dequeue all coins at last. This should be done manually, and prevent the closing of the software if unsuccessful.
- await DequeueCoinsFromMixAsync(CoinsWaitingForMix.Select(x => (x.SmartCoin.TransactionId, x.SmartCoin.Index)).ToArray());
+ await DequeueCoinsFromMixAsync(Rounds.SelectMany(x=>x.CoinsRegistered).Concat(CoinsWaitingForMix).ToArray());
}
catch (Exception ex)
{

Add overloads for coins dequeue