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

Migrate test framework from zcash_client_sqlite to zcash_client_backend #1412

Open
str4d opened this issue Jun 13, 2024 · 2 comments
Open

Migrate test framework from zcash_client_sqlite to zcash_client_backend #1412

str4d opened this issue Jun 13, 2024 · 2 comments
Assignees
Labels
A-wallet Area: light wallet backend.

Comments

@str4d
Copy link
Contributor

str4d commented Jun 13, 2024

zcash_client_sqlite::testing contains a TestBuilder that can be used to produce a TestState, on which a test can operate. The test framework is generic over a block cache, that can optionally be provided with a TestCache implementation for tests that require block scanning. However, it currently hard-codes zcash_client_sqlite::WalletDb as the wallet that is tested.

In order to make the tests reusable with other wallet backends, we should rework TestBuilder etc to be generic over a TestWallet trait, that exposes the necessary operations that we currently depend on concrete WalletDb methods for. The new generic TestBuilder parameter should also be bound on WalletRead, WalletWrite, etc. as appropriate (i.e. only when the test framework requires a given bound).

Once that refactor is done, we can then move the test framework to zcash_client_backend behind the test-dependencies feature flag, and depend on it from zcash_client_sqlite. This will then free us up to subsequently genericise and migrate individual tests from zcash_client_sqlite to zcash_client_backend as we wish.

@oxarbitrage
Copy link
Contributor

FYI: I made some progress on this yesterday after discussing with @nuttycom that this is a good time. I will keep working on it and submit a PR soon (today or in the next few days). For easier review my current plan is to push 2 PRs, one with the all the refactoring needed inside zcash_client_sqlite and after we are happy with it, make another one with the actual move.

@oxarbitrage
Copy link
Contributor

This is being worked on by @nuttycom in #1530 so i am unassigning myself.

@nuttycom nuttycom self-assigned this Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-wallet Area: light wallet backend.
Projects
None yet
Development

No branches or pull requests

3 participants