From cb8fad143dbe5f11d1937e853dc06ca1749d85ff Mon Sep 17 00:00:00 2001
From: Jonathan <94441036+zeapoz@users.noreply.github.com>
Date: Mon, 15 Apr 2024 11:27:31 +0200
Subject: [PATCH] ref: use U256 as key in initial storage changes (#86)
---
src/processor/snapshot/database.rs | 10 +++++-----
src/processor/snapshot/exporter.rs | 5 +++--
src/processor/snapshot/mod.rs | 20 ++++++++------------
src/processor/tree/tree_wrapper.rs | 9 ++++-----
state-reconstruct-fetcher/src/types/mod.rs | 12 +++---------
state-reconstruct-fetcher/src/types/v1.rs | 3 ++-
6 files changed, 25 insertions(+), 34 deletions(-)
diff --git a/src/processor/snapshot/database.rs b/src/processor/snapshot/database.rs
index 8016603..bfa7888 100644
--- a/src/processor/snapshot/database.rs
+++ b/src/processor/snapshot/database.rs
@@ -52,9 +52,7 @@ impl SnapshotDB {
let processed_value = match value {
PackingType::NoCompression(v) | PackingType::Transform(v) => v,
PackingType::Add(_) | PackingType::Sub(_) => {
- let mut buffer = [0; 32];
- key.to_big_endian(&mut buffer);
- let existing_value = if let Some(log) = self.get_storage_log(&buffer)? {
+ let existing_value = if let Some(log) = self.get_storage_log(&key)? {
U256::from(log.value.to_fixed_bytes())
} else {
U256::from(0)
@@ -141,11 +139,13 @@ impl SnapshotDB {
.map_err(Into::into)
}
- pub fn get_storage_log(&self, key: &[u8]) -> Result