diff --git a/Cargo.toml b/Cargo.toml index 6b2e0e94a..57209ab1a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -156,3 +156,6 @@ zip32 = "0.1.1" lto = true panic = 'abort' codegen-units = 1 + +[workspace.lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(zcash_unstable, values("zfuture"))'] } diff --git a/components/zip321/Cargo.toml b/components/zip321/Cargo.toml index 33052c2a6..013f824e9 100644 --- a/components/zip321/Cargo.toml +++ b/components/zip321/Cargo.toml @@ -22,7 +22,14 @@ nom = "7" base64.workspace = true percent-encoding.workspace = true +# - Test dependencies +proptest = { workspace = true, optional = true } + [dev-dependencies] zcash_address = { workspace = true, features = ["test-dependencies"] } zcash_protocol = { workspace = true, features = ["test-dependencies"] } proptest.workspace = true + +[features] +## Exposes APIs that are useful for testing, such as `proptest` strategies. +test-dependencies = ["dep:proptest"] diff --git a/zcash_client_backend/src/scan.rs b/zcash_client_backend/src/scan.rs index 0eb9abedb..74461d3dd 100644 --- a/zcash_client_backend/src/scan.rs +++ b/zcash_client_backend/src/scan.rs @@ -56,6 +56,7 @@ pub(crate) trait Decryptor { } /// A decryptor of outputs as encoded in transactions. +#[allow(dead_code)] pub(crate) struct FullDecryptor; impl> Decryptor @@ -200,6 +201,7 @@ impl Tasks for () { /// /// This struct implements `DynamicUsage` without any item bounds, but that works because /// it only implements `Tasks` for items that implement `DynamicUsage`. +#[allow(dead_code)] pub(crate) struct WithUsage { // The current heap usage for all running tasks. running_usage: Arc, diff --git a/zcash_client_sqlite/src/wallet/scanning.rs b/zcash_client_sqlite/src/wallet/scanning.rs index 64dede7e9..5e236ac2a 100644 --- a/zcash_client_sqlite/src/wallet/scanning.rs +++ b/zcash_client_sqlite/src/wallet/scanning.rs @@ -1,6 +1,5 @@ use incrementalmerkletree::{Address, Position}; use rusqlite::{self, named_params, types::Value, OptionalExtension}; -use shardtree::error::ShardTreeError; use std::cmp::{max, min}; use std::collections::BTreeSet; use std::ops::Range; @@ -18,7 +17,7 @@ use zcash_primitives::consensus::{self, BlockHeight, NetworkUpgrade}; use crate::{ error::SqliteClientError, - wallet::{block_height_extrema, commitment_tree, init::WalletMigrationError}, + wallet::{block_height_extrema, init::WalletMigrationError}, PRUNING_DEPTH, SAPLING_TABLES_PREFIX, VERIFY_LOOKAHEAD, }; @@ -119,8 +118,6 @@ pub(crate) fn insert_queue_entries<'a>( pub(crate) trait WalletError { fn db_error(err: rusqlite::Error) -> Self; fn corrupt(message: String) -> Self; - fn chain_height_unknown() -> Self; - fn commitment_tree(err: ShardTreeError) -> Self; } impl WalletError for SqliteClientError { @@ -131,14 +128,6 @@ impl WalletError for SqliteClientError { fn corrupt(message: String) -> Self { SqliteClientError::CorruptedData(message) } - - fn chain_height_unknown() -> Self { - SqliteClientError::ChainHeightUnknown - } - - fn commitment_tree(err: ShardTreeError) -> Self { - SqliteClientError::CommitmentTree(err) - } } impl WalletError for WalletMigrationError { @@ -149,16 +138,6 @@ impl WalletError for WalletMigrationError { fn corrupt(message: String) -> Self { WalletMigrationError::CorruptedData(message) } - - fn chain_height_unknown() -> Self { - WalletMigrationError::CorruptedData( - "Wallet migration requires a valid account birthday.".to_owned(), - ) - } - - fn commitment_tree(err: ShardTreeError) -> Self { - WalletMigrationError::CommitmentTree(err) - } } pub(crate) fn replace_queue_entries(