Skip to content

Commit

Permalink
refactor(tests_integration): borrow member instead of destructing struct
Browse files Browse the repository at this point in the history
  • Loading branch information
yair-starkware committed Nov 21, 2024
1 parent ab6c9b6 commit 2844be9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions crates/starknet_integration_tests/tests/end_to_end_flow_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ async fn end_to_end(tx_generator: MultiAccountTransactionGenerator) {
const LISTEN_TO_BROADCAST_MESSAGES_TIMEOUT: std::time::Duration =
std::time::Duration::from_secs(5);
// Setup.
let mock_running_system = FlowTestSetup::new_from_tx_generator(&tx_generator).await;
let mut mock_running_system = FlowTestSetup::new_from_tx_generator(&tx_generator).await;

// Create and send transactions.
let expected_batched_tx_hashes = run_integration_test_scenario(tx_generator, &mut |tx| {
Expand All @@ -39,7 +39,7 @@ async fn end_to_end(tx_generator: MultiAccountTransactionGenerator) {
tokio::time::timeout(
LISTEN_TO_BROADCAST_MESSAGES_TIMEOUT,
listen_to_broadcasted_messages(
mock_running_system.consensus_proposals_channels,
&mut mock_running_system.consensus_proposals_channels,
&expected_batched_tx_hashes,
),
)
Expand All @@ -48,12 +48,12 @@ async fn end_to_end(tx_generator: MultiAccountTransactionGenerator) {
}

async fn listen_to_broadcasted_messages(
consensus_proposals_channels: BroadcastTopicChannels<ProposalPart>,
consensus_proposals_channels: &mut BroadcastTopicChannels<ProposalPart>,
expected_batched_tx_hashes: &[TransactionHash],
) {
let chain_id = CHAIN_ID_FOR_TESTS.clone();
let mut broadcasted_messages_receiver =
consensus_proposals_channels.broadcasted_messages_receiver;
let broadcasted_messages_receiver =
&mut consensus_proposals_channels.broadcasted_messages_receiver;
let mut received_tx_hashes = HashSet::new();
// TODO (Dan, Guy): retrieve / calculate the expected proposal init and fin.
let expected_proposal_init = ProposalInit {
Expand Down

0 comments on commit 2844be9

Please sign in to comment.