SmartBlockProvider: Unify parameter names, a bit of code style
MODIFY
WalletWasabi/Wallets/SmartBlockProvider.cs
WalletWasabi/Wallets/SmartBlockProvider.cs
@@ -34,9 +34,9 @@ public class SmartBlockProvider
public IRepository<uint256, Block> BlockRepository => CachedProvider.BlockRepository;
- public async Task<Block> GetBlockAsync(uint256 blockHash, CancellationToken cancel)
+ public async Task<Block> GetBlockAsync(uint256 blockHash, CancellationToken cancellationToken)
{
- Block? result = await CachedProvider.TryGetBlockAsync(blockHash, cancel).ConfigureAwait(false);
+ Block? result = await CachedProvider.TryGetBlockAsync(blockHash, cancellationToken).ConfigureAwait(false);
if (result is not null)
{
@@ -49,27 +49,26 @@ public class SmartBlockProvider
cacheKey,
action: (string request, CancellationToken token) => GetBlockNoCacheAsync(blockHash, token),
options: CacheOptions,
- cancel).ConfigureAwait(false);
+ cancellationToken).ConfigureAwait(false);
if (result is null)
{
throw new InvalidOperationException($"Block {blockHash} could not be downloaded from any source.");
}
- await CachedProvider.SaveBlockAsync(result, cancel).ConfigureAwait(false);
+ await CachedProvider.SaveBlockAsync(result, cancellationToken).ConfigureAwait(false);
return result;
}
- private async Task<Block?> GetBlockNoCacheAsync(uint256 blockHash, CancellationToken cancel)
+ private async Task<Block?> GetBlockNoCacheAsync(uint256 blockHash, CancellationToken cancellationToken)
{
- return await LocalBlockProvider.TryGetBlockAsync(blockHash, cancel).ConfigureAwait(false) ??
- await P2PBlockProvider.TryGetBlockAsync(blockHash, cancel).ConfigureAwait(false);
+ return await LocalBlockProvider.TryGetBlockAsync(blockHash, cancellationToken).ConfigureAwait(false)
+ ?? await P2PBlockProvider.TryGetBlockAsync(blockHash, cancellationToken).ConfigureAwait(false);
}
public Task InvalidateAsync(uint256 hash, CancellationToken cancellationToken)
{
return CachedProvider.InvalidateAsync(hash, cancellationToken);
}
-
}

SmartBlockProvider: Unify parameter names, a bit of code style