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

feat(p2p): use libp2p::swarm::toggle for optional mdns/relay #295

Merged
merged 1 commit into from
Jan 12, 2022

Conversation

elenaf9
Copy link
Contributor

@elenaf9 elenaf9 commented Nov 28, 2021

Description of change

Use the libp2p::swarm::toggle::Toggle for optional network behaviour protocols Mdns and Relay.

Type of change

  • Bug fix (a non-breaking change which fixes an issue)
  • Enhancement (a non-breaking change which adds functionality)

How the change has been tested

Tested via existing tests.

Change checklist

  • I have followed the contribution guidelines for this project
  • I have performed a self-review of my own code
  • New and existing unit tests pass locally with my changes

@elenaf9 elenaf9 requested a review from felsweg-iota November 29, 2021 10:29
@elenaf9 elenaf9 force-pushed the p2p/use-toggle-behaviour branch from 1c9bfc3 to 987bce9 Compare December 17, 2021 13:13
self.relay.as_mut().unwrap().inject_event(peer, connection, ev)
}
EitherOutput::First(ev) => self.handle_handler_event(peer, connection, ev),
EitherOutput::Second(EitherOutput::First(ev)) => self.mdns.inject_event(peer, connection, ev),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this definitely improves readability!

Copy link
Contributor

@felsweg-iota felsweg-iota left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants