Skip to content

test(blockifier): test secp_get_point_from_x #6366

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

Merged
merged 1 commit into from
May 8, 2025
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
20 changes: 20 additions & 0 deletions crates/blockifier/src/execution/syscalls/syscall_tests/secp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,26 @@ fn test_secp256k1(runnable_version: RunnableCairo1) {
);
}

#[cfg_attr(feature = "cairo_native", test_case(RunnableCairo1::Native; "Native"))]
#[test_case(RunnableCairo1::Casm; "VM")]
fn test_secp256k1_point_from_x(runnable_version: RunnableCairo1) {
let test_contract = FeatureContract::TestContract(CairoVersion::Cairo1(runnable_version));
let chain_info = &ChainInfo::create_for_testing();
let mut state = test_state(chain_info, BALANCE, &[(test_contract, 1)]);

let calldata = Calldata(vec![].into());
let entry_point_call = CallEntryPoint {
entry_point_selector: selector_from_name("test_secp256k1_point_from_x"),
calldata,
..trivial_external_entry_point_new(test_contract)
};

pretty_assertions::assert_eq!(
entry_point_call.execute_directly(&mut state).unwrap().execution,
CallExecution { gas_consumed: 186480, ..Default::default() }
);
}

#[cfg_attr(feature = "cairo_native",test_case(RunnableCairo1::Native; "Native"))]
#[test_case(RunnableCairo1::Casm; "VM")]
fn test_secp256r1(runnable_version: RunnableCairo1) {
Expand Down
Loading
Loading