Skip to content

Commit

Permalink
chore(blockifier_reexecution): implement get_old_block_hash_and_numbe…
Browse files Browse the repository at this point in the history
…r for offline state reader (#1859)
  • Loading branch information
aner-starkware authored Nov 7, 2024
1 parent 880df26 commit a9b24e3
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -97,6 +98,7 @@ impl From<SerializableOfflineReexecutionData> 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)
Expand Down Expand Up @@ -461,6 +463,7 @@ impl ConsecutiveStateReaders<TestStateReader> for ConsecutiveTestStateReaders {
pub struct OfflineStateReader {
pub state_maps: StateMaps,
pub contract_class_mapping: StarknetContractClassMapping,
pub old_block_hash: BlockHash,
}

impl StateReader for OfflineStateReader {
Expand Down Expand Up @@ -526,7 +529,7 @@ impl ReexecutionStateReader for OfflineStateReader {
}

fn get_old_block_hash(&self, _old_block_number: BlockNumber) -> ReexecutionResult<BlockHash> {
todo!()
Ok(self.old_block_hash)
}
}

Expand Down

0 comments on commit a9b24e3

Please sign in to comment.