fix: Remove some dead code lints

This commit is contained in:
teor 2020-07-21 14:09:19 +10:00
parent 89ac2793d6
commit e75697300b
2 changed files with 9 additions and 19 deletions

View File

@ -133,10 +133,8 @@ where
/// them to `init_from_verifiers`. /// them to `init_from_verifiers`.
// //
// TODO: revise this interface when we generate our own blocks, or validate // TODO: revise this interface when we generate our own blocks, or validate
// mempool transactions. // mempool transactions. We might want to share the BlockVerifier, and we
// // might not want to add generated blocks to the state.
// Only used by tests and other modules
#[allow(dead_code)]
pub fn init<S>( pub fn init<S>(
network: Network, network: Network,
state_service: S, state_service: S,
@ -176,9 +174,6 @@ where
/// verifiers (and the result be shared, cloning if needed). Constructing /// verifiers (and the result be shared, cloning if needed). Constructing
/// multiple services from the same underlying state might cause synchronisation /// multiple services from the same underlying state might cause synchronisation
/// bugs. /// bugs.
//
// Only used by tests and other modules
#[allow(dead_code)]
pub fn init_from_verifiers<BV, S>( pub fn init_from_verifiers<BV, S>(
block_verifier: BV, block_verifier: BV,
// We use an explcit type, so callers can't accidentally swap the verifiers // We use an explcit type, so callers can't accidentally swap the verifiers

View File

@ -117,11 +117,6 @@ impl CheckpointVerifier {
/// than constructing multiple verification services for the same network. To /// than constructing multiple verification services for the same network. To
/// Clone a CheckpointVerifier, you might need to wrap it in a /// Clone a CheckpointVerifier, you might need to wrap it in a
/// `tower::Buffer` service. /// `tower::Buffer` service.
//
// Avoid some dead code lints.
// Until we implement the overall verifier in #516, this function, and some of the
// functions and enum variants it uses, are only used in the tests.
#[allow(dead_code)]
pub fn new(network: Network) -> Self { pub fn new(network: Network) -> Self {
Self::from_checkpoint_list(CheckpointList::new(network)) Self::from_checkpoint_list(CheckpointList::new(network))
} }
@ -130,12 +125,11 @@ impl CheckpointVerifier {
/// ///
/// Assumes that the provided genesis checkpoint is correct. /// Assumes that the provided genesis checkpoint is correct.
/// ///
/// See `CheckpointVerifier::new` and `CheckpointList::from_list` for more /// Callers should prefer `CheckpointVerifier::new`, which uses the
/// details. /// hard-coded checkpoint lists. See `CheckpointVerifier::new` and
/// `CheckpointList::from_list` for more details.
// //
// Avoid some dead code lints. // This function is designed for use in tests.
// Until we implement the overall verifier in #516, this function, and some of the
// functions and enum variants it uses, are only used in the tests.
#[allow(dead_code)] #[allow(dead_code)]
pub(crate) fn from_list( pub(crate) fn from_list(
list: impl IntoIterator<Item = (BlockHeight, BlockHeaderHash)>, list: impl IntoIterator<Item = (BlockHeight, BlockHeaderHash)>,
@ -145,8 +139,9 @@ impl CheckpointVerifier {
/// Return a checkpoint verification service using `checkpoint_list`. /// Return a checkpoint verification service using `checkpoint_list`.
/// ///
/// See `CheckpointVerifier::new` and `CheckpointList::from_list` for more /// Callers should prefer `CheckpointVerifier::new`, which uses the
/// details. /// hard-coded checkpoint lists. See `CheckpointVerifier::new` and
/// `CheckpointList::from_list` for more details.
pub(crate) fn from_checkpoint_list(checkpoint_list: CheckpointList) -> Self { pub(crate) fn from_checkpoint_list(checkpoint_list: CheckpointList) -> Self {
// All the initialisers should call this function, so we only have to // All the initialisers should call this function, so we only have to
// change fields or default values in one place. // change fields or default values in one place.