Skip to content

Expose sqlite testing#2500

Closed
dannywillems wants to merge 3 commits into
mainfrom
dw/expose-sqlite-testing
Closed

Expose sqlite testing#2500
dannywillems wants to merge 3 commits into
mainfrom
dw/expose-sqlite-testing

Conversation

@dannywillems

@dannywillems dannywillems commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

To be used by zallet.

Used in zcash/zallet#531

EDIT: I'll close soon I think, I'm moving into integration-tests instead.

dannywillems and others added 3 commits June 29, 2026 23:15
…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>
@dannywillems
dannywillems deleted the dw/expose-sqlite-testing branch July 1, 2026 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant