Skip to content

Commit

Permalink
refactor(blockifier_reexecution): move reexecution test to separate f…
Browse files Browse the repository at this point in the history
…ile (#2304)
  • Loading branch information
aner-starkware authored Nov 28, 2024
1 parent 8edd6d7 commit 46ca924
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/blockifier_reexecution_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ jobs:
# Run blockifier re-execution tests.
- run: cargo test --release -p blockifier_reexecution -- --include-ignored
# Compile the rpc-tests, without running them.
- run: cargo test -p blockifier_reexecution --features blockifier_regression_https_testing --no-run
- run: cargo test --release -p blockifier_reexecution --features blockifier_regression_https_testing --no-run
3 changes: 2 additions & 1 deletion crates/blockifier_reexecution/src/state_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ mod errors;
pub mod raw_rpc_json_test;
pub mod reexecution_state_reader;
#[cfg(test)]
#[cfg(feature = "blockifier_regression_https_testing")]
pub mod reexecution_test;
#[cfg(all(test, feature = "blockifier_regression_https_testing"))]
pub mod rpc_https_test;
pub mod serde_utils;
pub mod test_state_reader;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use starknet_gateway::rpc_objects::BlockHeader;

use crate::state_reader::compile::legacy_to_contract_class_v0;
use crate::state_reader::serde_utils::deserialize_transaction_json_to_starknet_api_tx;
use crate::state_reader::utils::{reexecute_block_for_testing, ReexecutionStateMaps};
use crate::state_reader::utils::ReexecutionStateMaps;

#[fixture]
fn block_header() -> BlockHeader {
Expand Down Expand Up @@ -162,22 +162,3 @@ fn serialize_state_maps() {
assert_eq!(serializable_state_maps, deserialized_state_maps);
assert_eq!(original_state_maps, deserialized_state_maps.try_into().unwrap());
}

#[rstest]
#[case::v_0_13_0(600001)]
#[case::v_0_13_1(620978)]
#[case::v_0_13_1_1(649367)]
#[case::v_0_13_2(685878)]
#[case::v_0_13_2_1(700000)]
#[case::invoke_with_replace_class_syscall(780008)]
#[case::invoke_with_deploy_syscall(870136)]
#[case::example_deploy_account_v1(837408)]
#[case::example_deploy_account_v3(837792)]
#[case::example_declare_v1(837461)]
#[case::example_declare_v2(822636)]
#[case::example_declare_v3(825013)]
#[case::example_l1_handler(868429)]
#[ignore = "Requires downloading JSON files prior to running; Long test, run with --release flag."]
fn test_block_reexecution(#[case] block_number: u64) {
reexecute_block_for_testing(block_number);
}
22 changes: 22 additions & 0 deletions crates/blockifier_reexecution/src/state_reader/reexecution_test.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
use rstest::rstest;

use crate::state_reader::utils::reexecute_block_for_testing;

#[rstest]
#[case::v_0_13_0(600001)]
#[case::v_0_13_1(620978)]
#[case::v_0_13_1_1(649367)]
#[case::v_0_13_2(685878)]
#[case::v_0_13_2_1(700000)]
#[case::invoke_with_replace_class_syscall(780008)]
#[case::invoke_with_deploy_syscall(870136)]
#[case::example_deploy_account_v1(837408)]
#[case::example_deploy_account_v3(837792)]
#[case::example_declare_v1(837461)]
#[case::example_declare_v2(822636)]
#[case::example_declare_v3(825013)]
#[case::example_l1_handler(868429)]
#[ignore = "Requires downloading JSON files prior to running; Long test, run with --release flag."]
fn test_block_reexecution(#[case] block_number: u64) {
reexecute_block_for_testing(block_number);
}

0 comments on commit 46ca924

Please sign in to comment.