Remove contraversal part and add test
MODIFY
WalletWasabi.Tests/UnitTests/WabiSabi/Models/AmountDecompositionTests.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Models/AmountDecompositionTests.cs
@@ -10,10 +10,9 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Models
[Fact]
public void BaseDenomGeneratorTest()
{
- FeeRate feeRate = new(100m);
- var denoms = BaseDenominationGenerator.GenerateWithEffectiveCost(feeRate);
+ var denoms = BaseDenominationGenerator.Generate();
Assert.Equal(157, denoms.Count());
-
+ Assert.Equal(denoms, denoms.Distinct());
// It should be ordered.
Assert.Equal(denoms.OrderBy(d => d), denoms);
}

MODIFY
WalletWasabi/WabiSabi/Models/Decomposition/BaseDenomGenerator.cs
WalletWasabi/WabiSabi/Models/Decomposition/BaseDenomGenerator.cs
@@ -13,7 +13,7 @@ namespace WalletWasabi.WabiSabi.Models.Decomposition
private static IEnumerable<Money> Multiple(IEnumerable<long> coefficients, IEnumerable<long> values) =>
values.SelectMany(v => coefficients.Select(c => Money.Satoshis(c * v))).Where(x => x <= MaxSats);
- private static IEnumerable<Money> Generate()
+ public static IEnumerable<Money> Generate()
{
var powersOfTwo = Enumerable.Range(0, 50).Select(x => (long)1m << x);
var powersOfThree = Enumerable.Range(0, 32).Select(x => (long)Math.Pow(3, x));
@@ -28,12 +28,5 @@ namespace WalletWasabi.WabiSabi.Models.Decomposition
.Union(preferredValueSeries)
.OrderBy(v => v);
}
-
- public static IEnumerable<Money> GenerateWithEffectiveCost(FeeRate feeRate)
- {
- var outputSize = Constants.OutputSizeInBytes;
- var fee = feeRate.GetFee(outputSize);
- return Generate().Select(m => m + fee);
- }
}
}

Remove contraversal part and add test