-
Notifications
You must be signed in to change notification settings - Fork 942
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: make runtime features optional in swarm-test #5551
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! LGTM overall, just left a couple of questions
where | ||
Self: Sized, | ||
{ | ||
use libp2p_core::{transport::MemoryTransport, upgrade::Version, Transport as _}; | ||
use libp2p_identity::Keypair; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as the question above, why is the Keypair
import moved from the top of the file to duplicated here and in the tokio
case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When both async-std
and tokio
runtimes are disabled, top-level import of Keypair
is unused and leads to clippy warnings
use libp2p_swarm::dial_opts::PeerCondition; | ||
use libp2p_swarm::{self as swarm, dial_opts::DialOpts, NetworkBehaviour, Swarm, SwarmEvent}; | ||
use libp2p_yamux as yamux; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we maintain these imports and renames?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same, these imports are only used in fn new_ephemeral
and fn new_ephemeral_tokio
. Disabling both runtime features would cause clippy warnings of used imports
Description
Sometimes a test uses custom swarm building logic and doesn't need
fn new_ephemeral
, and sometimes a test usestokio
runtime other thanasync-std
.This PR adds the
tokio
runtime support and makes bothasync-std
andtokio
runtimes optional behind features to make it more flexible.Notes & open questions
Change checklist