mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-01-30 01:28:21 -05:00
feat(rpc): ots_hasCode implementation (#3886)
Co-authored-by: Miguel Palhas <mpalhas@gmail.com> Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ where
|
||||
{
|
||||
/// Handler for `ots_hasCode`
|
||||
async fn has_code(&self, address: Address, block_number: Option<BlockId>) -> RpcResult<bool> {
|
||||
Err(internal_rpc_err("unimplemented"))
|
||||
self.eth.get_code(address, block_number).await.map(|code| !code.is_empty())
|
||||
}
|
||||
|
||||
/// Handler for `ots_getApiLevel`
|
||||
|
||||
Reference in New Issue
Block a user