MCPcopy Create free account
hub / github.com/base/base / has_code

Method has_code

actions/harness/src/engine.rs:304–312  ·  view source on GitHub ↗

Check whether an account has non-empty code deployed. Returns `true` if the account exists and has code, `false` otherwise.

(&self, address: Address)

Source from the content-addressed store, hash-verified

302 ///
303 /// Returns `true` if the account exists and has code, `false` otherwise.
304 pub fn has_code(&self, address: Address) -> bool {
305 let inner = self.inner.lock().expect("engine client lock");
306 let provider =
307 inner.blockchain_provider.latest().expect("failed to get latest state provider");
308 provider
309 .account_code(&address)
310 .expect("failed to read account code")
311 .is_some_and(|c: reth_primitives_traits::Bytecode| !c.is_empty())
312 }
313
314 /// Build a block from the given `BasePayloadAttributes`, returning the `BaseBuiltPayload`.
315 fn build_payload(

Callers

nothing calls this directly

Calls 3

lockMethod · 0.80
latestMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected