From 44067d087a167eb6ceb1fecf72e80f81e2043235 Mon Sep 17 00:00:00 2001 From: giladchase Date: Sun, 4 Feb 2024 12:43:06 +0200 Subject: [PATCH] fix: delete dead code block_execution.rs (#1425) Was already removed from lib.rs. Co-Authored-By: Gilad Chase --- crates/blockifier/src/block_execution.rs | 33 ------------------------ 1 file changed, 33 deletions(-) delete mode 100644 crates/blockifier/src/block_execution.rs diff --git a/crates/blockifier/src/block_execution.rs b/crates/blockifier/src/block_execution.rs deleted file mode 100644 index 91d1fbca5f..0000000000 --- a/crates/blockifier/src/block_execution.rs +++ /dev/null @@ -1,33 +0,0 @@ -use starknet_api::block::{BlockHash, BlockNumber}; -use starknet_api::core::ContractAddress; -use starknet_api::hash::StarkFelt; -use starknet_api::state::StorageKey; - -use crate::abi::constants; -use crate::state::state_api::{State, StateResult}; - -#[cfg(test)] -#[path = "block_execution_test.rs"] -pub mod test; - -// Block pre-processing. -// Writes the hash of the (current_block_number - N) block under its block number in the dedicated -// contract state, where N=STORED_BLOCK_HASH_BUFFER. -pub fn pre_process_block( - state: &mut dyn State, - old_block_number_and_hash: Option, -) -> StateResult<()> { - if let Some(BlockNumberHashPair { number: block_number, hash: block_hash }) = - old_block_number_and_hash - { - state.set_storage_at( - ContractAddress::try_from(StarkFelt::from(constants::BLOCK_HASH_CONTRACT_ADDRESS)) - .expect("Failed to convert `BLOCK_HASH_CONTRACT_ADDRESS` to ContractAddress."), - StorageKey::try_from(StarkFelt::from(block_number.0)) - .expect("Failed to convert BlockNumber to StorageKey."), - block_hash.0, - )?; - } - - Ok(()) -}