diff --git a/WalletWasabi.Fluent/Models/Wallets/WalletTransactionsModel.cs b/WalletWasabi.Fluent/Models/Wallets/WalletTransactionsModel.cs index aa369233c85..4b5de9e7699 100644 --- a/WalletWasabi.Fluent/Models/Wallets/WalletTransactionsModel.cs +++ b/WalletWasabi.Fluent/Models/Wallets/WalletTransactionsModel.cs @@ -105,6 +105,12 @@ public async Task LoadFromFileAsync(string path) public TimeSpan? TryEstimateConfirmationTime(TransactionModel model) => TryEstimateConfirmationTime(model.Id); + public TimeSpan? TryEstimateConfirmationTime(TransactionInfo info) + { + TransactionFeeHelper.TryEstimateConfirmationTime(_wallet, info.FeeRate, out var estimate); + return estimate; + } + public TransactionInfo Create(string address, decimal amount, string label) => Create(address, amount, new LabelsArray(label)); diff --git a/WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionSummaryViewModel.cs b/WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionSummaryViewModel.cs index 10dc6450225..3d6b16776b4 100644 --- a/WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionSummaryViewModel.cs +++ b/WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionSummaryViewModel.cs @@ -10,7 +10,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send; public partial class TransactionSummaryViewModel : ViewModelBase { - private readonly Wallet _wallet; + private readonly IWalletModel _wallet; private BuildTransactionResult? _transaction; [AutoNotify] private bool _transactionHasChange; [AutoNotify] private TimeSpan? _confirmationTime; @@ -24,7 +24,7 @@ public partial class TransactionSummaryViewModel : ViewModelBase [AutoNotify] private double? _amountDiff; [AutoNotify] private double? _feeDiff; - private TransactionSummaryViewModel(TransactionPreviewViewModel parent, Wallet wallet, TransactionInfo info, bool isPreview = false) + private TransactionSummaryViewModel(TransactionPreviewViewModel parent, IWalletModel wallet, TransactionInfo info, bool isPreview = false) { Parent = parent; _wallet = wallet; @@ -48,8 +48,7 @@ public void UpdateTransaction(BuildTransactionResult transactionResult, Transact { _transaction = transactionResult; - TransactionFeeHelper.TryEstimateConfirmationTime(_wallet, info.FeeRate, out var estimate); - ConfirmationTime = estimate; + ConfirmationTime = _wallet.Transactions.TryEstimateConfirmationTime(info); var destinationAmount = _transaction.CalculateDestinationAmount(info.Destination);