Remove output denominations parameter
Previously used for debugging in a test, no longer required
MODIFY
WalletWasabi.Tests/UnitTests/WabiSabi/Integration/WabiSabiHttpApiIntegrationTests.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Integration/WabiSabiHttpApiIntegrationTests.cs
@@ -53,10 +53,9 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Integration
[Theory]
[InlineData(new long[] { 20_000_000, 40_000_000, 60_000_000, 80_000_000 })]
[InlineData(new long[] { 10_000_000, 20_000_000, 30_000_000, 40_000_000, 100_000_000 })]
- [InlineData(new long[] { 10_000_000, 20_000_000, 30_000_000, 40_000_000, 100_000_000 }, new long[] { 100_000_000, 100_000_000 })]
- [InlineData(new long[] { 120_000_000 }, new long[] { 20_000_000, 40_000_000, 60_000_000 })]
+ [InlineData(new long[] { 120_000_000 })]
[InlineData(new long[] { 100_000_000, 10_000_000, 10_000 })]
- public async Task SoloCoinJoinTestAsync(long[] amounts, long[]? outputDenominations = null)
+ public async Task SoloCoinJoinTestAsync(long[] amounts)
{
int inputCount = amounts.Length;
@@ -121,7 +120,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Integration
var coinJoinClient = new CoinJoinClient(apiClient, coins, kitchen, keyManager, roundStateUpdater);
// Run the coinjoin client task.
- Assert.True(await coinJoinClient.StartCoinJoinAsync(cts.Token, outputDenominations?.Select(s => Money.Satoshis(s))));
+ Assert.True(await coinJoinClient.StartCoinJoinAsync(cts.Token));
var broadcastedTx = await transactionCompleted.Task.ConfigureAwait(false); // wait for the transaction to be broadcasted.
Assert.NotNull(broadcastedTx);
@@ -133,7 +132,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Integration
[InlineData(new long[] { 20_000_000, 40_000_000, 60_000_000, 80_000_000 })]
[InlineData(new long[] { 10_000_000, 20_000_000, 30_000_000, 40_000_000, 100_000_000 })]
[InlineData(new long[] { 100_000_000, 10_000_000, 10_000 })]
- public async Task SoloCoinJoinWithBlameRoundTestAsync(long[] amounts, long[]? outputDenominations = null)
+ public async Task SoloCoinJoinWithBlameRoundTestAsync(long[] amounts)
{
int inputCount = amounts.Length;

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<bool> StartCoinJoinAsync(CancellationToken cancellationToken, IEnumerable<Money>? forcedOutputDenominations = null)
+ public async Task<bool> StartCoinJoinAsync(CancellationToken cancellationToken)
{
var currentRoundState = await RoundStatusUpdater.CreateRoundAwaiter(roundState => roundState.Phase == Phase.InputRegistration, cancellationToken).ConfigureAwait(false);
@@ -56,7 +56,7 @@ namespace WalletWasabi.WabiSabi.Client
for (var tries = 0; tries < tryLimit; tries++)
{
- if (await StartRoundAsync(currentRoundState, cancellationToken, forcedOutputDenominations))
+ if (await StartRoundAsync(currentRoundState, cancellationToken))
{
return true;
}
@@ -70,12 +70,12 @@ namespace WalletWasabi.WabiSabi.Client
return false;
}
- public async Task<bool> StartRoundAsync(RoundState roundState, CancellationToken cancellationToken, IEnumerable<Money>? forcedOutputDenominations = null)
+ public async Task<bool> StartRoundAsync(RoundState roundState, CancellationToken cancellationToken)
{
var constructionState = roundState.Assert<ConstructionState>();
// Calculate outputs values
- var outputValues = DecomposeAmounts(roundState.FeeRate, roundState.CoinjoinState.Parameters.AllowedOutputAmounts.Min, forcedOutputDenominations);
+ var outputValues = DecomposeAmounts(roundState.FeeRate, roundState.CoinjoinState.Parameters.AllowedOutputAmounts.Min);
// Get all locked internal keys we have and assert we have enough.
Keymanager.AssertLockedInternalKeysIndexed(howMany: outputValues.Count());
@@ -150,10 +150,9 @@ namespace WalletWasabi.WabiSabi.Client
await Task.WhenAll(registerRequests).ConfigureAwait(false);
}
- private IEnumerable<Money> DecomposeAmounts(FeeRate feeRate, Money minimumOutputAmount, IEnumerable<Money>? forcedOutputDenominations = null)
+ private IEnumerable<Money> DecomposeAmounts(FeeRate feeRate, Money minimumOutputAmount)
{
- var allDenominations = forcedOutputDenominations is null ? StandardDenomination.Values : forcedOutputDenominations;
- GreedyDecomposer greedyDecomposer = new(allDenominations.Where(x => x >= minimumOutputAmount));
+ GreedyDecomposer greedyDecomposer = new(StandardDenomination.Values.Where(x => x >= minimumOutputAmount));
var sum = Coins.Sum(c => c.EffectiveValue(feeRate));
return greedyDecomposer.Decompose(sum, feeRate.GetFee(31));
}

Remove output denominations parameter

Previously used for debugging in a test, no longer required