Skip to content

Commit 7db0d13

Browse files
blockifier: add get execution info v2 to get execution test (#11410)
1 parent 73fef62 commit 7db0d13

File tree

10 files changed

+15666
-12516
lines changed

10 files changed

+15666
-12516
lines changed

crates/blockifier/src/bouncer_test.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -775,11 +775,11 @@ fn class_hash_migration_data_from_state(
775775

776776
if should_migrate {
777777
expect![[r#"
778-
105350389
778+
109782378
779779
"#]]
780780
.assert_debug_eq(&migration_sierra_gas.0);
781781
expect![[r#"
782-
254431248
782+
265958264
783783
"#]]
784784
.assert_debug_eq(&migration_proving_gas.0);
785785
} else {

crates/blockifier/src/execution/syscalls/syscall_tests/get_execution_info.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,10 @@ impl<S: StateReader> TestSetup<S> {
141141
self.calldata.push(
142142
expected_resource_bounds.into_iter().chain(expected_unsupported_fields).collect(),
143143
);
144-
self.calldata.push(proof_facts_as_cairo_array(proof_facts));
144+
145+
if self.entry_point_selector == selector_from_name("test_get_execution_info_v3") {
146+
self.calldata.push(proof_facts_as_cairo_array(proof_facts));
147+
}
145148
}
146149
}
147150

@@ -170,6 +173,7 @@ fn create_test_setup(
170173
tx_version: TransactionVersion,
171174
flags: &ExecutionInfoTestFlags,
172175
class_hash_override: Option<starknet_api::core::ClassHash>,
176+
entry_point_name: &str,
173177
) -> TestSetup<DictStateReader> {
174178
let ExecutionInfoTestFlags {
175179
only_query,
@@ -270,7 +274,7 @@ fn create_test_setup(
270274
};
271275

272276
// Build expected calldata (what the contract expects to receive via execution info).
273-
let entry_point_selector = selector_from_name("test_get_execution_info");
277+
let entry_point_selector = selector_from_name(entry_point_name);
274278

275279
let expected_call_info = vec![
276280
felt!(0_u16), // Caller address.
@@ -323,10 +327,12 @@ fn test_get_execution_info(
323327
#[case] tx_version: TransactionVersion,
324328
#[case] only_query: bool,
325329
#[values(ExecutionMode::Validate, ExecutionMode::Execute)] execution_mode: ExecutionMode,
330+
#[values("test_get_execution_info_v3", "test_get_execution_info_v2")] entry_point_name: &str,
326331
) {
327332
let contract = FeatureContract::TestContract(CairoVersion::Cairo1(runnable));
328333
let flags = ExecutionInfoTestFlags { only_query, ..Default::default() };
329-
let mut setup = create_test_setup(contract, execution_mode, tx_version, &flags, None);
334+
let mut setup =
335+
create_test_setup(contract, execution_mode, tx_version, &flags, None, entry_point_name);
330336
setup.extend_calldata_for_post_v1_execution_info_syscall();
331337
setup.execute_and_assert();
332338
}
@@ -386,6 +392,7 @@ fn test_execution_info_v1_syscall(
386392
tx_version,
387393
&ExecutionInfoTestFlags::default(),
388394
None,
395+
"test_get_execution_info",
389396
);
390397
setup.execute_and_assert();
391398
}
@@ -427,6 +434,7 @@ fn test_v1_bound_account_get_execution_info(
427434
TransactionVersion::THREE,
428435
&flags,
429436
Some(class_hash),
437+
"test_get_execution_info_v3",
430438
);
431439
setup.extend_calldata_for_post_v1_execution_info_syscall();
432440
setup.execute_and_assert();
@@ -455,6 +463,7 @@ fn test_exclude_l1_data_gas_get_execution_info(
455463
TransactionVersion::THREE,
456464
&flags,
457465
Some(class_hash),
466+
"test_get_execution_info_v3",
458467
);
459468
setup.extend_calldata_for_post_v1_execution_info_syscall();
460469
setup.execute_and_assert();

crates/blockifier/src/transaction/transactions_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2638,7 +2638,7 @@ fn test_only_query_flag(
26382638
&block_context.chain_info,
26392639
CairoVersion::Cairo1(RunnableCairo1::Casm),
26402640
);
2641-
let entry_point_selector = selector_from_name("test_get_execution_info");
2641+
let entry_point_selector = selector_from_name("test_get_execution_info_v3");
26422642
let expected_execution_info = ExpectedExecutionInfo::new(
26432643
only_query,
26442644
account_address,

0 commit comments

Comments
 (0)