From 1eb2e4f3909f2f1e99a3244c9ba2e43cb967723c Mon Sep 17 00:00:00 2001 From: yjh Date: Sat, 29 Apr 2023 18:06:42 +0800 Subject: [PATCH] fix(in_mem): fix the clone logic (#14038) --- substrate/client/api/src/in_mem.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/substrate/client/api/src/in_mem.rs b/substrate/client/api/src/in_mem.rs index 27a74ddd79..0a29a4dbaa 100644 --- a/substrate/client/api/src/in_mem.rs +++ b/substrate/client/api/src/in_mem.rs @@ -114,6 +114,7 @@ struct BlockchainStorage { } /// In-memory blockchain. Supports concurrent reads. +#[derive(Clone)] pub struct Blockchain { storage: Arc>>, } @@ -124,13 +125,6 @@ impl Default for Blockchain { } } -impl Clone for Blockchain { - fn clone(&self) -> Self { - let storage = Arc::new(RwLock::new(self.storage.read().clone())); - Blockchain { storage } - } -} - impl Blockchain { /// Get header hash of given block. pub fn id(&self, id: BlockId) -> Option {