fix TransactionInfo in WalletCoinsViewModel.cs
MODIFY
WalletWasabi.Fluent/ViewModels/Dialogs/AddressEntryDialogViewModel.cs
WalletWasabi.Fluent/ViewModels/Dialogs/AddressEntryDialogViewModel.cs
@@ -19,20 +19,19 @@ using WalletWasabi.Userfacing;
namespace WalletWasabi.Fluent.ViewModels.Dialogs;
[NavigationMetaData(Title = "Address")]
-public partial class AddressEntryDialogViewModel : DialogViewModelBase<BitcoinAddress?>
+public partial class AddressEntryDialogViewModel : DialogViewModelBase<BitcoinUrlBuilder?>
{
private readonly Network _network;
- private readonly TransactionInfo _info;
[AutoNotify] private string _to = "";
private bool _parsingUrl;
private bool _payJoinUrlFound;
private bool _amountUrlFound;
+ private BitcoinUrlBuilder? _resultToReturn;
- public AddressEntryDialogViewModel(Network network, TransactionInfo info)
+ public AddressEntryDialogViewModel(Network network)
{
_network = network;
- _info = info;
IsQrButtonVisible = WebcamQrReader.IsOsPlatformSupported;
SetupCancel(enableCancel: true, enableCancelOnEscape: true, enableCancelOnPressed: true);
@@ -65,7 +64,7 @@ public partial class AddressEntryDialogViewModel : DialogViewModelBase<BitcoinAd
return addressFilled && !hasError;
});
- NextCommand = ReactiveCommand.Create(() => Close(DialogResultKind.Normal, BitcoinAddress.Create(To, _network)), nextCommandCanExecute);
+ NextCommand = ReactiveCommand.Create(() => Close(DialogResultKind.Normal, _resultToReturn), nextCommandCanExecute);
}
public bool IsQrButtonVisible { get; }
@@ -126,15 +125,9 @@ public partial class AddressEntryDialogViewModel : DialogViewModelBase<BitcoinAd
return false;
}
- bool result = false;
-
if (AddressStringParser.TryParse(text, _network, out BitcoinUrlBuilder? url))
{
- result = true;
- if (url.Label is { } label)
- {
- _info.UserLabels = new SmartLabel(label);
- }
+ _resultToReturn = url;
_payJoinUrlFound = url.UnknownParameters.TryGetValue("pj", out _);
@@ -151,7 +144,7 @@ public partial class AddressEntryDialogViewModel : DialogViewModelBase<BitcoinAd
_amountUrlFound = false;
}
- return result;
+ return _resultToReturn is { };
}
protected override void OnNavigatedTo(bool isInHistory, CompositeDisposable disposables)

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Advanced/WalletCoins/WalletCoinsViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Advanced/WalletCoins/WalletCoinsViewModel.cs
@@ -10,6 +10,7 @@ using Avalonia.Controls.Models.TreeDataGrid;
using Avalonia.Controls.Templates;
using DynamicData;
using ReactiveUI;
+using WalletWasabi.Blockchain.Analysis.Clustering;
using WalletWasabi.Blockchain.TransactionOutputs;
using WalletWasabi.Fluent.Extensions;
using WalletWasabi.Fluent.ViewModels.Dialogs;
@@ -107,29 +108,31 @@ public partial class WalletCoinsViewModel : RoutableViewModel
{
var wallet = _walletViewModel.Wallet;
var selectedSmartCoins = Source.Items.Where(x => x.IsSelected).Select(x => x.Coin).ToImmutableArray();
- var info = new TransactionInfo(wallet.KeyManager.AnonScoreTarget);
- var addressDialog = new AddressEntryDialogViewModel(wallet.Network, info);
+ var addressDialog = new AddressEntryDialogViewModel(wallet.Network);
var addressResult = await NavigateDialogAsync(addressDialog, NavigationTarget.CompactDialogScreen);
- if (addressResult.Result is not { } address)
+ if (addressResult.Result is not { } address || address.Address is null)
{
return;
}
- var labelDialog = new LabelEntryDialogViewModel(wallet, info);
+ var labelDialog = new LabelEntryDialogViewModel(wallet, address.Label ?? SmartLabel.Empty);
var result = await NavigateDialogAsync(labelDialog, NavigationTarget.CompactDialogScreen);
if (result.Result is not { } label)
{
return;
}
- info.Coins = selectedSmartCoins;
- info.Amount = selectedSmartCoins.Sum(x => x.Amount);
- info.SubtractFee = true;
- info.UserLabels = label;
- info.IsSelectedCoinModificationEnabled = false;
+ var info = new TransactionInfo(address.Address, wallet.KeyManager.AnonScoreTarget)
+ {
+ Coins = selectedSmartCoins,
+ Amount = selectedSmartCoins.Sum(x => x.Amount),
+ SubtractFee = true,
+ UserLabels = label,
+ IsSelectedCoinModificationEnabled = false
+ };
- Navigate().To(new TransactionPreviewViewModel(wallet, info, address, true));
+ Navigate().To(new TransactionPreviewViewModel(wallet, info, true));
}
private FlatTreeDataGridSource<WalletCoinViewModel> CreateGridSource(IEnumerable<WalletCoinViewModel> coins)

fix TransactionInfo in WalletCoinsViewModel.cs