client/authority-discovery: Rework error handling (#5631)
* client/authority-discovery: Rework error handling Instead of `handle_dht_events` returning a `Result<(), Error>`, return a `Poll<Error>` where `Poll::Pending` signals that there are no more events to handle and `Poll::Ready(Error)` signals that a fatal error occured. Non fatal errors are handled within `handle_dht_events` directly, thus looping in `poll` is not necessary anymore. * client/authority-discovery: Return () instead of error on termiantion * Update client/authority-discovery/src/lib.rs Co-Authored-By:André Silva <123550+andresilva@users.noreply.github.com> Co-authored-by:
Bastian Köcher <bkchr@users.noreply.github.com> Co-authored-by:
André Silva <123550+andresilva@users.noreply.github.com>
Showing
- substrate/client/authority-discovery/src/error.rs 0 additions, 3 deletionssubstrate/client/authority-discovery/src/error.rs
- substrate/client/authority-discovery/src/lib.rs 60 additions, 52 deletionssubstrate/client/authority-discovery/src/lib.rs
- substrate/client/authority-discovery/src/tests.rs 8 additions, 4 deletionssubstrate/client/authority-discovery/src/tests.rs
Please register or sign in to comment