Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
fmoletta committed Jan 2, 2024
1 parent 2cdd735 commit 86af5f9
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions crates/starknet-types-core/src/curve/projective_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,4 +224,36 @@ mod test {
.unwrap()
)
}

#[test]
// Results checked against starknet-rs https://github.com/xJonathanLEI/starknet-rs/
fn double_operations() {
let projective_point = ProjectivePoint::new(
Felt::from_dec_str(
"874739451078007766457464989774322083649278607533249481151382481072868806602",
)
.unwrap(),
Felt::from_dec_str(
"152666792071518830868575557812948353041420400780739481342941381225525861407",
)
.unwrap(),
Felt::from(1),
);

assert_eq!(
projective_point.double().to_affine().unwrap(),
AffinePoint::new(
Felt::from_dec_str(
"3324833730090626974525872402899302150520188025637965566623476530814354734325",
)
.unwrap(),
Felt::from_dec_str(
"3147007486456030910661996439995670279305852583596209647900952752170983517249",
)
.unwrap()
)
.unwrap()
);
}

}

0 comments on commit 86af5f9

Please sign in to comment.