Skip to content
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
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions examples/mining-client-cpu-miner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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" }
integration_tests_sv2 = { git = "https://github.com/stratum-mining/stratum", branch = "v1.4.0" }
6 changes: 3 additions & 3 deletions examples/mining-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ 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"
serde = { version = "1.0", features = ["derive"] }
dashmap = "6.1.0"

[dev-dependencies]
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" }
2 changes: 1 addition & 1 deletion examples/mining-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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}");
}
});

Expand Down
4 changes: 2 additions & 2 deletions examples/sibling-io-communication/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
6 changes: 3 additions & 3 deletions examples/template-distribution-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ 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"
serde = { version = "1.0", features = ["derive"] }


[dev-dependencies]
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" }
12 changes: 5 additions & 7 deletions src/client/service/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
9 changes: 3 additions & 6 deletions src/client/service/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
))
})
};
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
11 changes: 4 additions & 7 deletions src/server/service/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand All @@ -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"),
}
}
Expand Down
Loading