Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[trivial] Remove IRepository and replace it with IFileSystemBlockRepository #12236

Conversation

kiminuo
Copy link
Collaborator

@kiminuo kiminuo commented Jan 12, 2024

This is a helper PR for #12184 that allows easier mocking. It's also a general cleanup because IRepository<TID, TElem> is used only for block repository purposes and as such it's needlessly generic.

@kiminuo kiminuo marked this pull request as ready for review January 12, 2024 09:01
@@ -109,7 +109,7 @@ public async Task TestServicesAsync(string networkString)
ExpirationScanFrequency = TimeSpan.FromSeconds(30)
});

IRepository<uint256, Block> blockRepository = bitcoinStore.BlockRepository;
IFileSystemBlockRepository blockRepository = bitcoinStore.BlockRepository;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what the PR is about. Just change IRepository<uint256, Block> to IFileSystemBlockRepository.

/// <summary>
/// IRepository is a generic abstraction of a repository pattern
/// </summary>
public interface IRepository<TID, TElement>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaced with IFileSystemBlockRepository.cs


namespace WalletWasabi.Tests.UnitTests.Wallet;

public class MockBlockRepository : IRepository<uint256, Block>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaced with MockFileSystemBlockRepository

@kiminuo kiminuo requested a review from yahiheb January 12, 2024 09:03
@kiminuo kiminuo changed the title Remove IRepository and replace it with IFileSystemBlockRepository [trivial] Remove IRepository and replace it with IFileSystemBlockRepository Jan 12, 2024
Copy link
Collaborator

@yahiheb yahiheb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kiminuo kiminuo requested a review from turbolay January 12, 2024 09:56
@kiminuo kiminuo merged commit 4e980d9 into WalletWasabi:master Jan 12, 2024
7 checks passed
@kiminuo kiminuo deleted the feature/2024-01-12-BlockRepository-improvements branch January 12, 2024 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants