Skip to content

Commit

Permalink
Test receiving another valid ack
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcnski committed Nov 26, 2023
1 parent c60465e commit d8d5bfa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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),
Expand Down

0 comments on commit d8d5bfa

Please sign in to comment.