Skip to content

Commit

Permalink
refactor(cairo_native): remove cairo native flag duplications
Browse files Browse the repository at this point in the history
  • Loading branch information
meship-starkware committed Dec 10, 2024
1 parent 036bbc0 commit 8fd014d
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions crates/blockifier/src/transaction/transactions_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,22 +197,14 @@ fn expected_validate_call_info(
) -> Option<CallInfo> {
let retdata = match cairo_version {
CairoVersion::Cairo0 => Retdata::default(),
CairoVersion::Cairo1(RunnableCairo1::Casm) => retdata!(*constants::VALIDATE_RETDATA),
#[cfg(feature = "cairo_native")]
CairoVersion::Cairo1(RunnableCairo1::Native) => {
retdata!(*constants::VALIDATE_RETDATA)
}
CairoVersion::Cairo1(_) => retdata!(*constants::VALIDATE_RETDATA),
};
// Extra range check in regular (invoke) validate call, due to passing the calldata as an array.
let n_range_checks = match cairo_version {
CairoVersion::Cairo0 => {
usize::from(entry_point_selector_name == constants::VALIDATE_ENTRY_POINT_NAME)
}
CairoVersion::Cairo1(RunnableCairo1::Casm) => {
if entry_point_selector_name == constants::VALIDATE_ENTRY_POINT_NAME { 7 } else { 2 }
}
#[cfg(feature = "cairo_native")]
CairoVersion::Cairo1(RunnableCairo1::Native) => {
CairoVersion::Cairo1(_) => {
if entry_point_selector_name == constants::VALIDATE_ENTRY_POINT_NAME { 7 } else { 2 }
}
};
Expand Down

0 comments on commit 8fd014d

Please sign in to comment.