Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,10 @@ jobs:
uses: ./.github/actions/prepare
- uses: dtolnay/rust-toolchain@beta
id: toolchain
with:
components: clippy
- run: rustup override set "${TOOLCHAIN}"
shell: sh
env:
TOOLCHAIN: ${{steps.toolchain.outputs.name}}
- name: Run Clippy (beta)
Expand Down
2 changes: 1 addition & 1 deletion zcash_client_backend/src/tor/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl Client {
//
// https://gitlab.torproject.org/tpo/core/arti/-/issues/715
let root_store = RootCertStore {
roots: webpki_roots::TLS_SERVER_ROOTS.iter().cloned().collect(),
roots: webpki_roots::TLS_SERVER_ROOTS.to_vec(),
};
let config = ClientConfig::builder()
.with_root_certificates(root_store)
Expand Down
5 changes: 5 additions & 0 deletions zcash_client_sqlite/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ and this library adheres to Rust's notion of
- `zcash_client_sqlite::wallet::init::WalletMigrator`
- `zcash_client_sqlite::wallet::init::migrations`

### Changed
- `zcash_client_sqlite::wallet::init::WalletMigrationError::`
- Variants `WalletMigrationError::CommitmentTree` and
`WalletMigrationError::Other` now `Box` their contents.

## [0.16.2] - 2025-04-02

### Fixed
Expand Down
16 changes: 9 additions & 7 deletions zcash_client_sqlite/src/wallet/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ pub enum WalletMigrationError {
BalanceError(BalanceError),

/// Wrapper for commitment tree invariant violations
CommitmentTree(ShardTreeError<commitment_tree::Error>),
CommitmentTree(Box<ShardTreeError<commitment_tree::Error>>),
Comment thread
nuttycom marked this conversation as resolved.

/// Reverting the specified migration is not supported.
CannotRevert(Uuid),

/// Some other unexpected violation of database business rules occurred
Other(SqliteClientError),
Other(Box<SqliteClientError>),
Comment thread
nuttycom marked this conversation as resolved.
}

impl From<rusqlite::Error> for WalletMigrationError {
Expand All @@ -84,7 +84,7 @@ impl From<BalanceError> for WalletMigrationError {

impl From<ShardTreeError<commitment_tree::Error>> for WalletMigrationError {
fn from(e: ShardTreeError<commitment_tree::Error>) -> Self {
WalletMigrationError::CommitmentTree(e)
WalletMigrationError::CommitmentTree(Box::new(e))
}
}

Expand All @@ -99,12 +99,14 @@ impl From<SqliteClientError> for WalletMigrationError {
match value {
SqliteClientError::CorruptedData(err) => WalletMigrationError::CorruptedData(err),
SqliteClientError::DbError(err) => WalletMigrationError::DbError(err),
SqliteClientError::CommitmentTree(err) => WalletMigrationError::CommitmentTree(err),
SqliteClientError::CommitmentTree(err) => {
WalletMigrationError::CommitmentTree(Box::new(err))
}
SqliteClientError::BalanceError(err) => WalletMigrationError::BalanceError(err),
SqliteClientError::AddressGeneration(err) => {
WalletMigrationError::AddressGeneration(err)
}
other => WalletMigrationError::Other(other),
other => WalletMigrationError::Other(Box::new(other)),
}
}
}
Expand Down Expand Up @@ -193,7 +195,7 @@ fn sqlite_client_error_to_wallet_migration_error(e: SqliteClientError) -> Wallet
SqliteClientError::InvalidMemo(e) => WalletMigrationError::CorruptedData(e.to_string()),
SqliteClientError::AddressGeneration(e) => WalletMigrationError::AddressGeneration(e),
SqliteClientError::BadAccountData(e) => WalletMigrationError::CorruptedData(e),
SqliteClientError::CommitmentTree(e) => WalletMigrationError::CommitmentTree(e),
SqliteClientError::CommitmentTree(e) => WalletMigrationError::CommitmentTree(Box::new(e)),
SqliteClientError::UnsupportedPoolType(pool) => WalletMigrationError::CorruptedData(
format!("Wallet DB contains unsupported pool type {}", pool),
),
Expand Down Expand Up @@ -239,7 +241,7 @@ fn sqlite_client_error_to_wallet_migration_error(e: SqliteClientError) -> Wallet
}
#[cfg(feature = "transparent-inputs")]
SqliteClientError::Scheduling(e) => {
WalletMigrationError::Other(SqliteClientError::Scheduling(e))
WalletMigrationError::Other(Box::new(SqliteClientError::Scheduling(e)))
}
}
}
Expand Down
3 changes: 0 additions & 3 deletions zcash_primitives/src/merkle_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ pub fn write_nonempty_frontier_v1<H: HashSer, W: Write>(
Ok(())
}

#[allow(clippy::redundant_closure)]
pub fn read_nonempty_frontier_v1<H: HashSer + Clone, R: Read>(
mut reader: R,
) -> io::Result<NonEmptyFrontier<H>> {
Expand Down Expand Up @@ -169,7 +168,6 @@ pub fn write_frontier_v1<H: HashSer, W: Write>(
Optional::write(writer, frontier.value(), write_nonempty_frontier_v1)
}

#[allow(clippy::redundant_closure)]
pub fn read_frontier_v1<H: HashSer + Clone, R: Read>(reader: R) -> io::Result<Frontier<H, 32>> {
match Optional::read(reader, read_nonempty_frontier_v1)? {
None => Ok(Frontier::empty()),
Expand Down Expand Up @@ -211,7 +209,6 @@ pub fn write_commitment_tree<Node: HashSer, W: Write, const DEPTH: u8>(
}

/// Reads an `IncrementalWitness` from its serialized form.
#[allow(clippy::redundant_closure)]
pub fn read_incremental_witness<Node: HashSer, R: Read, const DEPTH: u8>(
mut reader: R,
) -> io::Result<IncrementalWitness<Node, DEPTH>> {
Expand Down
4 changes: 2 additions & 2 deletions zcash_proofs/src/downloadreader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl io::Read for ResponseLazyReader {
let error = format!("download response failed: {:?}", error);

*self = Complete(Err(error.clone()));
return Err(io::Error::new(io::ErrorKind::Other, error));
return Err(io::Error::other(error));
}
}
}
Expand All @@ -75,7 +75,7 @@ impl io::Read for ResponseLazyReader {
// Return a zero-byte read for download success and EOF.
Ok(()) => Ok(0),
// Keep returning the download error,
Err(error) => Err(io::Error::new(io::ErrorKind::Other, error.clone())),
Err(error) => Err(io::Error::other(error.clone())),
};
}
}
Expand Down
5 changes: 2 additions & 3 deletions zcash_proofs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,8 @@ fn fetch_params(
timeout: Option<u64>,
) -> Result<PathBuf, minreq::Error> {
// Ensure that the default Zcash parameters location exists.
let params_dir = default_params_folder().ok_or_else(|| {
io::Error::new(io::ErrorKind::Other, "Could not load default params folder")
})?;
let params_dir = default_params_folder()
.ok_or_else(|| io::Error::other("Could not load default params folder"))?;
std::fs::create_dir_all(&params_dir)?;

let params_path = params_dir.join(name);
Expand Down
Loading