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

test(db): complete DatabaseProviderFactory impl for MockEthProvider #14605

Merged
merged 2 commits into from
Feb 20, 2025

Conversation

fgimenez
Copy link
Member

Towards #14376
Extracted from #14482

ConsistentDBView uses DatabaseProviderFactory::database_provider_ro for the provider it uses to perform consistency checks on the current tip

let provider_ro = self.factory.database_provider_ro()?;

In the current impl of that method for MockEthProvider we just return an error. These changes add a proper implementation to use the mock in scenarios where ConsistentDbView is at play (like engine unit tests). The Provider and ProviderRW associated types are set to Self so that we can leverage the existing methods to setup the mock state.

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

makes sense

@fgimenez fgimenez added A-db Related to the database C-test A change that impacts how or what we test labels Feb 20, 2025
@fgimenez fgimenez enabled auto-merge February 20, 2025 11:33
@fgimenez fgimenez added this pull request to the merge queue Feb 20, 2025
Merged via the queue into main with commit 246a9ff Feb 20, 2025
42 checks passed
@fgimenez fgimenez deleted the fgimenez/update-database-provider-factory-mock-impl branch February 20, 2025 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-db Related to the database C-test A change that impacts how or what we test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants