From ef0f85c540786c2dadcd47f5d1bceab985cde894 Mon Sep 17 00:00:00 2001 From: Sergey Melnychuk Date: Thu, 31 Oct 2024 17:13:01 +0100 Subject: [PATCH] chore(exe/map): fix felt mapping --- src/exe/cache.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/exe/cache.rs b/src/exe/cache.rs index cb7d26c4..e8487a3b 100644 --- a/src/exe/cache.rs +++ b/src/exe/cache.rs @@ -85,8 +85,11 @@ impl StorageCache for LRU { contract_address: &ContractAddress, storage_key: &StorageKey, ) -> Option { - get(&key(block_hash, contract_address, storage_key)) - .map(|value| StarkFelt::from_raw(value.0)) + get(&key(block_hash, contract_address, storage_key)).map(|value| { + let mut bytes = [0u8; 32]; + value.to_big_endian(&mut bytes); + StarkFelt::from_bytes_be(&bytes) + }) } fn insert(