Skip to content

Commit d6b4821

Browse files
committed
SupportedChannelTypes moved back to mining handlers
1 parent 36a5e6d commit d6b4821

File tree

9 files changed

+20
-27
lines changed

9 files changed

+20
-27
lines changed

protocols/v2/roles-logic-sv2/src/handlers/mining.rs

+11-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ use crate::{
4444
selectors::DownstreamMiningSelector,
4545
};
4646

47-
use super::{SendTo_, SupportedChannelTypes};
47+
use super::SendTo_;
4848

4949
use crate::utils::Mutex;
5050
use const_sv2::*;
@@ -54,6 +54,16 @@ use tracing::{debug, error, info, trace};
5454
/// see [`SendTo_`]
5555
pub type SendTo<Remote> = SendTo_<Mining<'static>, Remote>;
5656

57+
/// Represents supported channel types in a mining connection.
58+
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
59+
pub enum SupportedChannelTypes {
60+
Standard,
61+
Extended,
62+
Group,
63+
/// Represents a connection that supports both group and extended channels.
64+
GroupAndExtended,
65+
}
66+
5767
/// Trait for parsing downstream mining messages in a Stratum V2 connection.
5868
///
5969
/// This trait defines methods for parsing and routing downstream messages

protocols/v2/roles-logic-sv2/src/handlers/mod.rs

-10
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,3 @@ impl<SubProtocol, Remote> SendTo_<SubProtocol, Remote> {
8383
}
8484
}
8585
}
86-
87-
/// Represents supported channel types in a mining connection.
88-
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
89-
pub enum SupportedChannelTypes {
90-
Standard,
91-
Extended,
92-
Group,
93-
/// Represents a connection that supports both group and extended channels.
94-
GroupAndExtended,
95-
}

roles/jd-client/src/lib/downstream.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ use roles_logic_sv2::{
1313
errors::Error,
1414
handlers::{
1515
common::{ParseCommonMessagesFromDownstream, SendTo as SendToCommon},
16-
mining::{ParseMiningMessagesFromDownstream, SendTo},
17-
SupportedChannelTypes,
16+
mining::{ParseMiningMessagesFromDownstream, SendTo, SupportedChannelTypes},
1817
},
1918
job_creator::JobsCreators,
2019
mining_sv2::*,

roles/jd-client/src/lib/upstream_sv2/upstream.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ use tokio::{net::TcpStream, task, task::AbortHandle};
3636
use tracing::{error, info, warn};
3737

3838
use roles_logic_sv2::{
39-
common_messages_sv2::Reconnect, handlers::SupportedChannelTypes, mining_sv2::SetGroupChannel,
39+
common_messages_sv2::Reconnect, handlers::mining::SupportedChannelTypes,
40+
mining_sv2::SetGroupChannel,
4041
};
4142
use std::collections::VecDeque;
4243

roles/mining-proxy/src/lib/downstream_mining.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ use roles_logic_sv2::{
1313
errors::Error,
1414
handlers::{
1515
common::{ParseCommonMessagesFromDownstream, SendTo as SendToCommon},
16-
mining::{ParseMiningMessagesFromDownstream, SendTo},
17-
SupportedChannelTypes,
16+
mining::{ParseMiningMessagesFromDownstream, SendTo, SupportedChannelTypes},
1817
},
1918
mining_sv2::*,
2019
parsers::{AnyMessage, Mining, MiningDeviceMessages},

roles/mining-proxy/src/lib/upstream_mining.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@ use roles_logic_sv2::{
2525
IsMiningDownstream, IsMiningUpstream, IsUpstream, RequestIdMapper, UpstreamChannel,
2626
},
2727
errors::Error,
28-
handlers::{
29-
mining::{ParseMiningMessagesFromUpstream, SendTo},
30-
SupportedChannelTypes,
31-
},
28+
handlers::mining::{ParseMiningMessagesFromUpstream, SendTo, SupportedChannelTypes},
3229
job_dispatcher::GroupChannelJobDispatcher,
3330
mining_sv2::*,
3431
parsers::{AnyMessage, CommonMessages, Mining, MiningDeviceMessages},

roles/pool/src/lib/mining_pool/message_handler.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@ use super::super::mining_pool::Downstream;
22
use binary_sv2::Str0255;
33
use roles_logic_sv2::{
44
errors::Error,
5-
handlers::{
6-
mining::{ParseMiningMessagesFromDownstream, SendTo},
7-
SupportedChannelTypes,
8-
},
5+
handlers::mining::{ParseMiningMessagesFromDownstream, SendTo, SupportedChannelTypes},
96
mining_sv2::*,
107
parsers::Mining,
118
routing_logic::NoRouting,

roles/test-utils/mining-device/src/lib/mod.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ use roles_logic_sv2::{
1212
errors::Error,
1313
handlers::{
1414
common::ParseCommonMessagesFromUpstream,
15-
mining::{ParseMiningMessagesFromUpstream, SendTo},
16-
SupportedChannelTypes,
15+
mining::{ParseMiningMessagesFromUpstream, SendTo, SupportedChannelTypes},
1716
},
1817
mining_sv2::*,
1918
parsers::{Mining, MiningDeviceMessages},

roles/translator/src/lib/upstream_sv2/upstream.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ use tokio::{
4444
use tracing::{error, info, warn};
4545

4646
use roles_logic_sv2::{
47-
common_messages_sv2::Reconnect, handlers::SupportedChannelTypes, mining_sv2::SetGroupChannel,
47+
common_messages_sv2::Reconnect, handlers::mining::SupportedChannelTypes,
48+
mining_sv2::SetGroupChannel,
4849
};
4950
use stratum_common::bitcoin::BlockHash;
5051

0 commit comments

Comments
 (0)