Skip to content

Commit

Permalink
Remove dead code and/or suppress dead code warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
nuttycom committed Sep 4, 2024
1 parent b72635f commit 155c56e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 22 deletions.
2 changes: 2 additions & 0 deletions zcash_client_backend/src/scan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ pub(crate) trait Decryptor<D: BatchDomain, Output> {
}

/// A decryptor of outputs as encoded in transactions.
#[allow(dead_code)]
pub(crate) struct FullDecryptor;

impl<D: BatchDomain, Output: ShieldedOutput<D, ENC_CIPHERTEXT_SIZE>> Decryptor<D, Output>
Expand Down Expand Up @@ -200,6 +201,7 @@ impl<Item: Task> Tasks<Item> 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<AtomicUsize>,
Expand Down
23 changes: 1 addition & 22 deletions zcash_client_sqlite/src/wallet/scanning.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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,
};

Expand Down Expand Up @@ -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<commitment_tree::Error>) -> Self;
}

impl WalletError for SqliteClientError {
Expand All @@ -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<commitment_tree::Error>) -> Self {
SqliteClientError::CommitmentTree(err)
}
}

impl WalletError for WalletMigrationError {
Expand All @@ -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<commitment_tree::Error>) -> Self {
WalletMigrationError::CommitmentTree(err)
}
}

pub(crate) fn replace_queue_entries<E: WalletError>(
Expand Down

0 comments on commit 155c56e

Please sign in to comment.