diff --git a/crates/blockifier/src/execution/syscalls/syscall_tests/call_contract.rs b/crates/blockifier/src/execution/syscalls/syscall_tests/call_contract.rs index bbec044292..b6a1d71e53 100644 --- a/crates/blockifier/src/execution/syscalls/syscall_tests/call_contract.rs +++ b/crates/blockifier/src/execution/syscalls/syscall_tests/call_contract.rs @@ -178,12 +178,26 @@ fn test_tracked_resources_fn( let expected_outer_resource = outer_version.own_tracked_resource(); assert_eq!(execution.tracked_resource, expected_outer_resource); - let expected_inner_resource = if expected_outer_resource == inner_version.own_tracked_resource() - { - expected_outer_resource - } else { - TrackedResource::CairoSteps - }; + // For native, this logic will be modified below. + let expected_inner_resource = + // If outer and inner are the same, we expect the tracked resource to be the same. + if expected_outer_resource == inner_version.own_tracked_resource() { + expected_outer_resource + } else { + // If outer and inner are not the same, and inner is not Native, we expect CairoSteps. + TrackedResource::CairoSteps + }; + + #[cfg(feature = "cairo_native")] + // If inner is Native, we expect inner to use SierraGas. + // This overrides previous logic. + let expected_inner_resource = + if inner_version == CompilerBasedVersion::CairoVersion(CairoVersion::Native) { + TrackedResource::SierraGas + } else { + expected_inner_resource + }; + assert_eq!(execution.inner_calls.first().unwrap().tracked_resource, expected_inner_resource); }