Skip to content

Commit

Permalink
Remove replacement_mesage_type as it can be ..
Browse files Browse the repository at this point in the history
extracted from `replacement_message` if `IsSv2Message` trait is
imported.
  • Loading branch information
jbesraa committed Jan 21, 2025
1 parent 4190257 commit e2e0144
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
9 changes: 3 additions & 6 deletions roles/tests-integration/lib/sniffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use key_utils::{Secp256k1PublicKey, Secp256k1SecretKey};
use network_helpers_sv2::noise_connection_tokio::Connection;
use roles_logic_sv2::{
parsers::{
AnyMessage, CommonMessages,
AnyMessage, CommonMessages, IsSv2Message,
JobDeclaration::{
AllocateMiningJobToken, AllocateMiningJobTokenSuccess, DeclareMiningJob,
DeclareMiningJobError, DeclareMiningJobSuccess, IdentifyTransactions,
Expand Down Expand Up @@ -70,7 +70,6 @@ pub struct InterceptMessage {
direction: MessageDirection,
expected_message_type: MsgType,
response_message: PoolMessages<'static>,
response_message_type: MsgType,
break_on: bool,
}

Expand All @@ -79,14 +78,12 @@ impl InterceptMessage {
direction: MessageDirection,
expected_message_type: MsgType,
response_message: PoolMessages<'static>,
response_message_type: MsgType,
break_on: bool,
) -> Self {
Self {
direction,
expected_message_type,
response_message,
response_message_type,
break_on,
}
}
Expand Down Expand Up @@ -235,7 +232,7 @@ impl Sniffer {
let frame = StandardEitherFrame::<AnyMessage<'_>>::Sv2(
Sv2Frame::from_message(
intercept_message.response_message.clone(),
intercept_message.response_message_type,
intercept_message.response_message.message_type(),
extension_type,
channel_msg,
)
Expand Down Expand Up @@ -277,7 +274,7 @@ impl Sniffer {
let frame = StandardEitherFrame::<AnyMessage<'_>>::Sv2(
Sv2Frame::from_message(
intercept_message.response_message.clone(),
intercept_message.response_message_type,
intercept_message.response_message.message_type(),
extension_type,
channel_msg,
)
Expand Down
6 changes: 1 addition & 5 deletions roles/tests-integration/tests/sniffer_integration.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
use const_sv2::{
MESSAGE_TYPE_SETUP_CONNECTION_ERROR, MESSAGE_TYPE_SETUP_CONNECTION_SUCCESS,
MESSAGE_TYPE_SET_NEW_PREV_HASH,
};
use const_sv2::{MESSAGE_TYPE_SETUP_CONNECTION_SUCCESS, MESSAGE_TYPE_SET_NEW_PREV_HASH};
use integration_tests_sv2::*;
use roles_logic_sv2::{
common_messages_sv2::SetupConnectionError,
Expand All @@ -26,7 +23,6 @@ async fn test_sniffer_interrupter() {
MessageDirection::ToDownstream,
MESSAGE_TYPE_SETUP_CONNECTION_SUCCESS,
message,
MESSAGE_TYPE_SETUP_CONNECTION_ERROR,
true,
);
let (sniffer, sniffer_addr) =
Expand Down

0 comments on commit e2e0144

Please sign in to comment.