Skip to content

Commit ec3911c

Browse files
test(blockifier): test secp_get_point_from_x (#6366)
1 parent d46dffc commit ec3911c

File tree

4 files changed

+9941
-8909
lines changed

4 files changed

+9941
-8909
lines changed

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

+20
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,26 @@ fn test_secp256k1(runnable_version: RunnableCairo1) {
3030
);
3131
}
3232

33+
#[cfg_attr(feature = "cairo_native", test_case(RunnableCairo1::Native; "Native"))]
34+
#[test_case(RunnableCairo1::Casm; "VM")]
35+
fn test_secp256k1_point_from_x(runnable_version: RunnableCairo1) {
36+
let test_contract = FeatureContract::TestContract(CairoVersion::Cairo1(runnable_version));
37+
let chain_info = &ChainInfo::create_for_testing();
38+
let mut state = test_state(chain_info, BALANCE, &[(test_contract, 1)]);
39+
40+
let calldata = Calldata(vec![].into());
41+
let entry_point_call = CallEntryPoint {
42+
entry_point_selector: selector_from_name("test_secp256k1_point_from_x"),
43+
calldata,
44+
..trivial_external_entry_point_new(test_contract)
45+
};
46+
47+
pretty_assertions::assert_eq!(
48+
entry_point_call.execute_directly(&mut state).unwrap().execution,
49+
CallExecution { gas_consumed: 186480, ..Default::default() }
50+
);
51+
}
52+
3353
#[cfg_attr(feature = "cairo_native",test_case(RunnableCairo1::Native; "Native"))]
3454
#[test_case(RunnableCairo1::Casm; "VM")]
3555
fn test_secp256r1(runnable_version: RunnableCairo1) {

0 commit comments

Comments
 (0)