Skip to content

Commit

Permalink
Merge branch 'feat/spot-price-with-fee' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
mrq1911 committed May 16, 2024
2 parents cc68a81 + e6f3dc0 commit d0e8a31
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,18 @@ pub mod xyk {
);
}

#[test]
fn calculate_spot_price_has_better_precision() {
assert_ne!(
xyk::calculate_spot_price(String::from("5039030951140853000"), String::from("6987280000000000")),
"0"
);
assert_eq!(
xyk::get_spot_price(String::from("5039030951140853000"), String::from("6987280000000000"), String::from("100")),
"0"
);
}

#[test]
fn out_in_works() {
assert_eq!(
Expand Down

0 comments on commit d0e8a31

Please sign in to comment.