cluster pluralization fix
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/CoinInfoTabView.xaml
WalletWasabi.Gui/Controls/WalletExplorer/CoinInfoTabView.xaml
</Grid>
<Grid ColumnDefinitions="150, *">
<TextBlock Classes="monospaceFont" Text="Cluster:" />
- <controls:ExtendedTextBox Grid.Column="1" Classes="selectableTextBlock monospaceFont Transparent" Text="{Binding Clusters}" />
+ <controls:ExtendedTextBox Grid.Column="1" Classes="selectableTextBlock monospaceFont Transparent" Text="{Binding Cluster}" />
</Grid>
</StackPanel>
</ScrollViewer>

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/CoinListView.xaml
WalletWasabi.Gui/Controls/WalletExplorer/CoinListView.xaml
<controls:SortingArrow Grid.Column="2" Text="Status" Command="{Binding SortCommand}" SortDirection="{Binding StatusSortDirection}" />
<controls:SortingArrow Grid.Column="3" Text="Amount (BTC)" Command="{Binding SortCommand}" SortDirection="{Binding AmountSortDirection}" />
<controls:SortingArrow Grid.Column="4" Text="Privacy" Command="{Binding SortCommand}" SortDirection="{Binding PrivacySortDirection}" />
- <controls:SortingArrow Grid.Column="5" Text="Cluster" Command="{Binding SortCommand}" SortDirection="{Binding ClustersSortDirection}" />
+ <controls:SortingArrow Grid.Column="5" Text="Cluster" Command="{Binding SortCommand}" SortDirection="{Binding ClusterSortDirection}" />
</Grid>
<StackPanel Margin="0 10 0 0" Spacing="10" DockPanel.Dock="Bottom" Orientation="Horizontal">
<CheckBox IsThreeState="True" Margin="0" IsChecked="{Binding SelectPrivateCheckBoxState}" IsVisible="{Binding SelectAllPrivateVisible}" Command="{Binding SelectPrivateCheckBoxCommand}">
<DrawingPresenter HorizontalAlignment="Left" Height="16" Width="16" Stretch="Fill" Drawing="{StaticResource Detail}" />
</MenuItem.Icon>
</MenuItem>
- <MenuItem Header="Copy Cluster" Command="{Binding CopyClusters}">
+ <MenuItem Header="Copy Cluster" Command="{Binding CopyCluster}">
<MenuItem.Icon>
<DrawingPresenter HorizontalAlignment="Left" Height="16" Width="16" Stretch="Fill" Drawing="{StaticResource Copy}" />
</MenuItem.Icon>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="3" Text="{Binding AmountBtc, ConverterParameter=8, Converter={StaticResource LurkingWifeModeStringConverter}, Mode=OneWay}" />
- <TextBlock Grid.Column="5" Text="{Binding Clusters, ConverterParameter=50, Converter={StaticResource LurkingWifeModeStringConverter}, Mode=OneWay}" />
+ <TextBlock Grid.Column="5" Text="{Binding Cluster, ConverterParameter=50, Converter={StaticResource LurkingWifeModeStringConverter}, Mode=OneWay}" />
<Panel Background="Transparent" Grid.Column="0" Grid.ColumnSpan="6" VerticalAlignment="Stretch">
<i:Interaction.Behaviors>
<behaviors:CommandOnDoubleClickBehavior Command="{Binding OpenCoinInfo}" />

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/CoinListViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/CoinListViewModel.cs
@@ -40,7 +40,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
private bool? _selectPrivateCheckBoxState;
private bool? _selectNonPrivateCheckBoxState;
private GridLength _coinJoinStatusWidth;
- private SortOrder _clustersSortDirection;
+ private SortOrder _clusterSortDirection;
private Money _selectedAmount;
private bool _isAnyCoinSelected;
private bool _labelExposeCommonOwnershipWarning;
@@ -93,10 +93,10 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
.ObserveOn(RxApp.MainThreadScheduler)
.Subscribe(x => SortColumn(x, nameof(AmountSortDirection)));
- this.WhenAnyValue(x => x.ClustersSortDirection)
+ this.WhenAnyValue(x => x.ClusterSortDirection)
.Where(x => x != SortOrder.None)
.ObserveOn(RxApp.MainThreadScheduler)
- .Subscribe(x => SortColumn(x, nameof(ClustersSortDirection)));
+ .Subscribe(x => SortColumn(x, nameof(ClusterSortDirection)));
this.WhenAnyValue(x => x.StatusSortDirection)
.Where(x => x != SortOrder.None)
@@ -243,10 +243,10 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
set => this.RaiseAndSetIfChanged(ref _privacySortDirection, value);
}
- public SortOrder ClustersSortDirection
+ public SortOrder ClusterSortDirection
{
- get => _clustersSortDirection;
- set => this.RaiseAndSetIfChanged(ref _clustersSortDirection, value);
+ get => _clusterSortDirection;
+ set => this.RaiseAndSetIfChanged(ref _clusterSortDirection, value);
}
public Money SelectedAmount
@@ -336,7 +336,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
if (savedCol != nameof(AmountSortDirection)
& savedCol != nameof(PrivacySortDirection)
- & savedCol != nameof(ClustersSortDirection)
+ & savedCol != nameof(ClusterSortDirection)
& savedCol != nameof(StatusSortDirection))
{
SelectedColumnPreference = new SortingPreference(SortOrder.Increasing, nameof(AmountSortDirection));
@@ -354,7 +354,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
AmountSortDirection = sortPref.Match(sortOrder, nameof(AmountSortDirection));
PrivacySortDirection = sortPref.Match(sortOrder, nameof(PrivacySortDirection));
- ClustersSortDirection = sortPref.Match(sortOrder, nameof(ClustersSortDirection));
+ ClusterSortDirection = sortPref.Match(sortOrder, nameof(ClusterSortDirection));
StatusSortDirection = sortPref.Match(sortOrder, nameof(StatusSortDirection));
}
@@ -373,11 +373,11 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
? sortExpression.ThenByAscending(cvm => cvm.AnonymitySet)
: sortExpression.ThenByDescending(cvm => cvm.AnonymitySet);
}
- else if (ClustersSortDirection != SortOrder.None)
+ else if (ClusterSortDirection != SortOrder.None)
{
- MyComparer = ClustersSortDirection == SortOrder.Increasing
- ? sortExpression.ThenByAscending(cvm => cvm.Clusters)
- : sortExpression.ThenByDescending(cvm => cvm.Clusters);
+ MyComparer = ClusterSortDirection == SortOrder.Increasing
+ ? sortExpression.ThenByAscending(cvm => cvm.Cluster)
+ : sortExpression.ThenByDescending(cvm => cvm.Cluster);
}
else if (StatusSortDirection != SortOrder.None)
{

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/CoinViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/CoinViewModel.cs
@@ -61,9 +61,9 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
.DisposeWith(Disposables);
_cluster = Model
- .WhenAnyValue(x => x.Clusters, x => x.Clusters.Labels)
+ .WhenAnyValue(x => x.Cluster, x => x.Cluster.Labels)
.Select(x => x.Item2.ToString())
- .ToProperty(this, x => x.Clusters, scheduler: RxApp.MainThreadScheduler)
+ .ToProperty(this, x => x.Cluster, scheduler: RxApp.MainThreadScheduler)
.DisposeWith(Disposables);
_unavailable = Model
@@ -96,7 +96,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
.Subscribe(_ =>
{
this.RaisePropertyChanged(nameof(AmountBtc));
- this.RaisePropertyChanged(nameof(Clusters));
+ this.RaisePropertyChanged(nameof(Cluster));
}).DisposeWith(Disposables);
DequeueCoin = ReactiveCommand.Create(() => Owner.PressDequeue(Model), this.WhenAnyValue(x => x.CoinJoinInProgress));
@@ -116,12 +116,12 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
shell.Select(coinInfo);
});
- CopyClusters = ReactiveCommand.CreateFromTask(async () => await Application.Current.Clipboard.SetTextAsync(Clusters));
+ CopyCluster = ReactiveCommand.CreateFromTask(async () => await Application.Current.Clipboard.SetTextAsync(Cluster));
Observable
.Merge(DequeueCoin.ThrownExceptions) // Don't notify about it. Dequeue failure (and success) is notified by other mechanism.
.Merge(OpenCoinInfo.ThrownExceptions)
- .Merge(CopyClusters.ThrownExceptions)
+ .Merge(CopyCluster.ThrownExceptions)
.ObserveOn(RxApp.TaskpoolScheduler)
.Subscribe(ex => Logger.LogError(ex));
}
@@ -134,7 +134,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
public bool CanBeDequeued => Owner.CanDequeueCoins;
public ReactiveCommand<Unit, Unit> DequeueCoin { get; }
public ReactiveCommand<Unit, Unit> OpenCoinInfo { get; }
- public ReactiveCommand<Unit, Unit> CopyClusters { get; }
+ public ReactiveCommand<Unit, Unit> CopyCluster { get; }
public SmartCoin Model { get; }
@@ -187,7 +187,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
public string InCoinJoin => Model.CoinJoinInProgress ? "Yes" : "No";
- public string Clusters => _cluster?.Value ?? "";
+ public string Cluster => _cluster?.Value ?? "";
public string PubKey => Model.HdPubKey?.PubKey?.ToString() ?? "";

