Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(blockifier_reexecution): add test cases #1796

Merged
merged 1 commit into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"0.13.0": 600001,
"0.13.1": 620978,
"0.13.1.1": 649367,
"0.13.2": 685878,
"0.13.2.1": 700000,
"example_invoke_with_replace_class_syscall": 780008,
"example_invoke_with_deploy_syscall": 870136,
"example_deploy_account_v1": 837408,
"example_deploy_account_v3": 837792,
"example_declare_v1": 837461,
"example_declare_v2": 822636,
"example_declare_v3": 825013,
"example_l1_handler": 868429
}
13 changes: 13 additions & 0 deletions crates/blockifier_reexecution/src/state_reader/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ use indexmap::IndexMap;
use papyrus_execution::{ETH_FEE_CONTRACT_ADDRESS, STRK_FEE_CONTRACT_ADDRESS};
use pretty_assertions::assert_eq;
use serde::{Deserialize, Serialize};
use starknet_api::block::BlockNumber;
use starknet_api::core::{ChainId, ClassHash, CompiledClassHash, ContractAddress, Nonce};
use starknet_api::state::StorageKey;
use starknet_api::test_utils::read_json_file;
use starknet_gateway::config::RpcStateReaderConfig;
use starknet_types_core::felt::Felt;

Expand Down Expand Up @@ -179,3 +181,14 @@ macro_rules! assert_eq_state_diff {
);
};
}

/// Returns the block numbers for re-execution.
/// There is block number for each Starknet Version (starting v0.13)
/// And some additional block with specific transactions.
#[allow(dead_code)]
pub(crate) fn get_block_numbers_for_reexecution() -> Vec<BlockNumber> {
let block_numbers_examples: HashMap<String, u64> =
serde_json::from_value(read_json_file("block_numbers_for_reexecution.json"))
.expect("Failed to deserialize block header");
block_numbers_examples.values().map(|block_number| BlockNumber(*block_number)).collect()
}
Loading