remove the only semi private cases
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/LabelSelectionViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/LabelSelectionViewModel.cs
@@ -63,11 +63,6 @@ public partial class LabelSelectionViewModel : ViewModelBase
return new[] { _privatePocket };
}
- if (_semiPrivatePocket.Amount >= _targetAmount)
- {
- return new[] { _semiPrivatePocket };
- }
-
if (privateAndSemiPrivatePockets.Sum(x => x.Amount) >= _targetAmount)
{
return privateAndSemiPrivatePockets;
@@ -274,10 +269,6 @@ public partial class LabelSelectionViewModel : ViewModelBase
{
_hiddenIncludedPockets.Add(_privatePocket);
}
- else if (IsSemiPrivatePocketNeeded())
- {
- _hiddenIncludedPockets.Add(_semiPrivatePocket);
- }
else if (IsPrivateAndSemiPrivatePocketNeeded())
{
_hiddenIncludedPockets.Add(_privatePocket);
@@ -296,13 +287,9 @@ public partial class LabelSelectionViewModel : ViewModelBase
(NonPrivatePockets.Sum(x => x.Amount) < _targetAmount && _privatePocket.Amount + _semiPrivatePocket.Amount < _targetAmount && NonPrivatePockets.Sum(x => x.Amount) + _privatePocket.Amount >= _targetAmount) ||
(LabelsWhiteList.IsEmpty() && _privatePocket.Amount >= _targetAmount);
- private bool IsSemiPrivatePocketNeeded() =>
- (NonPrivatePockets.Sum(x => x.Amount) < _targetAmount && _privatePocket.Amount + _semiPrivatePocket.Amount < _targetAmount && NonPrivatePockets.Sum(x => x.Amount) + _semiPrivatePocket.Amount >= _targetAmount) ||
- (LabelsWhiteList.IsEmpty() && _semiPrivatePocket.Amount >= _targetAmount);
-
private bool IsPrivateAndSemiPrivatePocketNeeded() =>
(NonPrivatePockets.Sum(x => x.Amount) + _privatePocket.Amount < _targetAmount && NonPrivatePockets.Sum(x => x.Amount) + _privatePocket.Amount + _semiPrivatePocket.Amount >= _targetAmount) ||
- (LabelsWhiteList.IsEmpty() && _privatePocket.Amount < _targetAmount && _semiPrivatePocket.Amount < _targetAmount && _privatePocket.Amount + _semiPrivatePocket.Amount >= _targetAmount);
+ (LabelsWhiteList.IsEmpty() && _privatePocket.Amount < _targetAmount && _privatePocket.Amount + _semiPrivatePocket.Amount >= _targetAmount);
public void SetUsedLabel(IEnumerable<SmartCoin>? usedCoins, int privateThreshold)
{

MODIFY
WalletWasabi.Tests/UnitTests/UserInterfaceTest/PocketSelectionTests.cs
WalletWasabi.Tests/UnitTests/UserInterfaceTest/PocketSelectionTests.cs
@@ -313,29 +313,6 @@ public class PocketSelectionTests
Assert.Contains(pocket1, output);
}
- [Fact]
- public void UseOnlySemiPrivateFunds()
- {
- var selection = new LabelSelectionViewModel(Money.Parse("1.0"));
-
- var pockets = new List<Pocket>();
- pockets.AddPocket(0.9M, out var pocket1, CoinPocketHelper.PrivateFundsText);
- pockets.AddPocket(2.0M, out var pocket2, "Dan");
- pockets.AddPocket(1.0M, out var pocket3, CoinPocketHelper.SemiPrivateFundsText);
-
- selection.Reset(pockets.ToArray());
-
- selection.SwapLabel(selection.GetLabel("Dan"));
-
- Assert.Contains(selection.GetLabel("Dan"), selection.LabelsBlackList);
- Assert.True(selection.EnoughSelected);
-
- var output = selection.GetUsedPockets();
- Assert.DoesNotContain(pocket1, output);
- Assert.DoesNotContain(pocket2, output);
- Assert.Contains(pocket3, output);
- }
-
[Fact]
public void UsePrivateAndSemiPrivateFunds()
{
@@ -400,26 +377,6 @@ public class PocketSelectionTests
Assert.DoesNotContain(pocket3, output);
}
- [Fact]
- public void IncludeSemiPrivateFunds()
- {
- var selection = new LabelSelectionViewModel(Money.Parse("2.5"));
-
- var pockets = new List<Pocket>();
- pockets.AddPocket(0.4M, out var pocket1, CoinPocketHelper.PrivateFundsText);
- pockets.AddPocket(2.0M, out var pocket2, "Dan");
- pockets.AddPocket(1.0M, out var pocket3, CoinPocketHelper.SemiPrivateFundsText);
-
- selection.Reset(pockets.ToArray());
-
- Assert.True(selection.EnoughSelected);
-
- var output = selection.GetUsedPockets();
- Assert.DoesNotContain(pocket1, output);
- Assert.Contains(pocket2, output);
- Assert.Contains(pocket3, output);
- }
-
[Fact]
public void IncludePrivateAndSemiPrivateFunds()
{
@@ -510,26 +467,6 @@ public class PocketSelectionTests
Assert.DoesNotContain(pocket4, output);
}
- [Fact]
- public void AutoSelectOnlySemiPrivatePocket()
- {
- var selection = new LabelSelectionViewModel(Money.Parse("0.7"));
-
- var pockets = new List<Pocket>();
- pockets.AddPocket(0.6M, out var pocket1, CoinPocketHelper.PrivateFundsText);
- pockets.AddPocket(0.6M, out var pocket2, "Dan");
- pockets.AddPocket(0.7M, out var pocket3, CoinPocketHelper.UnlabelledFundsText);
- pockets.AddPocket(0.7M, out var pocket4, CoinPocketHelper.SemiPrivateFundsText);
-
- selection.Reset(pockets.ToArray());
-
- var output = selection.AutoSelectPockets("Dan");
- Assert.DoesNotContain(pocket1, output);
- Assert.DoesNotContain(pocket2, output);
- Assert.DoesNotContain(pocket3, output);
- Assert.Contains(pocket4, output);
- }
-
[Fact]
public void AutoSelectPrivateAndSemiPrivatePockets()
{

remove the only semi private cases