Expose sqlite testing#2500
Closed
dannywillems wants to merge 3 commits into
Closed
Conversation
…eature Make the `testing` module (and `db::TestDbFactory` / `db::TestDb` and `BlockCache`) public, gated on `any(test, feature = "test-dependencies")`, so downstream crates can build funded-wallet integration tests with `TestBuilder` against the SQLite backend, mirroring how `zcash_client_backend` exposes its testing utilities. Promote `ambassador`, `rand_chacha`, and `tempfile` from dev-dependencies to optional dependencies enabled by `test-dependencies`. The heavy `testing::pool` submodule stays `#[cfg(test)]`-only, so its proptest/assert_matches dependencies do not need to be exposed.
A downstream wallet under test (zallet) needs to point its own database connection at the same SQLite file that the in-memory test harness funded. The file path lived behind the pub(crate) data_file field, so add a public path() accessor returning the backing file path. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The harness always derived its account from an all-zeros 32-byte seed, which has no corresponding BIP 39 mnemonic. A downstream wallet whose keystore is mnemonic-based cannot reproduce that account's keys. Add a with_seed setter so a consumer can fund an account from a mnemonic-derived seed it controls; the default behaviour is unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
To be used by zallet.
Used in zcash/zallet#531
EDIT: I'll close soon I think, I'm moving into integration-tests instead.