Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into protobuf-gen
Browse files Browse the repository at this point in the history
  • Loading branch information
flcl42 committed Sep 8, 2024
2 parents 44cac51 + 036fea7 commit e504458
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,16 @@ public async Task Test_Peer_is_dialed_when_added_by_discovery()

TestDiscoveryProtocol discovery = new();
CancellationToken token = default;
TaskCompletionSource taskCompletionSource = new();

_ = router.RunAsync(peer, discovery, token: token);
discovery.OnAddPeer!([discoveredPeer]);

await Task.Delay(100);
_ = peer.Received().DialAsync(discoveredPeer, Arg.Any<CancellationToken>());

router.OutboundConnection(discoveredPeer, PubsubRouter.FloodsubProtocolVersion, Task.CompletedTask, (rpc) => { });
router.OutboundConnection(discoveredPeer, PubsubRouter.FloodsubProtocolVersion, taskCompletionSource.Task, (rpc) => { });
Assert.That(state.ConnectedPeers, Has.Member(peerId));
taskCompletionSource.SetResult();
}
}

0 comments on commit e504458

Please sign in to comment.