anvil_zksync_core/node/diagnostics/mod.rs
1//!
2//! Routines to help with node diagnostics, parsing, extracting information from
3//! different subsystems. The `[crate::formatter]` module is used to output it.
4//!
5
6use zksync_multivm::interface::storage::ReadStorage;
7use zksync_types::Address;
8
9pub mod transaction;
10pub mod vm;
11
12pub fn account_has_code(address: Address, fork_storage: &mut impl ReadStorage) -> bool {
13 let code_key = zksync_types::get_code_key(&address);
14 let bytecode_hash =
15 zksync_multivm::interface::storage::ReadStorage::read_value(fork_storage, &code_key);
16
17 !bytecode_hash.is_zero()
18}