polish selection logic
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/LabelSelectionViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/LabelSelectionViewModel.cs
@@ -38,8 +38,8 @@ public partial class LabelSelectionViewModel : ViewModelBase
var unknownPockets = NonPrivatePockets.Except(knownPockets).ToArray();
var privateAndUnknownPockets = _allPockets.Except(knownPockets).ToArray();
var privateAndKnownPockets = _allPockets.Except(unknownPockets).ToArray();
- var knownByRecipientPockets = knownPockets.Where(x => x.Labels.Any(label => recipient.Labels.Contains(label))).ToArray();
- var onlyKnownByRecipientPockets = knownByRecipientPockets.Where(x => x.Labels.All(label => recipient.Labels.Contains(label))).ToArray();
+ var knownByRecipientPockets = knownPockets.Where(pocket => pocket.Labels.Any(recipient.Contains)).ToArray();
+ var onlyKnownByRecipientPockets = knownByRecipientPockets.Where(pocket => pocket.Labels == recipient).ToArray();
if (_privatePocket.Amount >= _targetAmount)
{

MODIFY
WalletWasabi.Tests/UnitTests/UserInterfaceTest/PocketSelectionTests.cs
WalletWasabi.Tests/UnitTests/UserInterfaceTest/PocketSelectionTests.cs
@@ -618,6 +618,8 @@ public class PocketSelectionTests
pockets.AddPocket(1.1M, out var pocket2, "Dan");
pockets.AddPocket(0.5M, out var pocket3, CoinPocketHelper.UnlabelledFundsText);
pockets.AddPocket(1.1M, out var pocket4, "David", "Lucas");
+ pockets.AddPocket(1.1M, out var pocket5, "David");
+ pockets.AddPocket(1.1M, out var pocket6, "Lucas");
selection.Reset(pockets.ToArray());
@@ -626,6 +628,8 @@ public class PocketSelectionTests
Assert.DoesNotContain(pocket2, output);
Assert.DoesNotContain(pocket3, output);
Assert.Contains(pocket4, output);
+ Assert.DoesNotContain(pocket5, output);
+ Assert.DoesNotContain(pocket6, output);
}
[Fact]

polish selection logic