Remove possible null reference
MODIFY
WalletWasabi.Fluent/Extensions/TransactionSummaryExtensions.cs
WalletWasabi.Fluent/Extensions/TransactionSummaryExtensions.cs
@@ -25,13 +25,8 @@ public static class TransactionSummaryExtensions
_ => throw new InvalidOperationException($"Invalid Fee Display Unit value: {feeDisplayUnit}")
};
- public static string? ToFeeDisplayUnitString(this Money? fee)
+ public static string ToFeeDisplayUnitString(this Money fee)
{
- if (fee == null)
- {
- return null;
- }
-
var displayUnit = Services.UiConfig.FeeDisplayUnit.GetEnumValueOrDefault(FeeDisplayUnit.BTC);
var moneyUnit = displayUnit.ToMoneyUnit();

MODIFY
WalletWasabi.Fluent/ViewModels/TransactionBroadcasting/BroadcastTransactionViewModel.cs
WalletWasabi.Fluent/ViewModels/TransactionBroadcasting/BroadcastTransactionViewModel.cs
@@ -33,7 +33,7 @@ public partial class BroadcastTransactionViewModel : RoutableViewModel
public string? InputAmountString { get; set; }
- public string? FeeString { get; set; }
+ public string FeeString { get; set; } = "Unknown";
public int InputCount { get; set; }
@@ -80,7 +80,7 @@ public partial class BroadcastTransactionViewModel : RoutableViewModel
? null
: totalInputValue - totalOutputValue;
- FeeString = networkFee?.ToFeeDisplayUnitString() ?? "Unknown";
+ FeeString = networkFee is null ? "Unknown" : networkFee.ToFeeDisplayUnitString();
}
private async Task OnNextAsync(SmartTransaction transaction)

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/Details/CoinJoinDetailsViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/Details/CoinJoinDetailsViewModel.cs
@@ -58,7 +58,7 @@ public partial class CoinJoinDetailsViewModel : RoutableViewModel
Date = _coinJoin.DateString;
Status = _coinJoin.IsConfirmed ? "Confirmed" : "Pending";
CoinJoinFee = _coinJoin.OutgoingAmount;
- CoinJoinFeeString = CoinJoinFee.ToFeeDisplayUnitString() ?? "Unknown";
+ CoinJoinFeeString = CoinJoinFee is null ? "Unknown" : CoinJoinFee.ToFeeDisplayUnitString();
TransactionId = _coinJoin.CoinJoinTransaction.TransactionId;
}

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/Details/CoinJoinsDetailsViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/Details/CoinJoinsDetailsViewModel.cs
@@ -61,7 +61,7 @@ public partial class CoinJoinsDetailsViewModel : RoutableViewModel
Date = _coinJoinGroup.DateString;
Status = _coinJoinGroup.IsConfirmed ? "Confirmed" : "Pending";
CoinJoinFee = _coinJoinGroup.OutgoingAmount;
- CoinJoinFeeString = CoinJoinFee.ToFeeDisplayUnitString() ?? "Unknown";
+ CoinJoinFeeString = CoinJoinFee is null ? "Unknown" : CoinJoinFee.ToFeeDisplayUnitString();
TransactionIds = new ObservableCollection<uint256>(_coinJoinGroup.CoinJoinTransactions.Select(x => x.TransactionId));
TxCount = TransactionIds.Count;

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionSummaryViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionSummaryViewModel.cs
using System.Linq;
+using NBitcoin;
using ReactiveUI;
using WalletWasabi.Blockchain.Analysis.Clustering;
using WalletWasabi.Blockchain.TransactionBuilding;
@@ -56,7 +57,7 @@ public partial class TransactionSummaryViewModel : ViewModelBase
var destinationAmount = _transaction.CalculateDestinationAmount();
AmountText = $"{destinationAmount.ToFormattedString()} BTC";
- var fee = _transaction.Fee;
+ Money fee = _transaction.Fee;
FeeText = fee.ToFeeDisplayUnitString();
var exchangeRate = _wallet.Synchronizer.UsdExchangeRate;

Remove possible null reference