mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-30 09:37:55 +00:00
Remove on_block_imported (#6039)
* remove on_block_imported * Update client/network/src/service.rs Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com> Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
This commit is contained in:
@@ -400,16 +400,18 @@ impl<B: BlockT + 'static, H: ExHashT> NetworkWorker<B, H> {
|
||||
&self.service
|
||||
}
|
||||
|
||||
/// You must call this when a new block is imported by the client.
|
||||
pub fn on_block_imported(&mut self, header: B::Header, is_best: bool) {
|
||||
self.network_service.user_protocol_mut().on_block_imported(&header, is_best);
|
||||
}
|
||||
|
||||
/// You must call this when a new block is finalized by the client.
|
||||
pub fn on_block_finalized(&mut self, hash: B::Hash, header: B::Header) {
|
||||
self.network_service.user_protocol_mut().on_block_finalized(hash, &header);
|
||||
}
|
||||
|
||||
/// This should be called when blocks are added to the
|
||||
/// chain by something other than the import queue.
|
||||
/// Currently this is only useful for tests.
|
||||
pub fn update_chain(&mut self) {
|
||||
self.network_service.user_protocol_mut().update_chain();
|
||||
}
|
||||
|
||||
/// Returns the local `PeerId`.
|
||||
pub fn local_peer_id(&self) -> &PeerId {
|
||||
Swarm::<B, H>::local_peer_id(&self.network_service)
|
||||
@@ -1349,7 +1351,7 @@ impl<'a, B: BlockT, H: ExHashT> Link<B> for NetworkLink<'a, B, H> {
|
||||
count: usize,
|
||||
results: Vec<(Result<BlockImportResult<NumberFor<B>>, BlockImportError>, B::Hash)>
|
||||
) {
|
||||
self.protocol.user_protocol_mut().blocks_processed(imported, count, results)
|
||||
self.protocol.user_protocol_mut().on_blocks_processed(imported, count, results)
|
||||
}
|
||||
fn justification_imported(&mut self, who: PeerId, hash: &B::Hash, number: NumberFor<B>, success: bool) {
|
||||
self.protocol.user_protocol_mut().justification_import_result(hash.clone(), number, success);
|
||||
|
||||
Reference in New Issue
Block a user