Switch to new light client protocol (#5472)

* Switch to the new protocol

* Oops, forgot to remove light_dispatch.rs

* Fix tests

* Address review
This commit is contained in:
Pierre Krieger
2020-04-01 19:44:42 +02:00
committed by GitHub
parent c4aa597516
commit a8aedfa16f
7 changed files with 482 additions and 1683 deletions
+3 -1
View File
@@ -133,7 +133,6 @@ impl<B: BlockT, H: ExHashT> Behaviour<B, H> {
}
/// Issue a light client request.
#[allow(unused)]
pub fn light_client_request(&mut self, r: light_client_handler::Request<B>) -> Result<(), light_client_handler::Error> {
self.light_client_handler.request(r)
}
@@ -175,6 +174,9 @@ Behaviour<B, H> {
let ev = Event::NotificationsReceived { remote, messages };
self.events.push(BehaviourOut::Event(ev));
},
CustomMessageOutcome::PeerNewBest(peer_id, number) => {
self.light_client_handler.update_best_block(&peer_id, number);
}
CustomMessageOutcome::None => {}
}
}