Skip to content

Commit

Permalink
use Sniffer::wait_for_message_count on tproxy test..
Browse files Browse the repository at this point in the history
WARNING: this commit is just to illustrate how to unblock stratum-mining#1262

DO NOT CHERRY PICK, we still need to fix unnecessary JDC logic
  • Loading branch information
plebhash committed Dec 10, 2024
1 parent 6e8db7d commit 72fa08f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions roles/tests-integration/tests/pool_integration.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
mod common;

use std::{convert::TryInto, time::Duration};
use std::convert::TryInto;

use common::{InterceptMessage, MessageDirection};
use const_sv2::MESSAGE_TYPE_SETUP_CONNECTION_ERROR;
use roles_logic_sv2::{
common_messages_sv2::{Protocol, SetupConnection, SetupConnectionError},
parsers::{CommonMessages, Mining, PoolMessages, TemplateDistribution},
};
use tokio::time::sleep;

// This test starts a Template Provider and a Pool, and checks if they exchange the correct
// messages upon connection.
Expand Down Expand Up @@ -118,7 +117,9 @@ async fn translation_proxy() {
let jdc_addr = common::start_jdc(pool_jdc_sniffer_addr, tp_addr, jds_addr).await;
let mining_proxy_addr = common::start_sv2_translator(jdc_addr).await;
let _ = common::start_mining_device_sv1(mining_proxy_addr).await;
sleep(Duration::from_secs(3)).await;

// todo: fix the unecessary jdc logic
pool_jdc_sniffer.wait_for_message_count(MessageDirection::ToUpstream, 4).await;

assert_common_message!(
&pool_jdc_sniffer.next_message_from_downstream(),
Expand Down

0 comments on commit 72fa08f

Please sign in to comment.