move the destination address into the transaction info class
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionInfo.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionInfo.cs
@@ -13,8 +13,9 @@ public partial class TransactionInfo
[AutoNotify] private FeeRate _feeRate = FeeRate.Zero;
[AutoNotify] private IEnumerable<SmartCoin> _coins = Enumerable.Empty<SmartCoin>();
- public TransactionInfo(int anonScoreTarget)
+ public TransactionInfo(BitcoinAddress destination, int anonScoreTarget)
{
+ Destination = destination;
PrivateCoinThreshold = anonScoreTarget;
this.WhenAnyValue(x => x.FeeRate)
@@ -32,7 +33,9 @@ public partial class TransactionInfo
/// </summary>
public Money MinimumRequiredAmount { get; set; } = Money.Zero;
- public Money Amount { get; set; } = Money.Zero;
+ public Money Amount { get; init; } = Money.Zero;
+
+ public BitcoinAddress Destination { get; init; }
public SmartLabel UserLabels { get; set; } = SmartLabel.Empty;
@@ -48,8 +51,6 @@ public partial class TransactionInfo
public bool IsOptimized => ChangelessCoins.Any();
- public bool IsPrivate => Coins.All(x => x.HdPubKey.AnonymitySet >= PrivateCoinThreshold);
-
public bool IsCustomFeeUsed { get; set; }
public bool SubtractFee { get; set; }
@@ -58,24 +59,6 @@ public partial class TransactionInfo
public bool IsSelectedCoinModificationEnabled { get; set; } = true;
- public void Reset()
- {
- Amount = Money.Zero;
- MinimumRequiredAmount = Money.Zero;
- UserLabels = SmartLabel.Empty;
- MaximumPossibleFeeRate = null;
- ConfirmationTimeSpan = TimeSpan.Zero;
- Coins = Enumerable.Empty<SmartCoin>();
- ChangelessCoins = Enumerable.Empty<SmartCoin>();
- SubtractFee = default;
- IsOtherPocketSelectionPossible = default;
-
- if (!IsCustomFeeUsed)
- {
- FeeRate = FeeRate.Zero;
- }
- }
-
private void OnFeeChanged()
{
ChangelessCoins = Enumerable.Empty<SmartCoin>();
@@ -89,20 +72,22 @@ public partial class TransactionInfo
public TransactionInfo Clone()
{
- return new TransactionInfo(PrivateCoinThreshold)
+ return new TransactionInfo(Destination, PrivateCoinThreshold)
{
- Amount = Amount,
- MinimumRequiredAmount = MinimumRequiredAmount,
- ChangelessCoins = ChangelessCoins,
- Coins = Coins,
- ConfirmationTimeSpan = ConfirmationTimeSpan,
FeeRate = FeeRate,
- IsCustomFeeUsed = IsCustomFeeUsed,
+ Coins = Coins,
+ MinimumRequiredAmount = MinimumRequiredAmount,
+ Amount = Amount,
+ Destination = Destination,
+ UserLabels = UserLabels,
MaximumPossibleFeeRate = MaximumPossibleFeeRate,
+ ConfirmationTimeSpan = ConfirmationTimeSpan,
+ ChangelessCoins = ChangelessCoins,
PayJoinClient = PayJoinClient,
+ IsCustomFeeUsed = IsCustomFeeUsed,
SubtractFee = SubtractFee,
- UserLabels = UserLabels,
- IsOtherPocketSelectionPossible = IsOtherPocketSelectionPossible
+ IsOtherPocketSelectionPossible = IsOtherPocketSelectionPossible,
+ IsSelectedCoinModificationEnabled = IsSelectedCoinModificationEnabled
};
}
}

move the destination address into the transaction info class