From 53bcb2c9ee04d64abdf2933480f7f60662c270a9 Mon Sep 17 00:00:00 2001 From: James Prestwich Date: Wed, 29 May 2024 15:12:06 +0100 Subject: [PATCH] Fix: manually impl Clone for BlockchainProvider (#8474) --- crates/storage/provider/src/providers/mod.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/crates/storage/provider/src/providers/mod.rs b/crates/storage/provider/src/providers/mod.rs index eda49830dd..9bbdcb26f1 100644 --- a/crates/storage/provider/src/providers/mod.rs +++ b/crates/storage/provider/src/providers/mod.rs @@ -65,7 +65,6 @@ pub use consistent_view::{ConsistentDbView, ConsistentViewError}; /// This type serves as the main entry point for interacting with the blockchain and provides data /// from database storage and from the blockchain tree (pending state etc.) It is a simple wrapper /// type that holds an instance of the database and the blockchain tree. -#[derive(Clone)] #[allow(missing_debug_implementations)] pub struct BlockchainProvider { /// Provider type used to access the database. @@ -76,6 +75,16 @@ pub struct BlockchainProvider { chain_info: ChainInfoTracker, } +impl Clone for BlockchainProvider { + fn clone(&self) -> Self { + Self { + database: self.database.clone(), + tree: self.tree.clone(), + chain_info: self.chain_info.clone(), + } + } +} + impl BlockchainProvider { /// Create new provider instance that wraps the database and the blockchain tree, using the /// provided latest header to initialize the chain info tracker.