From c3b6023115b10ed125499c4d158b90dd6fa10fdb Mon Sep 17 00:00:00 2001 From: jakevin Date: Fri, 24 Jan 2025 22:38:47 +0800 Subject: [PATCH] chore: add comment for pub function and fix typo (#2015) --- crates/database/src/states/cache_account.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/database/src/states/cache_account.rs b/crates/database/src/states/cache_account.rs index 822ecc31fb..de300ad676 100644 --- a/crates/database/src/states/cache_account.rs +++ b/crates/database/src/states/cache_account.rs @@ -91,14 +91,14 @@ impl CacheAccount { ) } - /// Returns storage slot if it exist. + /// Returns storage slot if it exists. pub fn storage_slot(&self, slot: U256) -> Option { self.account .as_ref() .and_then(|a| a.storage.get(&slot).cloned()) } - /// Fetches account info if it exist. + /// Fetches account info if it exists. pub fn account_info(&self) -> Option { self.account.as_ref().map(|a| a.info.clone()) } @@ -276,6 +276,9 @@ impl CacheAccount { }) } + // Updates the account with new information and storage changes. + // + // Merges the provided storage values with the existing storage and updates the account status. pub fn change( &mut self, new: AccountInfo,