MODIFY
WalletWasabi.Tests/UnitTests/Transactions/PayjoinTests.cs
WalletWasabi.Tests/UnitTests/Transactions/PayjoinTests.cs
@@ -454,7 +454,7 @@ namespace WalletWasabi.Tests.UnitTests.Transactions
{
foreach (var sameLabelCoin in scoins.Where(c => !c.Label.IsEmpty && c.Label == coin.Label))
{
- sameLabelCoin.Clusters = coin.Clusters;
+ sameLabelCoin.Cluster = coin.Cluster;
}
}
var coinsView = new CoinsView(scoins);

MODIFY
WalletWasabi.Tests/UnitTests/Transactions/TransactionFactoryTests.cs
WalletWasabi.Tests/UnitTests/Transactions/TransactionFactoryTests.cs
@@ -200,7 +200,7 @@ namespace WalletWasabi.Tests.UnitTests.Transactions
var cluster1 = new Cluster(coinsCluster1);
foreach (var coin in coinsCluster1)
{
- coin.Clusters = cluster1;
+ coin.Cluster = cluster1;
}
// cluster 2 is known by 6 people: Julio, Lee, Jean, Donald, Onur and Satoshi
@@ -208,7 +208,7 @@ namespace WalletWasabi.Tests.UnitTests.Transactions
var cluster2 = new Cluster(coinsCluster2);
foreach (var coin in coinsCluster2)
{
- coin.Clusters = cluster2;
+ coin.Cluster = cluster2;
}
var coinsView = new CoinsView(scoins.ToArray());
@@ -221,7 +221,7 @@ namespace WalletWasabi.Tests.UnitTests.Transactions
var result = transactionFactory.BuildTransaction(payment, feeRate);
Assert.Equal(2, result.SpentCoins.Count());
- Assert.All(result.SpentCoins, c => Assert.Equal(c.Clusters, cluster2));
+ Assert.All(result.SpentCoins, c => Assert.Equal(c.Cluster, cluster2));
Assert.Contains(coinsByLabel["Julio"], result.SpentCoins);
Assert.Contains(coinsByLabel["Donald, Jean, Lee, Onur"], result.SpentCoins);
@@ -231,7 +231,7 @@ namespace WalletWasabi.Tests.UnitTests.Transactions
result = transactionFactory.BuildTransaction(payment, feeRate);
Assert.Equal(3, result.SpentCoins.Count());
- Assert.All(result.SpentCoins, c => Assert.Equal(c.Clusters, cluster2));
+ Assert.All(result.SpentCoins, c => Assert.Equal(c.Cluster, cluster2));
Assert.Contains(coinsByLabel["Julio"], result.SpentCoins);
Assert.Contains(coinsByLabel["Donald, Jean, Lee, Onur"], result.SpentCoins);
Assert.Contains(coinsByLabel["Satoshi"], result.SpentCoins);
@@ -243,7 +243,7 @@ namespace WalletWasabi.Tests.UnitTests.Transactions
result = transactionFactory.BuildTransaction(payment, feeRate);
Assert.Equal(4, result.SpentCoins.Count());
- Assert.All(result.SpentCoins, c => Assert.Equal(c.Clusters, cluster1));
+ Assert.All(result.SpentCoins, c => Assert.Equal(c.Cluster, cluster1));
Assert.Contains(coinsByLabel["Pablo"], result.SpentCoins);
Assert.Contains(coinsByLabel["Daniel"], result.SpentCoins);
Assert.Contains(coinsByLabel["Adolf"], result.SpentCoins);
@@ -612,7 +612,7 @@ namespace WalletWasabi.Tests.UnitTests.Transactions
{
foreach (var sameLabelCoin in scoins.Where(c => !c.Label.IsEmpty && c.Label == coin.Label))
{
- sameLabelCoin.Clusters = coin.Clusters;
+ sameLabelCoin.Cluster = coin.Cluster;
}
}
var coinsView = new CoinsView(scoins);

