Skip to content

Commit

Permalink
chore: Update package versions and adjust test assertions
Browse files Browse the repository at this point in the history
The package versions in Cargo.toml have been updated including 'bigdecimal', 'lazy_static', 'num-traits' and few others. In the same commit, the assertion methodology in the test cases for the 'Price' entity has been changed to increase precision. Also, the expected results for 'to_significant' tests have been replaced with new values in scientific notation.
  • Loading branch information
shuhuiluo committed Jul 9, 2024
1 parent db82793 commit 77d853d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
[package]
name = "uniswap-sdk-core"
version = "0.24.0"
version = "0.25.0"
edition = "2021"
authors = ["malik <[email protected]>", "Shuhui Luo <twitter.com/aureliano_law>"]
description = "The Uniswap SDK Core in Rust provides essential functionality for interacting with the Uniswap decentralized exchange"
license = "MIT"

[dependencies]
alloy-primitives = "0.7"
bigdecimal = "=0.4.2"
bigdecimal = "0.4.5"
eth_checksum = { version = "0.1.2", optional = true }
lazy_static = "1.4"
num-bigint = "0.4.4"
num-integer = "0.1.45"
num-traits = "0.2.17"
lazy_static = "1.5"
num-bigint = "0.4"
num-integer = "0.1"
num-traits = "0.2"
regex = { version = "1.10", optional = true }
rustc-hash = "2.0.0"
rustc-hash = "2.0"
thiserror = "1.0"

[features]
Expand Down
10 changes: 5 additions & 5 deletions src/entities/fractions/price.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,11 @@ mod test {
#[test]
fn test_quote_returns_correct_value() {
let price = Price::new(TOKEN0.clone(), TOKEN1.clone(), 1, 5);
assert!(
assert_eq!(
price
.quote(CurrencyAmount::from_raw_amount(TOKEN0.clone(), 10).unwrap())
.unwrap()
== CurrencyAmount::from_raw_amount(TOKEN1.clone(), 50).unwrap()
.unwrap(),
CurrencyAmount::from_raw_amount(TOKEN1.clone(), 50).unwrap()
);
}

Expand All @@ -199,7 +199,7 @@ mod test {
let p = Price::new(TOKEN0_6.clone(), TOKEN1.clone(), 123, 456);
assert_eq!(
p.to_significant(4, Rounding::RoundDown).unwrap(),
"0.000000000003707"
"3.707E-12"
);
}

Expand All @@ -208,7 +208,7 @@ mod test {
let p = Price::new(TOKEN0_6.clone(), TOKEN1.clone(), 456, 123);
assert_eq!(
p.to_significant(4, Rounding::RoundDown).unwrap(),
"0.0000000000002697"
"2.697E-13"
);
}

Expand Down

0 comments on commit 77d853d

Please sign in to comment.