diff --git a/src/eth/primitives/block_number.rs b/src/eth/primitives/block_number.rs index 0f4189a25..7ac1922c0 100644 --- a/src/eth/primitives/block_number.rs +++ b/src/eth/primitives/block_number.rs @@ -2,10 +2,10 @@ use std::ops::Add; use std::ops::AddAssign; use std::str::FromStr; +use alloy_primitives::keccak256; use anyhow::anyhow; use display_json::DebugAsJson; use ethereum_types::U64; -use ethers_core::utils::keccak256; use fake::Dummy; use fake::Faker; @@ -24,7 +24,7 @@ impl BlockNumber { /// Calculates the keccak256 hash of the block number. pub fn hash(&self) -> Hash { - Hash::new(keccak256(<[u8; 8]>::from(*self))) + Hash::new(*keccak256(<[u8; 8]>::from(*self))) } /// Returns the previous block number. diff --git a/src/eth/primitives/slot_index.rs b/src/eth/primitives/slot_index.rs index 45fe20f4c..476ae2214 100644 --- a/src/eth/primitives/slot_index.rs +++ b/src/eth/primitives/slot_index.rs @@ -1,9 +1,10 @@ use std::fmt::Display; use std::io::Read; +use alloy_primitives::keccak256; +use alloy_primitives::FixedBytes; use display_json::DebugAsJson; use ethereum_types::U256; -use ethers_core::utils::keccak256; use fake::Dummy; use fake::Faker; @@ -67,6 +68,12 @@ impl From for SlotIndex { } } +impl From> for SlotIndex { + fn from(value: FixedBytes<32>) -> Self { + Self::from(value.0) + } +} + // ----------------------------------------------------------------------------- // Tests // -----------------------------------------------------------------------------