diff --git a/polkadot/node/network/statement-distribution/src/v2/tests/grid.rs b/polkadot/node/network/statement-distribution/src/v2/tests/grid.rs index afd89beecfc1..c8a62a432d66 100644 --- a/polkadot/node/network/statement-distribution/src/v2/tests/grid.rs +++ b/polkadot/node/network/statement-distribution/src/v2/tests/grid.rs @@ -794,7 +794,7 @@ fn received_acknowledgements_for_locally_confirmed() { ) .clone(); - share_statement(&mut overseer, relay_parent, statement).await; + send_share_message(&mut overseer, relay_parent, statement).await; assert_matches!( overseer.recv().await, @@ -836,8 +836,9 @@ fn received_acknowledgements_for_locally_confirmed() { // Send Backed notification. { - back_candidate(&mut overseer, candidate_hash).await; + send_backed_message(&mut overseer, candidate_hash).await; + // We should send out a manifest. assert_matches!( overseer.recv().await, AllMessages:: NetworkBridgeTx( @@ -879,6 +880,9 @@ fn received_acknowledgements_for_locally_confirmed() { // It's OK, we know they know it because we sent them a manifest. send_ack_from_peer(&mut overseer, peer_c, ack.clone()).await; + // What happens if we get another valid ack? + send_ack_from_peer(&mut overseer, peer_c, ack.clone()).await; + overseer }); } diff --git a/polkadot/node/network/statement-distribution/src/v2/tests/mod.rs b/polkadot/node/network/statement-distribution/src/v2/tests/mod.rs index 0c32c97e467d..a2f9e8668c3d 100644 --- a/polkadot/node/network/statement-distribution/src/v2/tests/mod.rs +++ b/polkadot/node/network/statement-distribution/src/v2/tests/mod.rs @@ -651,7 +651,7 @@ async fn assert_peer_reported( ); } -async fn share_statement( +async fn send_share_message( virtual_overseer: &mut VirtualOverseer, relay_parent: Hash, statement: SignedFullStatementWithPVD, @@ -663,7 +663,10 @@ async fn share_statement( .await; } -async fn back_candidate(virtual_overseer: &mut VirtualOverseer, candidate_hash: CandidateHash) { +async fn send_backed_message( + virtual_overseer: &mut VirtualOverseer, + candidate_hash: CandidateHash, +) { virtual_overseer .send(FromOrchestra::Communication { msg: StatementDistributionMessage::Backed(candidate_hash),