diff --git a/Cargo.toml b/Cargo.toml index 6bfad74..a30c479 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,12 +23,12 @@ secp256k1 = { version = "0.28.2", default-features = false } dashmap = "6.1.0" # SRI -stratum-common = { git = "https://github.com/stratum-mining/stratum", branch = "main", features = ["with_network_helpers"]} -key-utils = { git = "https://github.com/stratum-mining/stratum", branch = "main" } +stratum-common = { git = "https://github.com/stratum-mining/stratum", branch = "v1.4.0", features = ["with_network_helpers"]} +key-utils = { git = "https://github.com/stratum-mining/stratum", branch = "v1.4.0" } [dev-dependencies] once_cell = "1.19.0" -integration_tests_sv2 = { git = "https://github.com/stratum-mining/stratum", branch = "main" } +integration_tests_sv2 = { git = "https://github.com/stratum-mining/stratum", branch = "v1.4.0" } hex = "0.4.3" # tokio debugging diff --git a/examples/mining-client-cpu-miner/Cargo.toml b/examples/mining-client-cpu-miner/Cargo.toml index 81d0299..d0dc57b 100644 --- a/examples/mining-client-cpu-miner/Cargo.toml +++ b/examples/mining-client-cpu-miner/Cargo.toml @@ -10,8 +10,8 @@ tokio-util = "0.7.15" tracing = "0.1" hex = "0.4.3" tracing-subscriber = "0.3.19" -stratum-common = { git = "https://github.com/stratum-mining/stratum", branch = "main" } -key-utils = { git = "https://github.com/stratum-mining/stratum", branch = "main" } +stratum-common = { git = "https://github.com/stratum-mining/stratum", branch = "v1.4.0" } +key-utils = { git = "https://github.com/stratum-mining/stratum", branch = "v1.4.0" } anyhow = "1.0" clap = { version = "4.4", features = ["derive"] } toml = "0.8" @@ -21,4 +21,4 @@ bitcoin = "0.32.5" dashmap = "6.1.0" [dev-dependencies] -integration_tests_sv2 = { git = "https://github.com/stratum-mining/stratum", branch = "main" } \ No newline at end of file +integration_tests_sv2 = { git = "https://github.com/stratum-mining/stratum", branch = "v1.4.0" } \ No newline at end of file diff --git a/examples/mining-server/Cargo.toml b/examples/mining-server/Cargo.toml index d5196b3..04eab41 100644 --- a/examples/mining-server/Cargo.toml +++ b/examples/mining-server/Cargo.toml @@ -11,8 +11,8 @@ tracing = "0.1" hex = "0.4.3" tracing-subscriber = "0.3.19" tower = { version = "0.4", features = ["util"] } -stratum-common = { git = "https://github.com/stratum-mining/stratum", branch = "main" } -key-utils = { git = "https://github.com/stratum-mining/stratum", branch = "main" } +stratum-common = { git = "https://github.com/stratum-mining/stratum", branch = "v1.4.0" } +key-utils = { git = "https://github.com/stratum-mining/stratum", branch = "v1.4.0" } anyhow = "1.0" clap = { version = "4.4", features = ["derive"] } toml = "0.8" @@ -20,4 +20,4 @@ serde = { version = "1.0", features = ["derive"] } dashmap = "6.1.0" [dev-dependencies] -integration_tests_sv2 = { git = "https://github.com/stratum-mining/stratum", branch = "main" } \ No newline at end of file +integration_tests_sv2 = { git = "https://github.com/stratum-mining/stratum", branch = "v1.4.0" } \ No newline at end of file diff --git a/examples/mining-server/src/main.rs b/examples/mining-server/src/main.rs index fd59238..e14e15b 100644 --- a/examples/mining-server/src/main.rs +++ b/examples/mining-server/src/main.rs @@ -77,7 +77,7 @@ mod tests { let mut server_clone = server.clone(); tokio::spawn(async move { if let Err(e) = server_clone.start().await { - eprintln!("Server error: {}", e); + eprintln!("Server error: {e}"); } }); diff --git a/examples/sibling-io-communication/Cargo.toml b/examples/sibling-io-communication/Cargo.toml index 122f81a..7899598 100644 --- a/examples/sibling-io-communication/Cargo.toml +++ b/examples/sibling-io-communication/Cargo.toml @@ -9,7 +9,7 @@ tokio = { version = "1", features = ["full"] } tokio-util = "0.7.15" anyhow = "1.0.98" tracing = "0.1.41" -stratum-common = { git = "https://github.com/stratum-mining/stratum", branch = "main" } +stratum-common = { git = "https://github.com/stratum-mining/stratum", branch = "v1.4.0" } hex = "0.4.3" tracing-subscriber = "0.3.19" -integration_tests_sv2 = { git = "https://github.com/stratum-mining/stratum", branch = "main" } +integration_tests_sv2 = { git = "https://github.com/stratum-mining/stratum", branch = "v1.4.0" } diff --git a/examples/template-distribution-client/Cargo.toml b/examples/template-distribution-client/Cargo.toml index 77e15a8..0691387 100644 --- a/examples/template-distribution-client/Cargo.toml +++ b/examples/template-distribution-client/Cargo.toml @@ -10,8 +10,8 @@ tokio-util = "0.7.15" tracing = "0.1" tracing-subscriber = "0.3.19" tower = { version = "0.4", features = ["util"] } -stratum-common = { git = "https://github.com/stratum-mining/stratum", branch = "main" } -key-utils = { git = "https://github.com/stratum-mining/stratum", branch = "main" } +stratum-common = { git = "https://github.com/stratum-mining/stratum", branch = "v1.4.0" } +key-utils = { git = "https://github.com/stratum-mining/stratum", branch = "v1.4.0" } anyhow = "1.0" clap = { version = "4.4", features = ["derive"] } toml = "0.8" @@ -19,4 +19,4 @@ serde = { version = "1.0", features = ["derive"] } [dev-dependencies] -integration_tests_sv2 = { git = "https://github.com/stratum-mining/stratum", branch = "main" } \ No newline at end of file +integration_tests_sv2 = { git = "https://github.com/stratum-mining/stratum", branch = "v1.4.0" } \ No newline at end of file diff --git a/src/client/service/error.rs b/src/client/service/error.rs index a757d2a..c370ae2 100644 --- a/src/client/service/error.rs +++ b/src/client/service/error.rs @@ -21,16 +21,14 @@ impl fmt::Display for Sv2ClientServiceError { Sv2ClientServiceError::IsNotConnected => write!(f, "Is not connected"), Sv2ClientServiceError::BadConfig => write!(f, "Bad config"), Sv2ClientServiceError::NullHandlerForSupportedProtocol { protocol } => { - write!(f, "Null handler for supported protocol {:?}", protocol) + write!(f, "Null handler for supported protocol {protocol:?}") + } + Sv2ClientServiceError::NonNullHandlerForUnsupportedProtocol { protocol } => { + write!(f, "Non-null handler for unsupported protocol {protocol:?}") } - Sv2ClientServiceError::NonNullHandlerForUnsupportedProtocol { protocol } => write!( - f, - "Non-null handler for unsupported protocol {:?}", - protocol - ), Sv2ClientServiceError::ServiceNotReady => write!(f, "Service not ready"), Sv2ClientServiceError::FailedToInitiateConnection { protocol } => { - write!(f, "Failed to initiate connection with {:?}", protocol) + write!(f, "Failed to initiate connection with {protocol:?}") } Sv2ClientServiceError::FailedToStartMiningHandler => { write!(f, "Failed to start mining handler") diff --git a/src/client/service/mod.rs b/src/client/service/mod.rs index 8cec816..055d338 100644 --- a/src/client/service/mod.rs +++ b/src/client/service/mod.rs @@ -464,8 +464,7 @@ where let to_str0_255 = |s: String, field: &str| { s.clone().into_bytes().try_into().map_err(|_| { RequestToSv2ClientError::StringConversionError(format!( - "Failed to convert {} '{}' to fixed-size array", - field, s + "Failed to convert {field} '{s}' to fixed-size array" )) }) }; @@ -1019,8 +1018,7 @@ where .try_into() .map_err(|_| { RequestToSv2ClientError::StringConversionError(format!( - "Failed to convert user_identity '{}' to fixed-size array", - user_identity + "Failed to convert user_identity '{user_identity}' to fixed-size array" )) })?, nominal_hash_rate, @@ -1069,8 +1067,7 @@ where .try_into() .map_err(|_| { RequestToSv2ClientError::StringConversionError(format!( - "Failed to convert user_identity '{}' to fixed-size array", - user_identity, + "Failed to convert user_identity '{user_identity}' to fixed-size array", )) })?, nominal_hash_rate, diff --git a/src/server/service/error.rs b/src/server/service/error.rs index 5c867fe..55c5e55 100644 --- a/src/server/service/error.rs +++ b/src/server/service/error.rs @@ -38,22 +38,19 @@ impl fmt::Display for Sv2ServerServiceError { Sv2ServerServiceError::NullHandlerForSupportedProtocol { protocol } => { write!( f, - "Protocol {:?} is supported but a null handler was provided", - protocol + "Protocol {protocol:?} is supported but a null handler was provided" ) } Sv2ServerServiceError::NonNullHandlerForUnsupportedProtocol { protocol } => { write!( f, - "Protocol {:?} is not supported but a non-null handler was provided", - protocol + "Protocol {protocol:?} is not supported but a non-null handler was provided" ) } Sv2ServerServiceError::MissingConfigForSupportedProtocol { protocol } => { write!( f, - "Protocol {:?} is supported but no config was provided", - protocol + "Protocol {protocol:?} is supported but no config was provided" ) } Sv2ServerServiceError::FailedToStartMiningHandler => { @@ -65,7 +62,7 @@ impl fmt::Display for Sv2ServerServiceError { // Sv2ServerServiceError::FailedToStartTemplateDistributionHandler => { // write!(f, "Failed to start template distribution handler") // } - Sv2ServerServiceError::Other(msg) => write!(f, "{}", msg), + Sv2ServerServiceError::Other(msg) => write!(f, "{msg}"), Sv2ServerServiceError::TcpServerError => write!(f, "TCP server failed to start"), } }