Skip to content

Commit

Permalink
Merge pull request #1530 from nuttycom/generalized_test_framework
Browse files Browse the repository at this point in the history
Generalize the `zcash_client_sqlite` test framework and extract it to `zcash_client_backend`
  • Loading branch information
str4d authored Sep 10, 2024
2 parents 04478c7 + cd71c30 commit c97e9a1
Show file tree
Hide file tree
Showing 26 changed files with 3,897 additions and 3,456 deletions.
16 changes: 16 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ lazy_static = "1"
static_assertions = "1"

# Tests and benchmarks
ambassador = "0.4"
assert_matches = "1.5"
criterion = "0.5"
proptest = "1"
Expand Down
2 changes: 1 addition & 1 deletion components/zip321/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ mod parse {
)(input)
}

/// The primary parser for <name>=<value> query-string parameter pair.
/// The primary parser for `name=value` query-string parameter pairs.
pub fn zcashparam(input: &str) -> IResult<&str, IndexedParam> {
map_res(
separated_pair(indexed_name, char('='), recognize(qchars)),
Expand Down
6 changes: 6 additions & 0 deletions supply-chain/audits.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ description = "The cryptographic code in this crate has been reviewed for correc
[criteria.license-reviewed]
description = "The license of this crate has been reviewed for compatibility with its usage in this repository."

[[audits.ambassador]]
who = "Kris Nuttycombe <[email protected]>"
criteria = "safe-to-deploy"
version = "0.4.1"
notes = "Crate uses no unsafe code and the macros introduced by this crate generate the expected trait implementations without introducing additional unexpected operations."

[[audits.anyhow]]
who = "Daira-Emma Hopwood <[email protected]>"
criteria = "safe-to-deploy"
Expand Down
5 changes: 5 additions & 0 deletions zcash_client_backend/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this library adheres to Rust's notion of

## [Unreleased]

### Changed
- The `Account` trait now uses an associated type for its `AccountId`
type instead of a type parameter. This change allows for the simplification
of some type signatures.

## [0.13.0] - 2024-08-20

`zcash_client_backend` now supports TEX (transparent-source-only) addresses as specified
Expand Down
31 changes: 27 additions & 4 deletions zcash_client_backend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,13 @@ incrementalmerkletree.workspace = true
shardtree.workspace = true

# - Test dependencies
ambassador = { workspace = true, optional = true }
assert_matches = { workspace = true, optional = true }
pasta_curves = { workspace = true, optional = true }
proptest = { workspace = true, optional = true }
jubjub = { workspace = true, optional = true }
rand_chacha = { workspace = true, optional = true }
zcash_proofs = { workspace = true, optional = true }

# - ZIP 321
nom = "7"
Expand Down Expand Up @@ -137,17 +142,21 @@ tonic-build = { workspace = true, features = ["prost"] }
which = "4"

[dev-dependencies]
ambassador.workspace = true
assert_matches.workspace = true
gumdrop = "0.8"
incrementalmerkletree = { workspace = true, features = ["test-dependencies"] }
jubjub.workspace = true
proptest.workspace = true
rand_core.workspace = true
rand.workspace = true
rand_chacha.workspace = true
shardtree = { workspace = true, features = ["test-dependencies"] }
zcash_proofs.workspace = true
tokio = { version = "1.21.0", features = ["rt-multi-thread"] }
zcash_address = { workspace = true, features = ["test-dependencies"] }
zcash_keys = { workspace = true, features = ["test-dependencies"] }
tokio = { version = "1.21.0", features = ["rt-multi-thread"] }
zcash_primitives = { workspace = true, features = ["test-dependencies"] }
zcash_proofs = { workspace = true, features = ["bundled-prover"] }
zcash_protocol = { workspace = true, features = ["local-consensus"] }

[features]
## Enables the `tonic` gRPC client bindings for connecting to a `lightwalletd` server.
Expand All @@ -164,7 +173,7 @@ transparent-inputs = [
]

## Enables receiving and spending Orchard funds.
orchard = ["dep:orchard", "zcash_keys/orchard"]
orchard = ["dep:orchard", "dep:pasta_curves", "zcash_keys/orchard"]

## Exposes a wallet synchronization function that implements the necessary state machine.
sync = [
Expand Down Expand Up @@ -195,11 +204,17 @@ tor = [

## Exposes APIs that are useful for testing, such as `proptest` strategies.
test-dependencies = [
"dep:ambassador",
"dep:assert_matches",
"dep:proptest",
"dep:jubjub",
"dep:rand",
"dep:rand_chacha",
"orchard?/test-dependencies",
"zcash_keys/test-dependencies",
"zcash_primitives/test-dependencies",
"zcash_proofs/bundled-prover",
"zcash_protocol/local-consensus",
"incrementalmerkletree/test-dependencies",
]

Expand All @@ -214,6 +229,14 @@ unstable-serialization = ["dep:byteorder"]
## Exposes the [`data_api::scanning::spanning_tree`] module.
unstable-spanning-tree = []

## Exposes access to the lightwalletd server via TOR
tor-lightwalletd-tonic = [
"tor",
"lightwalletd-tonic",
"tonic?/tls",
"tonic?/tls-webpki-roots"
]

[lib]
bench = false

Expand Down
Loading

0 comments on commit c97e9a1

Please sign in to comment.