MCPcopy Create free account
hub / github.com/ChainSecurity/deployment_validation / get_eth_code

Function get_eth_code

lib/web3.rs:946–962  ·  view source on GitHub ↗
(
    config: &DVFConfig,
    address: &Address,
    block_num: u64,
)

Source from the content-addressed store, hash-verified

944}
945
946pub fn get_eth_code(
947 config: &DVFConfig,
948 address: &Address,
949 block_num: u64,
950) -> Result<String, ValidationError> {
951 let block_num_hex = format!("{:#x}", block_num);
952
953 let request_body = json!({
954 "jsonrpc": "2.0",
955 "method": "eth_getCode",
956 "params": [address, block_num_hex],
957 "id": 1
958 });
959 let result = send_blocking_web3_post(config, &request_body)?;
960 let code: String = serde_json::from_value(result).unwrap_or_default();
961 Ok(code)
962}
963
964pub fn get_eth_storage_at(
965 config: &DVFConfig,

Callers 2

get_eth_codehashFunction · 0.85
processFunction · 0.85

Calls 1

send_blocking_web3_postFunction · 0.85

Tested by

no test coverage detected