Remove warnings related to FileSystemBlockRepository
MODIFY
WalletWasabi/Wallets/CachedBlockProvider.cs
WalletWasabi/Wallets/CachedBlockProvider.cs
@@ -28,7 +28,7 @@ namespace WalletWasabi.Wallets
/// <returns>The requested bitcoin block.</returns>
public async Task<Block> GetBlockAsync(uint256 hash, CancellationToken cancellationToken)
{
- Block block = await BlockRepository.GetAsync(hash, cancellationToken).ConfigureAwait(false);
+ Block? block = await BlockRepository.GetAsync(hash, cancellationToken).ConfigureAwait(false);
if (block is null)
{
block = await BlockSourceProvider.GetBlockAsync(hash, cancellationToken).ConfigureAwait(false);

MODIFY
WalletWasabi/Wallets/FileSystemBlockRepository.cs
WalletWasabi/Wallets/FileSystemBlockRepository.cs
@@ -206,7 +206,7 @@ namespace WalletWasabi.Wallets
/// <param name="hash">The block's hash that identifies the requested block.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>The requested bitcoin block.</returns>
- public async Task<Block> GetAsync(uint256 hash, CancellationToken cancellationToken)
+ public async Task<Block?> GetAsync(uint256 hash, CancellationToken cancellationToken)
{
// Try get the block.
Block? block = null;
@@ -221,7 +221,7 @@ namespace WalletWasabi.Wallets
byte[] blockBytes = await File.ReadAllBytesAsync(filePath, cancellationToken).ConfigureAwait(false);
block = Block.Load(blockBytes, Network);
- new FileInfo(filePath)
+ _ = new FileInfo(filePath)
{
LastAccessTimeUtc = DateTime.UtcNow
};

MODIFY
WalletWasabi/Wallets/IRepository.cs
WalletWasabi/Wallets/IRepository.cs
@@ -8,7 +8,7 @@ namespace WalletWasabi.Wallets
/// </summary>
public interface IRepository<TID, TElement>
{
- Task<TElement> GetAsync(TID id, CancellationToken cancel);
+ Task<TElement?> GetAsync(TID id, CancellationToken cancel);
Task SaveAsync(TElement element, CancellationToken cancel);

Remove warnings related to FileSystemBlockRepository