diff --git a/crates/revm/src/db/states/cache_account.rs b/crates/revm/src/db/states/cache_account.rs index 325e32f7be..9d6775afe7 100644 --- a/crates/revm/src/db/states/cache_account.rs +++ b/crates/revm/src/db/states/cache_account.rs @@ -282,12 +282,11 @@ impl CacheAccount { storage: StorageWithOriginalValues, ) -> TransitionAccount { let previous_status = self.status; - let previous_info = self.account.as_ref().map(|a| a.info.clone()); - let mut this_storage = self - .account - .take() - .map(|acc| acc.storage) - .unwrap_or_default(); + let (previous_info, mut this_storage) = if let Some(account) = self.account.take() { + (Some(account.info), account.storage) + } else { + (None, Default::default()) + }; this_storage.extend(storage.iter().map(|(k, s)| (*k, s.present_value))); let changed_account = PlainAccount { diff --git a/crates/revm/src/db/states/transition_account.rs b/crates/revm/src/db/states/transition_account.rs index a559527f30..9ed0fb0d68 100644 --- a/crates/revm/src/db/states/transition_account.rs +++ b/crates/revm/src/db/states/transition_account.rs @@ -85,7 +85,7 @@ impl TransitionAccount { /// Update new values of transition. Don't override old values. /// Both account info and old storages need to be left intact. pub fn update(&mut self, other: Self) { - self.info.clone_from(&other.info); + self.info = other.info; self.status = other.status; // if transition is from some to destroyed drop the storage.