MODIFY
WalletWasabi.Tests/UnitTests/Transactions/TransactionProcessorTests.cs
WalletWasabi.Tests/UnitTests/Transactions/TransactionProcessorTests.cs
@@ -743,14 +743,14 @@ namespace WalletWasabi.Tests.UnitTests.Transactions
transactionProcessor.Process(tx0);
var createdCoin = transactionProcessor.Coins.First();
- Assert.Equal("A", createdCoin.Clusters.Labels);
+ Assert.Equal("A", createdCoin.Cluster.Labels);
// Spend the received coin to someone else B
var changeScript1 = transactionProcessor.NewKey("B").P2wpkhScript;
var tx1 = CreateSpendingTransaction(new[] { createdCoin.GetCoin() }, new Key().ScriptPubKey, changeScript1);
transactionProcessor.Process(tx1);
createdCoin = transactionProcessor.Coins.First();
- Assert.Equal("A, B", createdCoin.Clusters.Labels);
+ Assert.Equal("A, B", createdCoin.Cluster.Labels);
// Spend the received coin to myself else C
var myselfScript = transactionProcessor.NewKey("C").P2wpkhScript;
@@ -760,10 +760,10 @@ namespace WalletWasabi.Tests.UnitTests.Transactions
Assert.Equal(2, transactionProcessor.Coins.Count());
createdCoin = transactionProcessor.Coins.First();
- Assert.Equal("A, B, C", createdCoin.Clusters.Labels);
+ Assert.Equal("A, B, C", createdCoin.Cluster.Labels);
var createdchangeCoin = transactionProcessor.Coins.Last();
- Assert.Equal("A, B, C", createdchangeCoin.Clusters.Labels);
+ Assert.Equal("A, B, C", createdchangeCoin.Cluster.Labels);
}
[Fact]
@@ -791,9 +791,9 @@ namespace WalletWasabi.Tests.UnitTests.Transactions
var tx2 = CreateCreditingTransaction(key.P2wpkhScript, Money.Coins(1.0m));
transactionProcessor.Process(tx2);
- var scoinA = Assert.Single(transactionProcessor.Coins, c => c.Clusters.Labels == "A");
- var scoinB = Assert.Single(transactionProcessor.Coins, c => c.Clusters.Labels == "B");
- var scoinC = Assert.Single(transactionProcessor.Coins, c => c.Clusters.Labels == "C");
+ var scoinA = Assert.Single(transactionProcessor.Coins, c => c.Cluster.Labels == "A");
+ var scoinB = Assert.Single(transactionProcessor.Coins, c => c.Cluster.Labels == "B");
+ var scoinC = Assert.Single(transactionProcessor.Coins, c => c.Cluster.Labels == "C");
var changeScript = transactionProcessor.NewKey("D").P2wpkhScript;
var coins = new[] { scoinA.GetCoin(), scoinB.GetCoin(), scoinC.GetCoin() };
@@ -801,12 +801,12 @@ namespace WalletWasabi.Tests.UnitTests.Transactions
transactionProcessor.Process(tx3);
var changeCoinD = Assert.Single(transactionProcessor.Coins);
- Assert.Equal("A, B, C, D", changeCoinD.Clusters.Labels);
+ Assert.Equal("A, B, C, D", changeCoinD.Cluster.Labels);
key = transactionProcessor.NewKey("E");
var tx4 = CreateCreditingTransaction(key.P2wpkhScript, Money.Coins(1.0m));
transactionProcessor.Process(tx4);
- var scoinE = Assert.Single(transactionProcessor.Coins, c => c.Clusters.Labels == "E");
+ var scoinE = Assert.Single(transactionProcessor.Coins, c => c.Cluster.Labels == "E");
changeScript = transactionProcessor.NewKey("F").P2wpkhScript;
coins = new[] { changeCoinD.GetCoin(), scoinE.GetCoin() };
@@ -814,7 +814,7 @@ namespace WalletWasabi.Tests.UnitTests.Transactions
transactionProcessor.Process(tx5);
var changeCoin = Assert.Single(transactionProcessor.Coins);
- Assert.Equal("A, B, C, D, E, F", changeCoin.Clusters.Labels);
+ Assert.Equal("A, B, C, D, E, F", changeCoin.Cluster.Labels);
}
[Fact]
@@ -840,9 +840,9 @@ namespace WalletWasabi.Tests.UnitTests.Transactions
var tx2 = CreateCreditingTransaction(key.P2wpkhScript, Money.Coins(1.0m));
transactionProcessor.Process(tx2);
- var scoinA = Assert.Single(transactionProcessor.Coins, c => c.Clusters.Labels == "A");
- var scoinB = Assert.Single(transactionProcessor.Coins, c => c.Clusters.Labels == "B");
- var scoinC = Assert.Single(transactionProcessor.Coins, c => c.Clusters.Labels == "C");
+ var scoinA = Assert.Single(transactionProcessor.Coins, c => c.Cluster.Labels == "A");
+ var scoinB = Assert.Single(transactionProcessor.Coins, c => c.Cluster.Labels == "B");
+ var scoinC = Assert.Single(transactionProcessor.Coins, c => c.Cluster.Labels == "C");
var myself = transactionProcessor.NewKey("D").P2wpkhScript;
var changeScript = transactionProcessor.NewKey("").P2wpkhScript;
@@ -851,13 +851,13 @@ namespace WalletWasabi.Tests.UnitTests.Transactions
transactionProcessor.Process(tx3);
var paymentCoin = Assert.Single(transactionProcessor.Coins, c => c.ScriptPubKey == myself);
- Assert.Equal("A, B, C, D", paymentCoin.Clusters.Labels);
+ Assert.Equal("A, B, C, D", paymentCoin.Cluster.Labels);
var tx4 = CreateCreditingTransaction(myself, Money.Coins(7.0m));
transactionProcessor.Process(tx4);
Assert.Equal(2, transactionProcessor.Coins.Count(c => c.ScriptPubKey == myself));
var newPaymentCoin = Assert.Single(transactionProcessor.Coins, c => c.Amount == Money.Coins(7.0m));
- Assert.Equal("A, B, C, D", newPaymentCoin.Clusters.Labels);
+ Assert.Equal("A, B, C, D", newPaymentCoin.Cluster.Labels);
}
[Fact]
@@ -882,8 +882,8 @@ namespace WalletWasabi.Tests.UnitTests.Transactions
transactionProcessor.Process(tx2);
var coins = transactionProcessor.Coins;
- Assert.Equal(coins.First().Clusters, coins.Last().Clusters);
- Assert.Equal("A, B", coins.First().Clusters.Labels.ToString());
+ Assert.Equal(coins.First().Cluster, coins.Last().Cluster);
+ Assert.Equal("A, B", coins.First().Cluster.Labels.ToString());
}
[Fact]
@@ -908,9 +908,9 @@ namespace WalletWasabi.Tests.UnitTests.Transactions
var tx2 = CreateCreditingTransaction(key.P2wpkhScript, Money.Coins(1.0m));
transactionProcessor.Process(tx2);
- var scoinA = Assert.Single(transactionProcessor.Coins, c => c.Clusters.Labels == "A");
- var scoinB = Assert.Single(transactionProcessor.Coins, c => c.Clusters.Labels == "B");
- var scoinC = Assert.Single(transactionProcessor.Coins, c => c.Clusters.Labels == "C");
+ var scoinA = Assert.Single(transactionProcessor.Coins, c => c.Cluster.Labels == "A");
+ var scoinB = Assert.Single(transactionProcessor.Coins, c => c.Cluster.Labels == "B");
+ var scoinC = Assert.Single(transactionProcessor.Coins, c => c.Cluster.Labels == "C");
var myself = transactionProcessor.NewKey("D").P2wpkhScript;
var changeScript = transactionProcessor.NewKey("").P2wpkhScript;
@@ -919,18 +919,18 @@ namespace WalletWasabi.Tests.UnitTests.Transactions
transactionProcessor.Process(tx3);
var paymentCoin = Assert.Single(transactionProcessor.Coins, c => c.ScriptPubKey == myself);
- Assert.Equal("A, B, C, D", paymentCoin.Clusters.Labels);
+ Assert.Equal("A, B, C, D", paymentCoin.Cluster.Labels);
coins = new[] { scoinB.GetCoin(), scoinC.GetCoin(), scoinA.GetCoin() };
var tx4 = CreateSpendingTransaction(coins, myself, changeScript);
transactionProcessor.Process(tx4);
paymentCoin = Assert.Single(transactionProcessor.Coins, c => c.ScriptPubKey == myself);
- Assert.Equal("A, B, C, D", paymentCoin.Clusters.Labels);
+ Assert.Equal("A, B, C, D", paymentCoin.Cluster.Labels);
}
[Fact]
- public async Task UpdateClustersAfterReplacedByFeeWithNewCoinsAsync()
+ public async Task UpdateClusterAfterReplacedByFeeWithNewCoinsAsync()
{
// --tx0---> (A) --+
// |
@@ -952,9 +952,9 @@ namespace WalletWasabi.Tests.UnitTests.Transactions
var tx2 = CreateCreditingTransaction(key.P2wpkhScript, Money.Coins(1.0m));
transactionProcessor.Process(tx2);
- var scoinA = Assert.Single(transactionProcessor.Coins, c => c.Clusters.Labels == "A");
- var scoinB = Assert.Single(transactionProcessor.Coins, c => c.Clusters.Labels == "B");
- var scoinC = Assert.Single(transactionProcessor.Coins, c => c.Clusters.Labels == "C");
+ var scoinA = Assert.Single(transactionProcessor.Coins, c => c.Cluster.Labels == "A");
+ var scoinB = Assert.Single(transactionProcessor.Coins, c => c.Cluster.Labels == "B");
+ var scoinC = Assert.Single(transactionProcessor.Coins, c => c.Cluster.Labels == "C");
var myself = transactionProcessor.NewKey("D").P2wpkhScript;
var changeScript = transactionProcessor.NewKey("").P2wpkhScript;
@@ -963,19 +963,19 @@ namespace WalletWasabi.Tests.UnitTests.Transactions
transactionProcessor.Process(tx3);
var paymentCoin = Assert.Single(transactionProcessor.Coins, c => c.ScriptPubKey == myself);
- Assert.Equal("A, B, C, D", paymentCoin.Clusters.Labels);
+ Assert.Equal("A, B, C, D", paymentCoin.Cluster.Labels);
key = transactionProcessor.NewKey("X");
var tx4 = CreateCreditingTransaction(key.P2wpkhScript, Money.Coins(1.0m));
transactionProcessor.Process(tx4);
- var scoinX = Assert.Single(transactionProcessor.Coins, c => c.Clusters.Labels == "X");
+ var scoinX = Assert.Single(transactionProcessor.Coins, c => c.Cluster.Labels == "X");
coins = new[] { scoinB.GetCoin(), scoinX.GetCoin(), scoinC.GetCoin(), scoinA.GetCoin() };
var tx5 = CreateSpendingTransaction(coins, myself, changeScript);
transactionProcessor.Process(tx5);
paymentCoin = Assert.Single(transactionProcessor.Coins, c => c.ScriptPubKey == myself);
- Assert.Equal("A, B, C, D, X", paymentCoin.Clusters.Labels);
+ Assert.Equal("A, B, C, D, X", paymentCoin.Cluster.Labels);
}
[Fact]
@@ -1001,9 +1001,9 @@ namespace WalletWasabi.Tests.UnitTests.Transactions
var tx2 = CreateCreditingTransaction(key.P2wpkhScript, Money.Coins(1.0m), height: 54323);
transactionProcessor.Process(tx2);
- var scoinA = Assert.Single(transactionProcessor.Coins, c => c.Clusters.Labels == "A");
- var scoinB = Assert.Single(transactionProcessor.Coins, c => c.Clusters.Labels == "B");
- var scoinC = Assert.Single(transactionProcessor.Coins, c => c.Clusters.Labels == "C");
+ var scoinA = Assert.Single(transactionProcessor.Coins, c => c.Cluster.Labels == "A");
+ var scoinB = Assert.Single(transactionProcessor.Coins, c => c.Cluster.Labels == "B");
+ var scoinC = Assert.Single(transactionProcessor.Coins, c => c.Cluster.Labels == "C");
var changeScript = transactionProcessor.NewKey("D").P2wpkhScript;
var coins = new[] { scoinA.GetCoin(), scoinB.GetCoin(), scoinC.GetCoin() };
@@ -1011,20 +1011,20 @@ namespace WalletWasabi.Tests.UnitTests.Transactions
transactionProcessor.Process(tx3);
var changeCoinD = Assert.Single(transactionProcessor.Coins);
- Assert.Equal("A, B, C, D", changeCoinD.Clusters.Labels);
- Assert.Equal(scoinA.Clusters, changeCoinD.Clusters);
- Assert.Equal(scoinB.Clusters, changeCoinD.Clusters);
- Assert.Equal(scoinC.Clusters, changeCoinD.Clusters);
+ Assert.Equal("A, B, C, D", changeCoinD.Cluster.Labels);
+ Assert.Equal(scoinA.Cluster, changeCoinD.Cluster);
+ Assert.Equal(scoinB.Cluster, changeCoinD.Cluster);
+ Assert.Equal(scoinC.Cluster, changeCoinD.Cluster);
// reorg
Assert.True(changeCoinD.Confirmed);
transactionProcessor.UndoBlock(tx3.Height);
Assert.False(changeCoinD.Confirmed);
- Assert.Equal("A, B, C, D", changeCoinD.Clusters.Labels);
- Assert.Equal(scoinA.Clusters, changeCoinD.Clusters);
- Assert.Equal(scoinB.Clusters, changeCoinD.Clusters);
- Assert.Equal(scoinC.Clusters, changeCoinD.Clusters);
+ Assert.Equal("A, B, C, D", changeCoinD.Cluster.Labels);
+ Assert.Equal(scoinA.Cluster, changeCoinD.Cluster);
+ Assert.Equal(scoinB.Cluster, changeCoinD.Cluster);
+ Assert.Equal(scoinC.Cluster, changeCoinD.Cluster);
}
[Fact]
@@ -1061,8 +1061,8 @@ namespace WalletWasabi.Tests.UnitTests.Transactions
var anonymousCoin = Assert.Single(transactionProcessor.Coins, c => c.Amount == Money.Coins(0.1m));
var changeCoin = Assert.Single(transactionProcessor.Coins, c => c.Amount == Money.Coins(0.9m));
- Assert.Empty(anonymousCoin.Clusters.Labels);
- Assert.NotEmpty(changeCoin.Clusters.Labels);
+ Assert.Empty(anonymousCoin.Cluster.Labels);
+ Assert.NotEmpty(changeCoin.Cluster.Labels);
}
private static SmartTransaction CreateSpendingTransaction(Coin coin, Script scriptPubKey = null, int height = 0)

