Skip to content

Commit b650f56

Browse files
committed
load accounts
1 parent 456da15 commit b650f56

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

crates/anvil/src/eth/backend/fork.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -739,15 +739,15 @@ impl ForkedStorage {
739739
accounts: BTreeMap<Address, SerializableAccountRecord>,
740740
block_number: u64,
741741
) {
742-
accounts.into_iter().map(|(k, v)| {
742+
accounts.into_iter().for_each(|(k, v)| {
743743
let info = AccountInfo {
744744
balance: v.balance,
745745
nonce: v.nonce,
746746
code_hash: KECCAK_EMPTY,
747747
code: if v.code.is_empty() { None } else { Some(Bytecode::new_raw(v.code)) },
748748
};
749749

750-
self.account_at.insert((k, block_number), info)
750+
self.account_at.insert((k, block_number), info);
751751
});
752752
}
753753
}

crates/anvil/src/eth/backend/mem/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -929,6 +929,10 @@ impl Backend {
929929
.into());
930930
}
931931

932+
if let Some(mut fork) = self.get_fork() {
933+
fork.load_state(state.clone());
934+
}
935+
932936
if let Some(historical_states) = state.historical_states {
933937
self.states.write().load_states(historical_states);
934938
}

0 commit comments

Comments
 (0)