Skip to content

Commit

Permalink
chore(blockifier_reexecution): separate old block hash
Browse files Browse the repository at this point in the history
  • Loading branch information
aner-starkware committed Nov 6, 2024
1 parent 6b3cebf commit 3fb2b0b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion crates/blockifier_reexecution/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,13 @@ fn main() {
.state
.get_contract_class_mapping_dumper()
.unwrap(),
old_block_hash,
};

// Write the reexecution data to a json file.
SerializableOfflineReexecutionData {
serializable_data_prev_block,
serializable_data_next_block,
old_block_hash,
}
.write_to_file(&directory_path, "reexecution_data.json")
.unwrap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ pub struct SerializableDataNextBlock {
pub struct SerializableDataPrevBlock {
pub state_maps: ReexecutionStateMaps,
pub contract_class_mapping: StarknetContractClassMapping,
pub old_block_hash: BlockHash,
}

#[derive(Serialize, Deserialize)]
pub struct SerializableOfflineReexecutionData {
pub serializable_data_prev_block: SerializableDataPrevBlock,
pub serializable_data_next_block: SerializableDataNextBlock,
pub old_block_hash: BlockHash,
}

impl SerializableOfflineReexecutionData {
Expand All @@ -107,14 +107,15 @@ impl From<SerializableOfflineReexecutionData> for OfflineReexecutionData {
fn from(value: SerializableOfflineReexecutionData) -> Self {
let SerializableOfflineReexecutionData {
serializable_data_prev_block:
SerializableDataPrevBlock { state_maps, contract_class_mapping, old_block_hash },
SerializableDataPrevBlock { state_maps, contract_class_mapping },
serializable_data_next_block:
SerializableDataNextBlock {
block_info_next_block,
starknet_version,
transactions_next_block,
state_diff_next_block,
},
old_block_hash,
} = value;

let offline_state_reader_prev_block = OfflineStateReader {
Expand Down

0 comments on commit 3fb2b0b

Please sign in to comment.