MODIFY
WalletWasabi/Blockchain/Analysis/Clustering/Cluster.cs
WalletWasabi/Blockchain/Analysis/Clustering/Cluster.cs
@@ -35,7 +35,7 @@ namespace WalletWasabi.Blockchain.Analysis.Clustering
private List<SmartCoin> Coins { get; set; }
private HashSet<SmartCoin> CoinsSet { get; set; }
- public void Merge(Cluster clusters) => Merge(clusters.Coins);
+ public void Merge(Cluster cluster) => Merge(cluster.Coins);
public void Merge(IEnumerable<SmartCoin> coins)
{
@@ -48,7 +48,7 @@ namespace WalletWasabi.Blockchain.Analysis.Clustering
{
Coins.Insert(insertPosition++, coin);
}
- coin.Clusters = this;
+ coin.Cluster = this;
}
if (insertPosition > 0) // at least one element was inserted
{

MODIFY
WalletWasabi/Blockchain/TransactionBuilding/SmartCoinSelector.cs
WalletWasabi/Blockchain/TransactionBuilding/SmartCoinSelector.cs
@@ -30,14 +30,14 @@ namespace WalletWasabi.Blockchain.TransactionBuilding
// Get unique clusters.
IEnumerable<Cluster> uniqueClusters = UnspentCoins
- .Select(coin => coin.Clusters)
+ .Select(coin => coin.Cluster)
.Distinct();
// Build all the possible coin clusters, except when it's computationally too expensive.
List<IEnumerable<SmartCoin>> coinClusters = uniqueClusters.Count() < 10
? uniqueClusters
.CombinationsWithoutRepetition(ofLength: 1, upToLength: 6)
- .Select(clusterCombination => UnspentCoins.Where(coin => clusterCombination.Contains(coin.Clusters)))
+ .Select(clusterCombination => UnspentCoins.Where(coin => clusterCombination.Contains(coin.Cluster)))
.ToList()
: new List<IEnumerable<SmartCoin>>();
@@ -45,7 +45,7 @@ namespace WalletWasabi.Blockchain.TransactionBuilding
// This operation is doing super advanced grouping on the coin clusters and adding properties to each of them.
var sayajinCoinClusters = coinClusters
- .Select(coins => (Coins: coins, Privacy: 1.0m / (1 + coins.Sum(x => x.Clusters.Labels.Count()))))
+ .Select(coins => (Coins: coins, Privacy: 1.0m / (1 + coins.Sum(x => x.Cluster.Labels.Count()))))
.Select(group => new
{
group.Coins,

MODIFY
WalletWasabi/Blockchain/TransactionOutputs/CoinsRegistry.cs
WalletWasabi/Blockchain/TransactionOutputs/CoinsRegistry.cs
@@ -87,11 +87,11 @@ namespace WalletWasabi.Blockchain.TransactionOutputs
{
if (ClustersByScriptPubKey.TryGetValue(coin.ScriptPubKey, out var cluster))
{
- coin.Clusters = cluster;
+ coin.Cluster = cluster;
}
else
{
- ClustersByScriptPubKey.Add(coin.ScriptPubKey, coin.Clusters);
+ ClustersByScriptPubKey.Add(coin.ScriptPubKey, coin.Cluster);
}
foreach (var spentOutPoint in coin.SpentOutputs)
@@ -175,9 +175,9 @@ namespace WalletWasabi.Blockchain.TransactionOutputs
{
if (newCoin.AnonymitySet < PrivacyLevelThreshold)
{
- spentCoin.Clusters.Merge(newCoin.Clusters);
- newCoin.Clusters = spentCoin.Clusters;
- ClustersByScriptPubKey.AddOrReplace(newCoin.ScriptPubKey, newCoin.Clusters);
+ spentCoin.Cluster.Merge(newCoin.Cluster);
+ newCoin.Cluster = spentCoin.Cluster;
+ ClustersByScriptPubKey.AddOrReplace(newCoin.ScriptPubKey, newCoin.Cluster);
}
}
}

MODIFY
WalletWasabi/Blockchain/TransactionOutputs/SmartCoin.cs
WalletWasabi/Blockchain/TransactionOutputs/SmartCoin.cs
@@ -30,7 +30,7 @@ namespace WalletWasabi.Blockchain.TransactionOutputs
private ISecret _secret;
- private Cluster _clusters;
+ private Cluster _cluster;
private bool _confirmed;
private bool _unavailable;
@@ -189,10 +189,10 @@ namespace WalletWasabi.Blockchain.TransactionOutputs
set => RaiseAndSetIfChanged(ref _secret, value);
}
- public Cluster Clusters
+ public Cluster Cluster
{
- get => _clusters;
- set => RaiseAndSetIfChanged(ref _clusters, value);
+ get => _cluster;
+ set => RaiseAndSetIfChanged(ref _cluster, value);
}
#region DependentProperties
@@ -284,7 +284,7 @@ namespace WalletWasabi.Blockchain.TransactionOutputs
Label = SmartLabel.Merge(HdPubKey?.Label, label);
- Clusters = new Cluster(this);
+ Cluster = new Cluster(this);
SetConfirmed();
SetUnspent();

cluster pluralization fix