fix: use DatabaseRef impl when fetching overriden account (#3589)

Co-authored-by: Roman Krasiuk <rokrassyuk@gmail.com>
This commit is contained in:
Matthias Seitz
2023-07-05 12:32:28 +02:00
committed by GitHub
parent 9cd31f1487
commit ab2fc7e17a

View File

@@ -459,7 +459,9 @@ where
DB: DatabaseRef,
EthApiError: From<<DB as DatabaseRef>::Error>,
{
let mut account_info = db.basic(account)?.unwrap_or_default();
// we need to fetch the account via the `DatabaseRef` to not update the state of the account,
// which is modified via `Database::basic`
let mut account_info = DatabaseRef::basic(db, account)?.unwrap_or_default();
if let Some(nonce) = account_override.nonce {
account_info.nonce = nonce.as_u64();