Skip to content
Snippets Groups Projects
Unverified Commit 803ea760 authored by Bastian Köcher's avatar Bastian Köcher Committed by GitHub
Browse files

Improve `UnpinHandleInner` debug (#2485)

Printing the `unpin_worker_sender` included the entire stacktrace and
that is a little bit too verbose.
parent 891628a7
Branches
No related merge requests found
Pipeline #418036 canceled with stages
in 14 seconds
......@@ -25,7 +25,11 @@ use sp_runtime::{
traits::{Block as BlockT, NumberFor},
Justifications,
};
use std::{collections::HashSet, fmt, sync::Arc};
use std::{
collections::HashSet,
fmt::{self, Debug},
sync::Arc,
};
use crate::{blockchain::Info, notifications::StorageEventStream, FinalizeSummary, ImportSummary};
......@@ -271,13 +275,18 @@ impl fmt::Display for UsageInfo {
}
/// Sends a message to the pinning-worker once dropped to unpin a block in the backend.
#[derive(Debug)]
pub struct UnpinHandleInner<Block: BlockT> {
/// Hash of the block pinned by this handle
hash: Block::Hash,
unpin_worker_sender: TracingUnboundedSender<Block::Hash>,
}
impl<Block: BlockT> Debug for UnpinHandleInner<Block> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("UnpinHandleInner").field("pinned_block", &self.hash).finish()
}
}
impl<Block: BlockT> UnpinHandleInner<Block> {
/// Create a new [`UnpinHandleInner`]
pub fn new(
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment