Rename min anon to anon
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionInfo.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionInfo.cs
@@ -15,9 +15,9 @@ public partial class TransactionInfo
[AutoNotify] private FeeRate _feeRate = FeeRate.Zero;
[AutoNotify] private IEnumerable<SmartCoin> _coins = Enumerable.Empty<SmartCoin>();
- public TransactionInfo(int minAnonScoreTarget)
+ public TransactionInfo(int anonScoreTarget)
{
- _privateCoinThreshold = minAnonScoreTarget;
+ _privateCoinThreshold = anonScoreTarget;
this.WhenAnyValue(x => x.FeeRate)
.Subscribe(_ => OnFeeChanged());

MODIFY
WalletWasabi.Tests/UnitTests/WabiSabi/Client/CoinJoinCoinSelectionTests.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Client/CoinJoinCoinSelectionTests.cs
@@ -21,7 +21,7 @@ public class CoinJoinCoinSelectionTests
coins: Enumerable.Empty<SmartCoin>(),
CreateMultipartyTransactionParameters(),
consolidationMode: false,
- minAnonScoreTarget: 10,
+ anonScoreTarget: 10,
ConfigureRng(5));
Assert.Empty(coins);
@@ -31,18 +31,18 @@ public class CoinJoinCoinSelectionTests
public void SelectNothingFromFullyPrivateSetOfCoins()
{
// This test is to make sure no coins are selected when all coins are private.
- const int MinAnonimitySet = 10;
+ const int AnonimitySet = 10;
var km = KeyManager.CreateNew(out _, "", Network.Main);
var coinsToSelectFrom = Enumerable
.Range(0, 10)
- .Select(i => BitcoinFactory.CreateSmartCoin(BitcoinFactory.CreateHdPubKey(km), Money.Coins(1m), 0, anonymitySet: MinAnonimitySet + 1))
+ .Select(i => BitcoinFactory.CreateSmartCoin(BitcoinFactory.CreateHdPubKey(km), Money.Coins(1m), 0, anonymitySet: AnonimitySet + 1))
.ToList();
var coins = CoinJoinClient.SelectCoinsForRound(
coins: coinsToSelectFrom,
CreateMultipartyTransactionParameters(),
consolidationMode: false,
- minAnonScoreTarget: MinAnonimitySet,
+ anonScoreTarget: AnonimitySet,
ConfigureRng(5));
Assert.Empty(coins);
@@ -52,12 +52,12 @@ public class CoinJoinCoinSelectionTests
public void SelectNonPrivateCoinFromOneNonPrivateCoinInBigSetOfCoinsConsolidationMode()
{
// This test is to make sure that we select the non-private coin in the set.
- const int MinAnonimitySet = 10;
+ const int AnonimitySet = 10;
var km = KeyManager.CreateNew(out _, "", Network.Main);
- SmartCoin smallerAnonCoin = BitcoinFactory.CreateSmartCoin(BitcoinFactory.CreateHdPubKey(km), Money.Coins(1m), 0, anonymitySet: MinAnonimitySet - 1);
+ SmartCoin smallerAnonCoin = BitcoinFactory.CreateSmartCoin(BitcoinFactory.CreateHdPubKey(km), Money.Coins(1m), 0, anonymitySet: AnonimitySet - 1);
var coinsToSelectFrom = Enumerable
.Range(0, 10)
- .Select(i => BitcoinFactory.CreateSmartCoin(BitcoinFactory.CreateHdPubKey(km), Money.Coins(1m), 0, anonymitySet: MinAnonimitySet + 1))
+ .Select(i => BitcoinFactory.CreateSmartCoin(BitcoinFactory.CreateHdPubKey(km), Money.Coins(1m), 0, anonymitySet: AnonimitySet + 1))
.Prepend(smallerAnonCoin)
.ToList();
@@ -65,7 +65,7 @@ public class CoinJoinCoinSelectionTests
coins: coinsToSelectFrom,
CreateMultipartyTransactionParameters(),
consolidationMode: true,
- minAnonScoreTarget: MinAnonimitySet,
+ anonScoreTarget: AnonimitySet,
ConfigureRng(5));
Assert.Contains(smallerAnonCoin, coins);
@@ -76,18 +76,18 @@ public class CoinJoinCoinSelectionTests
public void SelectNonPrivateCoinFromOneCoinSetOfCoins()
{
// This test is to make sure that we select the only non-private coin when it is the only coin in the wallet.
- const int MinAnonimitySet = 10;
+ const int AnonimitySet = 10;
var km = KeyManager.CreateNew(out _, "", Network.Main);
var coinsToSelectFrom = Enumerable
.Empty<SmartCoin>()
- .Prepend(BitcoinFactory.CreateSmartCoin(BitcoinFactory.CreateHdPubKey(km), Money.Coins(1m), 0, anonymitySet: MinAnonimitySet - 1))
+ .Prepend(BitcoinFactory.CreateSmartCoin(BitcoinFactory.CreateHdPubKey(km), Money.Coins(1m), 0, anonymitySet: AnonimitySet - 1))
.ToList();
var coins = CoinJoinClient.SelectCoinsForRound(
coins: coinsToSelectFrom,
CreateMultipartyTransactionParameters(),
consolidationMode: false,
- minAnonScoreTarget: MinAnonimitySet,
+ anonScoreTarget: AnonimitySet,
ConfigureRng(1));
Assert.Single(coins);
@@ -97,19 +97,19 @@ public class CoinJoinCoinSelectionTests
public void SelectOneNonPrivateCoinFromTwoCoinsSetOfCoins()
{
// This test is to make sure that we select only one non-private coin.
- const int MinAnonimitySet = 10;
+ const int AnonimitySet = 10;
var km = KeyManager.CreateNew(out _, "", Network.Main);
var coinsToSelectFrom = Enumerable
.Empty<SmartCoin>()
- .Prepend(BitcoinFactory.CreateSmartCoin(BitcoinFactory.CreateHdPubKey(km), Money.Coins(1m), 0, anonymitySet: MinAnonimitySet - 1))
- .Prepend(BitcoinFactory.CreateSmartCoin(BitcoinFactory.CreateHdPubKey(km), Money.Coins(1m), 0, anonymitySet: MinAnonimitySet - 1))
+ .Prepend(BitcoinFactory.CreateSmartCoin(BitcoinFactory.CreateHdPubKey(km), Money.Coins(1m), 0, anonymitySet: AnonimitySet - 1))
+ .Prepend(BitcoinFactory.CreateSmartCoin(BitcoinFactory.CreateHdPubKey(km), Money.Coins(1m), 0, anonymitySet: AnonimitySet - 1))
.ToList();
var coins = CoinJoinClient.SelectCoinsForRound(
coins: coinsToSelectFrom,
CreateMultipartyTransactionParameters(),
consolidationMode: false,
- minAnonScoreTarget: MinAnonimitySet,
+ anonScoreTarget: AnonimitySet,
ConfigureRng(1));
Assert.Single(coins);
@@ -119,19 +119,19 @@ public class CoinJoinCoinSelectionTests
public void SelectTwoNonPrivateCoinsFromTwoCoinsSetOfCoinsConsolidationMode()
{
// This test is to make sure that we select more than one non-private coin.
- const int MinAnonimitySet = 10;
+ const int AnonimitySet = 10;
var km = KeyManager.CreateNew(out _, "", Network.Main);
var coinsToSelectFrom = Enumerable
.Empty<SmartCoin>()
- .Prepend(BitcoinFactory.CreateSmartCoin(BitcoinFactory.CreateHdPubKey(km), Money.Coins(1m), 0, anonymitySet: MinAnonimitySet - 1))
- .Prepend(BitcoinFactory.CreateSmartCoin(BitcoinFactory.CreateHdPubKey(km), Money.Coins(1m), 0, anonymitySet: MinAnonimitySet - 1))
+ .Prepend(BitcoinFactory.CreateSmartCoin(BitcoinFactory.CreateHdPubKey(km), Money.Coins(1m), 0, anonymitySet: AnonimitySet - 1))
+ .Prepend(BitcoinFactory.CreateSmartCoin(BitcoinFactory.CreateHdPubKey(km), Money.Coins(1m), 0, anonymitySet: AnonimitySet - 1))
.ToList();
var coins = CoinJoinClient.SelectCoinsForRound(
coins: coinsToSelectFrom,
CreateMultipartyTransactionParameters(),
consolidationMode: true,
- minAnonScoreTarget: MinAnonimitySet,
+ anonScoreTarget: AnonimitySet,
ConfigureRng(1));
Assert.Equal(2, coins.Count);

MODIFY
WalletWasabi/CoinJoin/Client/Rounds/ClientState.cs
WalletWasabi/CoinJoin/Client/Rounds/ClientState.cs
@@ -241,16 +241,16 @@ public class ClientState
{
// Generating toxic change leads to mass merging so it's better to merge sooner in coinjoin than the user do it himself in a non-CJ.
// The best selection's anonset should not be lowered by this merge.
- int bestMinAnonset = bestSet.Min(x => x.HdPubKey.AnonymitySet);
+ int bestAnonset = bestSet.Min(x => x.HdPubKey.AnonymitySet);
var bestSum = Money.Satoshis(bestSet.Sum(x => x.Amount));
if (!bestSum.Almost(amountNeeded, Money.Coins(0.0001m)) // Otherwise it wouldn't generate change so consolidation would make no sense.
- && bestMinAnonset > 1) // Red coins should never be merged.
+ && bestAnonset > 1) // Red coins should never be merged.
{
IEnumerable<SmartCoin> coinsThatCanBeConsolidated = coins
.Except(bestSet) // Get all the registrable coins, except the already chosen ones.
.Where(x =>
- x.HdPubKey.AnonymitySet >= bestMinAnonset // The anonset must be at least equal to the bestSet's anonset so we do not ruin the change's after mix anonset.
+ x.HdPubKey.AnonymitySet >= bestAnonset // The anonset must be at least equal to the bestSet's anonset so we do not ruin the change's after mix anonset.
&& x.HdPubKey.AnonymitySet > 1 // Red coins should never be merged.
&& x.Amount < amountNeeded // The amount needs to be smaller than the amountNeeded (so to make sure this is toxic change.)
&& bestSum + x.Amount > amountNeeded) // Sanity check that the amount added do not ruin the registration.

MODIFY
WalletWasabi/WabiSabi/Client/CoinJoinClient.cs
WalletWasabi/WabiSabi/Client/CoinJoinClient.cs
@@ -33,14 +33,14 @@ public class CoinJoinClient
// This is a maximum cap the delay can be smaller if the remaining time is less.
private static readonly TimeSpan MaximumRequestDelay = TimeSpan.FromSeconds(10);
- /// <param name="minAnonScoreTarget">Coins those have reached anonymity target, but still can be mixed if desired.</param>
+ /// <param name="anonScoreTarget">Coins those have reached anonymity target, but still can be mixed if desired.</param>
/// <param name="consolidationMode">If true, then aggressively try to consolidate as many coins as it can.</param>
public CoinJoinClient(
IWasabiHttpClientFactory httpClientFactory,
IKeyChain keyChain,
IDestinationProvider destinationProvider,
RoundStateUpdater roundStatusUpdater,
- int minAnonScoreTarget = int.MaxValue,
+ int anonScoreTarget = int.MaxValue,
bool consolidationMode = false,
TimeSpan feeRateMedianTimeFrame = default,
TimeSpan doNotRegisterInLastMinuteTimeLimit = default)
@@ -49,7 +49,7 @@ public class CoinJoinClient
KeyChain = keyChain;
DestinationProvider = destinationProvider;
RoundStatusUpdater = roundStatusUpdater;
- MinAnonScoreTarget = minAnonScoreTarget;
+ AnonScoreTarget = anonScoreTarget;
ConsolidationMode = consolidationMode;
FeeRateMedianTimeFrame = feeRateMedianTimeFrame;
SecureRandom = new SecureRandom();
@@ -63,7 +63,7 @@ public class CoinJoinClient
private IKeyChain KeyChain { get; }
private IDestinationProvider DestinationProvider { get; }
private RoundStateUpdater RoundStatusUpdater { get; }
- public int MinAnonScoreTarget { get; }
+ public int AnonScoreTarget { get; }
private TimeSpan DoNotRegisterInLastMinuteTimeLimit { get; }
public bool ConsolidationMode { get; private set; }
@@ -129,7 +129,7 @@ public class CoinJoinClient
{
currentRoundState = await WaitForRoundAsync(excludeRound, cancellationToken).ConfigureAwait(false);
RoundParameters roundParameteers = currentRoundState.CoinjoinState.Parameters;
- coins = SelectCoinsForRound(coinCandidates, roundParameteers, ConsolidationMode, MinAnonScoreTarget, SecureRandom);
+ coins = SelectCoinsForRound(coinCandidates, roundParameteers, ConsolidationMode, AnonScoreTarget, SecureRandom);
if (roundParameteers.MaxSuggestedAmount != default && coins.Any(c => c.Amount > roundParameteers.MaxSuggestedAmount))
{
@@ -439,7 +439,7 @@ public class CoinJoinClient
roundState.LogDebug(string.Join(Environment.NewLine, summary));
}
- internal static ImmutableList<SmartCoin> SelectCoinsForRound(IEnumerable<SmartCoin> coins, RoundParameters parameters, bool consolidationMode, int minAnonScoreTarget, WasabiRandom rnd)
+ internal static ImmutableList<SmartCoin> SelectCoinsForRound(IEnumerable<SmartCoin> coins, RoundParameters parameters, bool consolidationMode, int anonScoreTarget, WasabiRandom rnd)
{
var filteredCoins = coins
.Where(x => parameters.AllowedInputAmounts.Contains(x.Amount))
@@ -452,7 +452,7 @@ public class CoinJoinClient
int inputCount = consolidationMode ? MaxInputsRegistrableByWallet : GetInputTarget(filteredCoins.Length, rnd);
var nonPrivateFilteredCoins = filteredCoins
- .Where(x => x.HdPubKey.AnonymitySet < minAnonScoreTarget)
+ .Where(x => x.HdPubKey.AnonymitySet < anonScoreTarget)
.ToArray();
// Always have the top largest amounts playing to not participate with insignificant amounts and fragment needlessly.

Rename min anon to anon