diff --git a/src/config.rs b/src/config.rs index e798186..c90ce29 100644 --- a/src/config.rs +++ b/src/config.rs @@ -202,7 +202,7 @@ pub fn init() -> Config { #[cfg(test)] mod test { - use crate::config::{BootNodes, ChainInclusionMode, Config}; + use crate::config::{BootNodes, Config}; use std::env; use std::str::FromStr; diff --git a/src/rules.rs b/src/rules.rs index 91f49ef..9ac8386 100644 --- a/src/rules.rs +++ b/src/rules.rs @@ -171,6 +171,9 @@ impl RuleContext { } } +#[cfg(test)] +use crate::storage::PremintStorage; + #[cfg(test)] impl RuleContext { pub async fn test_default() -> Self { @@ -482,8 +485,8 @@ mod test { } async fn simple_rule( - item: &PremintTypes, - context: &RuleContext, + _item: &PremintTypes, + _context: &RuleContext, ) -> eyre::Result { Ok(Accept) } @@ -546,7 +549,6 @@ mod test { #[tokio::test] async fn test_typed_rules_engine() { let (mut engine, storage) = test_rules_engine().await; - let context = RuleContext::test_default().await; let rule: Box> = typed_rule!(PremintTypes::Simple, simple_typed_rule); diff --git a/src/storage.rs b/src/storage.rs index ce5b8cf..389570a 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -334,7 +334,7 @@ mod test { use crate::storage::{ list_all, list_all_with_options, PremintStorage, QueryOptions, Reader, Writer, }; - use crate::types::{InclusionClaim, Premint, PremintTypes}; + use crate::types::{InclusionClaim, PremintTypes}; #[tokio::test] async fn test_insert_and_get() { diff --git a/tests/common/factories.rs b/tests/common/factories.rs index f0cdef1..e200390 100644 --- a/tests/common/factories.rs +++ b/tests/common/factories.rs @@ -1,4 +1,4 @@ -use alloy::primitives::{Address, U256}; +use alloy::primitives::Address; use mintpool::types::SimplePremint; use rand::{Rng, RngCore}; diff --git a/tests/common/mod.rs b/tests/common/mod.rs index 56cbc99..148f3a7 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -1,4 +1,6 @@ pub mod factories; + +#[allow(dead_code)] pub mod mintpool_build { use mintpool::config::Config; use mintpool::controller::{ControllerCommands, ControllerInterface}; @@ -105,6 +107,7 @@ pub mod mintpool_build { } } +#[allow(dead_code)] pub mod helpers { use mintpool::controller::ControllerCommands; use mintpool::types::PremintTypes; @@ -126,6 +129,7 @@ pub mod helpers { } } +#[allow(dead_code)] pub mod asserts { pub async fn expect_n_connections(ctl: &mintpool::controller::ControllerInterface, n: usize) { let state = ctl diff --git a/tests/e2e_test.rs b/tests/e2e_test.rs index f7b8c49..fbb02fe 100644 --- a/tests/e2e_test.rs +++ b/tests/e2e_test.rs @@ -14,7 +14,7 @@ use alloy::signers::wallet::LocalWallet; use alloy::signers::Signer; use alloy::sol_types::{SolCall, SolValue}; use alloy::transports::{RpcError, TransportErrorKind}; -use mintpool::config::{BootNodes, ChainInclusionMode, Config}; +use mintpool::config::{ChainInclusionMode, Config}; use mintpool::controller::{ControllerCommands, DBQuery}; use mintpool::premints::zora_premint::contract::IZoraPremintV2::MintArguments; use mintpool::premints::zora_premint::contract::{IZoraPremintV2, PREMINT_FACTORY_ADDR}; @@ -23,8 +23,6 @@ use mintpool::rules::RulesEngine; use mintpool::run; use mintpool::types::PremintTypes; use std::env; -use std::fmt::Debug; -use std::str::FromStr; use std::time::Duration; /// This test does the full round trip lifecycle of a premint diff --git a/tests/p2p_test.rs b/tests/p2p_test.rs index 2a9383a..e53d9b2 100644 --- a/tests/p2p_test.rs +++ b/tests/p2p_test.rs @@ -55,7 +55,7 @@ async fn test_list_all_premints() { let nodes = mintpool_build::gen_fully_connected_swarm(2310, num_nodes).await; let (first, nodes) = mintpool_build::split_first_rest(nodes).await; - let (snd, rcv) = tokio::sync::oneshot::channel(); + let (snd, _rcv) = tokio::sync::oneshot::channel(); first .send_command(Broadcast { message: PremintTypes::ZoraV2(Default::default()), @@ -63,7 +63,7 @@ async fn test_list_all_premints() { }) .await .unwrap(); - let (snd, rcv) = tokio::sync::oneshot::channel(); + let (snd, _rcv) = tokio::sync::oneshot::channel(); first .send_command(Broadcast {