Skip to content
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

refactor(gossipsub): use dummy handler instead of calling new_handler #3384

Merged
merged 2 commits into from
Jan 25, 2023

Conversation

thomaseizinger
Copy link
Contributor

Description

The gossipsub tests are calling lifecycle functions of the NetworkBehaviour that aren't meant to be called outside of Swarm. This already surfaced as a problem in #3327 and it is coming up again in #3254 where new_handler gets deprecated.

Try to mitigate that by constructing a dummy handler instead. Functionally, there is no difference as in both cases, the given handler has never seen a connection.

Notes

Links to any relevant issues

Open Questions

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • A changelog entry has been made in the appropriate crates

@mergify mergify bot merged commit a25ab7e into master Jan 25, 2023
@mergify mergify bot deleted the feat/gossipsub-dummy-handler branch January 25, 2023 11:51
jxs pushed a commit to jxs/rust-libp2p that referenced this pull request Jan 25, 2023
…r` (libp2p#3384)

The gossipsub tests are calling lifecycle functions of the `NetworkBehaviour` that aren't meant to be called outside of `Swarm`. This already surfaced as a problem in libp2p#3327 and it is coming up again in libp2p#3254 where `new_handler` gets deprecated.

Try to mitigate that by constructing a dummy handler instead. Functionally, there is no difference as in both cases, the given handler has never seen a connection.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants