Skip to content

Commit

Permalink
fix: make anvil compile (#6845)
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes authored Jan 18, 2024
1 parent 8bd1483 commit 2125803
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions crates/anvil/src/eth/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -472,9 +472,8 @@ impl EthApi {
/// Handler for ETH RPC call: `web3_sha3`
pub fn sha3(&self, bytes: Bytes) -> Result<String> {
node_info!("web3_sha3");
let hash = ethers::utils::keccak256(bytes.as_ref());
let hex_hash = alloy_primitives::utils::hex::encode(&hash[..]);
Ok(format!("0x{hex_hash}"))
let hash = alloy_primitives::keccak256(bytes.as_ref());
Ok(alloy_primitives::hex::encode_prefixed(&hash[..]))
}

/// Returns protocol version encoded as a string (quotes are necessary).
Expand Down

0 comments on commit 2125803

Please sign in to comment.