From d40fbd8e8c5055df9c2a4ca66775679eec9689f5 Mon Sep 17 00:00:00 2001 From: Soubhik Singha Mahapatra Date: Sat, 13 Dec 2025 10:17:13 +0530 Subject: [PATCH] chore: changes storage key and value to U256 --- crates/eip7928/src/slot_changes.rs | 8 ++++---- crates/eip7928/src/storage_change.rs | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/eip7928/src/slot_changes.rs b/crates/eip7928/src/slot_changes.rs index f4672f2..7a54d29 100644 --- a/crates/eip7928/src/slot_changes.rs +++ b/crates/eip7928/src/slot_changes.rs @@ -3,7 +3,7 @@ use crate::StorageChange; use alloc::vec::Vec; -use alloy_primitives::{B256, StorageKey}; +use alloy_primitives::U256; /// Represents all changes made to a single storage slot across multiple transactions. #[derive(Debug, Clone, Default, PartialEq, Eq)] @@ -14,7 +14,7 @@ use alloy_primitives::{B256, StorageKey}; #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] pub struct SlotChanges { /// The storage slot key being modified. - pub slot: StorageKey, + pub slot: U256, /// A list of write operations to this slot, ordered by transaction index. #[cfg_attr(feature = "serde", serde(alias = "slotChanges"))] pub changes: Vec, @@ -25,7 +25,7 @@ impl SlotChanges { /// /// Preallocates capacity for up to 300,000 changes. #[inline] - pub const fn new(slot: StorageKey, changes: Vec) -> Self { + pub const fn new(slot: U256, changes: Vec) -> Self { Self { slot, changes } } @@ -49,7 +49,7 @@ impl SlotChanges { /// Creates a new `SlotChanges` for the given slot. #[inline] - pub const fn with_slot(mut self, slot: B256) -> Self { + pub const fn with_slot(mut self, slot: U256) -> Self { self.slot = slot; self } diff --git a/crates/eip7928/src/storage_change.rs b/crates/eip7928/src/storage_change.rs index 6e964cf..a7eb978 100644 --- a/crates/eip7928/src/storage_change.rs +++ b/crates/eip7928/src/storage_change.rs @@ -2,7 +2,7 @@ //! a transaction. use crate::BlockAccessIndex; -use alloy_primitives::B256; +use alloy_primitives::U256; /// Represents a single storage write operation within a transaction. #[derive(Debug, Clone, Default, PartialEq, Eq)] @@ -17,13 +17,13 @@ pub struct StorageChange { pub block_access_index: BlockAccessIndex, /// The new value written to the storage slot. #[cfg_attr(feature = "serde", serde(alias = "postValue"))] - pub new_value: B256, + pub new_value: U256, } impl StorageChange { /// Creates a new `StorageChange`. #[inline] - pub const fn new(block_access_index: BlockAccessIndex, new_value: B256) -> Self { + pub const fn new(block_access_index: BlockAccessIndex, new_value: U256) -> Self { Self { block_access_index, new_value } } @@ -41,7 +41,7 @@ impl StorageChange { /// Returns a copy with a different storage value. #[inline] - pub const fn with_value(&self, value: B256) -> Self { + pub const fn with_value(&self, value: U256) -> Self { Self { block_access_index: self.block_access_index, new_value: value } } }