improve insufficiend funds warning
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/SendTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/SendTabViewModel.cs
@@ -13,6 +13,7 @@ using WalletWasabi.Services;
using WalletWasabi.Gui.ViewModels.Validation;
using WalletWasabi.Helpers;
using ReactiveUI.Legacy;
+using WalletWasabi.Exceptions;
namespace WalletWasabi.Gui.Controls.WalletExplorer
{
@@ -129,6 +130,12 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
SuccessMessage = "Transaction is successfully sent!";
WarningMessage = "";
}
+ catch (InsufficientBalanceException ex)
+ {
+ SuccessMessage = "";
+ Money needed = ex.Minimum - ex.Actual;
+ WarningMessage = $"Not enough coins selected. You need an estimated {needed.ToString(false, true)} BTC more to make this transaction.";
+ }
catch (Exception ex)
{
SuccessMessage = "";

MODIFY
WalletWasabi/Exceptions/InsufficientBalanceException.cs
WalletWasabi/Exceptions/InsufficientBalanceException.cs
@@ -5,8 +5,13 @@ namespace WalletWasabi.Exceptions
{
public class InsufficientBalanceException : Exception
{
+ public Money Minimum { get; }
+ public Money Actual { get; }
+
public InsufficientBalanceException(Money minimum, Money actual) : base($"Needed: {minimum.ToString(false, true)} BTC, got only: {actual.ToString(false, true)} BTC.")
{
+ Minimum = minimum ?? Money.Zero;
+ Actual = actual ?? Money.Zero;
}
}
}

improve insufficiend funds warning