fix FeeRate null warnings
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendFeeViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendFeeViewModel.cs
@@ -81,7 +81,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
var feeEstimations = _wallet.Network == Network.TestNet ? TestNetFeeEstimates : feeProvider.AllFeeEstimate.Estimations;
FeeChart.UpdateFeeEstimates(feeEstimations);
- if (_transactionInfo.FeeRate is { })
+ if (_transactionInfo.FeeRate != FeeRate.Zero)
{
FeeChart.InitCurrentConfirmationTarget(_transactionInfo.FeeRate);
}

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionInfo.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionInfo.cs
@@ -28,7 +28,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
public BitcoinAddress Address { get; set; }
- public FeeRate? FeeRate { get; set; }
+ public FeeRate FeeRate { get; set; } = FeeRate.Zero;
public TimeSpan ConfirmationTimeSpan { get; set; }
@@ -45,7 +45,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
private void OnAmountChanged()
{
SubtractFee = default;
- FeeRate = default;
+ FeeRate = FeeRate.Zero;
if (Coins.Sum(x => x.Amount) < Amount) // Reset coins if the selected cluster is not enough for the new amount
{

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionPreviewViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionPreviewViewModel.cs
@@ -102,7 +102,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
{
var feeRateDialogResult = await NavigateDialogAsync(new SendFeeViewModel(_wallet, _info, false));
- if (feeRateDialogResult.Kind == DialogResultKind.Normal && feeRateDialogResult.Result != _info.FeeRate)
+ if (feeRateDialogResult.Kind == DialogResultKind.Normal && feeRateDialogResult.Result is { } newFeeRate && newFeeRate != _info.FeeRate)
{
_info.FeeRate = feeRateDialogResult.Result;
@@ -159,12 +159,12 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
}
}
- if (_info.FeeRate is null)
+ if (_info.FeeRate == FeeRate.Zero)
{
var feeDialogResult = await NavigateDialogAsync(new SendFeeViewModel(_wallet, _info, true));
- if (feeDialogResult.Kind == DialogResultKind.Normal)
+ if (feeDialogResult.Kind == DialogResultKind.Normal && feeDialogResult.Result is { } newFeeRate)
{
- _info.FeeRate = feeDialogResult.Result;
+ _info.FeeRate = newFeeRate;
}
else
{
@@ -244,9 +244,9 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
"Wasabi was unable to create your transaction.");
var feeDialogResult = await NavigateDialogAsync(new SendFeeViewModel(wallet, transactionInfo, false), NavigationTarget.DialogScreen);
- if (feeDialogResult.Kind == DialogResultKind.Normal)
+ if (feeDialogResult.Kind == DialogResultKind.Normal && feeDialogResult.Result is { } newFeeRate)
{
- transactionInfo.FeeRate = feeDialogResult.Result;
+ transactionInfo.FeeRate = newFeeRate;
}
if (TransactionHelpers.TryBuildTransaction(wallet, transactionInfo, out var txn))

fix FeeRate null warnings