Block: Implement clone (#2047)

This commit is contained in:
Bastian Köcher authored and GitHub committed 2025-07-31 10:59:12 +01:00
1 parent fdc42f088b
commit 8e162036a1
3 files changed
+16 -1

No files matched your search

+11
View File
@@ -27,6 +27,17 @@ pub struct Block<T: Config, C> {
cached_events: CachedEvents<T>,
}
impl<T: Config, C: Clone> Clone for Block<T, C> {
fn clone(&self) -> Self {
Self {
header: self.header.clone(),
block_ref: self.block_ref.clone(),
client: self.client.clone(),
cached_events: self.cached_events.clone(),
}
}
}
// A cache for our events so we don't fetch them more than once when
// iterating over events for extrinsics.
pub(crate) type CachedEvents<T> = Arc<AsyncMutex<Option<events::Events<T>>>>;