From a9b24e3a448bbb8d6dc378d775cca27acdd02ef7 Mon Sep 17 00:00:00 2001 From: aner-starkware <147302140+aner-starkware@users.noreply.github.com> Date: Thu, 7 Nov 2024 10:32:53 +0200 Subject: [PATCH] chore(blockifier_reexecution): implement get_old_block_hash_and_number for offline state reader (#1859) --- .../src/state_reader/test_state_reader.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/blockifier_reexecution/src/state_reader/test_state_reader.rs b/crates/blockifier_reexecution/src/state_reader/test_state_reader.rs index c2effd18e5..f7300acd72 100644 --- a/crates/blockifier_reexecution/src/state_reader/test_state_reader.rs +++ b/crates/blockifier_reexecution/src/state_reader/test_state_reader.rs @@ -72,6 +72,7 @@ pub struct SerializableOfflineReexecutionData { starknet_version: StarknetVersion, transactions_next_block: Vec<(Transaction, TransactionHash)>, state_diff_next_block: CommitmentStateDiff, + old_block_hash: BlockHash, } impl SerializableOfflineReexecutionData { @@ -97,6 +98,7 @@ impl From for OfflineReexecutionData { let offline_state_reader_prev_block = OfflineStateReader { state_maps: value.state_maps.try_into().expect("Failed to deserialize state maps."), contract_class_mapping: value.contract_class_mapping, + old_block_hash: value.old_block_hash, }; let transactions_next_block = offline_state_reader_prev_block .api_txs_to_blockifier_txs(value.transactions_next_block) @@ -461,6 +463,7 @@ impl ConsecutiveStateReaders for ConsecutiveTestStateReaders { pub struct OfflineStateReader { pub state_maps: StateMaps, pub contract_class_mapping: StarknetContractClassMapping, + pub old_block_hash: BlockHash, } impl StateReader for OfflineStateReader { @@ -526,7 +529,7 @@ impl ReexecutionStateReader for OfflineStateReader { } fn get_old_block_hash(&self, _old_block_number: BlockNumber) -> ReexecutionResult { - todo!() + Ok(self.old_block_hash) } }