Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix cargo warnings in roles #1191

Merged
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
1 change: 1 addition & 0 deletions roles/jd-client/src/lib/downstream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ pub struct DownstreamMiningNode {
receiver: Receiver<EitherFrame>,
sender: Sender<EitherFrame>,
pub status: DownstreamMiningNodeStatus,
#[allow(dead_code)]
pub prev_job_id: Option<u32>,
solution_sender: Sender<SubmitSolution<'static>>,
withhold: bool,
Expand Down
2 changes: 2 additions & 0 deletions roles/jd-client/src/lib/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use stratum_common::bitcoin::util::uint::ParseLengthError;

pub type ProxyResult<'a, T> = core::result::Result<T, Error<'a>>;

#[allow(dead_code)]
#[derive(Debug)]
pub enum ChannelSendError<'a> {
SubmitSharesExtended(
Expand All @@ -28,6 +29,7 @@ pub enum ChannelSendError<'a> {

#[derive(Debug)]
pub enum Error<'a> {
#[allow(dead_code)]
VecToSlice32(Vec<u8>),
/// Errors on bad CLI argument input.
BadCliArgs,
Expand Down
1 change: 1 addition & 0 deletions roles/jd-client/src/lib/proxy_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ pub struct ProxyConfig {
pub cert_validity_sec: u64,
pub tp_address: String,
pub tp_authority_public_key: Option<Secp256k1PublicKey>,
#[allow(dead_code)]
pub retry: u32,
pub upstreams: Vec<Upstream>,
#[serde(deserialize_with = "duration_from_toml")]
Expand Down
8 changes: 0 additions & 8 deletions roles/jd-client/src/lib/upstream_sv2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,3 @@ pub use upstream::Upstream;
pub type Message = PoolMessages<'static>;
pub type StdFrame = StandardSv2Frame<Message>;
pub type EitherFrame = StandardEitherFrame<Message>;

#[derive(Clone, Copy, Debug)]
pub struct Sv2MiningConnection {
_version: u16,
_setup_connection_flags: u32,
#[allow(dead_code)]
setup_connection_success_flags: u32,
}
4 changes: 3 additions & 1 deletion roles/jd-client/src/lib/upstream_sv2/upstream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ pub struct Upstream {
tx_status: status::Sender,
/// Minimum `extranonce2` size. Initially requested in the `jdc-config.toml`, and ultimately
/// set by the SV2 Upstream via the SV2 `OpenExtendedMiningChannelSuccess` message.
#[allow(dead_code)]
pub min_extranonce_size: u16,
#[allow(dead_code)]
pub upstream_extranonce1_size: usize,
/// String be included in coinbase tx input scriptsig
pub pool_signature: String,
Expand Down Expand Up @@ -144,7 +146,7 @@ impl Upstream {
/// `UpstreamConnection` with a channel to send and receive messages from the SV2 Upstream
/// role and uses channels provided in the function arguments to send and receive messages
/// from the `Downstream`.
#[cfg_attr(feature = "cargo-clippy", allow(clippy::too_many_arguments))]
#[allow(clippy::too_many_arguments)]
pub async fn new(
address: SocketAddr,
authority_public_key: Secp256k1PublicKey,
Expand Down
1 change: 1 addition & 0 deletions roles/mining-proxy/src/lib/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ pub type EitherFrame = StandardEitherFrame<Message>;
#[derive(Debug)]
#[allow(clippy::large_enum_variant)]
#[allow(clippy::enum_variant_names)]
#[allow(dead_code)]
pub enum Error {
SendError(SendError<EitherFrame>),
UpstreamNotAvailabe(SocketAddr),
Expand Down
4 changes: 0 additions & 4 deletions roles/translator/src/lib/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,6 @@ impl TranslatorSv2 {
let _ =
task_collector.safe_lock(|t| t.push((task.abort_handle(), "init task".to_string())));
}

pub fn upstream_address(&self) -> SocketAddr {
self.config.upstream_address.clone().parse().unwrap()
}
}

fn kill_tasks(task_collector: Arc<Mutex<Vec<(AbortHandle, String)>>>) {
Expand Down
1 change: 1 addition & 0 deletions roles/translator/src/lib/proxy/bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,7 @@ mod test {
pub mod test_utils {
use super::*;

#[allow(dead_code)]
pub struct BridgeInterface {
pub tx_sv1_submit: Sender<DownstreamMessages>,
pub rx_sv2_submit_shares_ext: Receiver<SubmitSharesExtended<'static>>,
Expand Down
2 changes: 1 addition & 1 deletion roles/translator/src/lib/upstream_sv2/upstream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ impl Upstream {
/// `UpstreamConnection` with a channel to send and receive messages from the SV2 Upstream
/// role and uses channels provided in the function arguments to send and receive messages
/// from the `Downstream`.
#[cfg_attr(feature = "cargo-clippy", allow(clippy::too_many_arguments))]
#[allow(clippy::too_many_arguments)]
pub async fn new(
address: SocketAddr,
authority_public_key: Secp256k1PublicKey,
Expand Down
Loading