Remove IActionResult casting and simplify return statement
MODIFY
WalletWasabi.Backend/Controllers/OffchainController.cs
WalletWasabi.Backend/Controllers/OffchainController.cs
@@ -39,9 +39,12 @@ namespace WalletWasabi.Backend.Controllers
{
IEnumerable<ExchangeRate> exchangeRates = await GetExchangeRatesCollectionAsync();
- return !exchangeRates.Any()
- ? NotFound("Exchange rates are not available.")
- : (IActionResult)Ok(exchangeRates);
+ if (!exchangeRates.Any())
+ {
+ return NotFound("Exchange rates are not available.");
+ }
+
+ return Ok(exchangeRates);
}
internal async Task<IEnumerable<ExchangeRate>> GetExchangeRatesCollectionAsync()

MODIFY
WalletWasabi/Services/MempoolService.cs
WalletWasabi/Services/MempoolService.cs
@@ -76,7 +76,9 @@ namespace WalletWasabi.Services
var found = BroadcastStore.FirstOrDefault(x => x.TransactionId == transactionHash);
entry = found;
- return !(found is null);
+ return found is null
+ ? false
+ : true;
}
}

Remove IActionResult casting and simplify return statement