From e3de64d5ff1eeebdb8ccc5464fe40b1c6fcd2922 Mon Sep 17 00:00:00 2001 From: Luke Parker Date: Mon, 24 Jul 2023 22:11:58 -0400 Subject: [PATCH] Check the processors picked up the received input --- tests/processor/src/tests/scan.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/processor/src/tests/scan.rs b/tests/processor/src/tests/scan.rs index 28b2b011..b2e7ad6d 100644 --- a/tests/processor/src/tests/scan.rs +++ b/tests/processor/src/tests/scan.rs @@ -39,6 +39,7 @@ fn scan_test() { } } + // Send into the processor's wallet let mut wallet = Wallet::new(network, &ops, coordinators[0].network_handle.clone()).await; coordinators[0].sync(&ops, &coordinators[1 ..]).await; let tx = wallet.send_to_address(&ops, &key_pair.1).await; @@ -46,6 +47,7 @@ fn scan_test() { coordinator.publish_transacton(&ops, &tx).await; } + // Put the TX past the confirmation depth for _ in 0 .. confirmations(network) { let block = coordinators[0].add_block(&ops).await; for coordinator in &coordinators[1 ..] { @@ -54,6 +56,20 @@ fn scan_test() { } tokio::time::sleep(core::time::Duration::from_secs(10)).await; + + // Make sure the coordinators picked it up by checking they're trying to sign a batch for it + for coordinator in &mut coordinators { + let msg = coordinator.recv_message().await; + match msg { + messages::ProcessorMessage::Coordinator( + messages::coordinator::ProcessorMessage::BatchPreprocess { id, .. }, + ) => { + assert_eq!(&id.key, &key_pair.0 .0); + assert_eq!(id.attempt, 0); + } + _ => panic!("processor didn't send batch preprocess"), + } + } }); } }