Skip to content

Commit 7af416e

Browse files
feat: add more test to pyth lazer protocol (#2943)
1 parent 56aff81 commit 7af416e

File tree

1 file changed

+10
-0
lines changed
  • lazer/sdk/rust/protocol/src/price

1 file changed

+10
-0
lines changed

lazer/sdk/rust/protocol/src/price/tests.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,16 @@ fn price_ops() {
133133
12.34 * 34.56
134134
);
135135

136+
assert_float_absolute_eq!(
137+
price1.mul_decimal(34, 2).unwrap().to_f64(-8).unwrap(),
138+
12.34 * 3400.0
139+
);
140+
141+
assert_float_absolute_eq!(
142+
price1.mul_decimal(34, 0).unwrap().to_f64(-8).unwrap(),
143+
12.34 * 34.0
144+
);
145+
136146
let price2 = Price::parse_str("42_000", 3).unwrap();
137147
assert_float_absolute_eq!(
138148
price2.mul_integer(2).unwrap().to_f64(3).unwrap(),

0 commit comments

Comments
 (0)