diff --git a/crates/rpc/rpc-builder/tests/it/http.rs b/crates/rpc/rpc-builder/tests/it/http.rs index 997bf0ef9e..09dbc52cb2 100644 --- a/crates/rpc/rpc-builder/tests/it/http.rs +++ b/crates/rpc/rpc-builder/tests/it/http.rs @@ -193,9 +193,7 @@ where let nonce = 1; let block_hash = H256::default(); - assert!(is_unimplemented( - OtterscanClient::has_code(client, address, None).await.err().unwrap() - )); + OtterscanClient::has_code(client, address, None).await.unwrap(); OtterscanClient::get_api_level(client).await.unwrap(); diff --git a/crates/rpc/rpc/src/otterscan.rs b/crates/rpc/rpc/src/otterscan.rs index da895c6936..767b3657ad 100644 --- a/crates/rpc/rpc/src/otterscan.rs +++ b/crates/rpc/rpc/src/otterscan.rs @@ -31,7 +31,7 @@ where { /// Handler for `ots_hasCode` async fn has_code(&self, address: Address, block_number: Option) -> RpcResult { - Err(internal_rpc_err("unimplemented")) + self.eth.get_code(address, block_number).await.map(|code| !code.is_empty()) } /// Handler for `ots_getApiLevel`