-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Update package versions and adjust test assertions (#67)
* chore: Update package versions and adjust test assertions 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. * refactor: Improve efficiency and readability (#68) * Refactor code for fraction and percent tests The brackets around the arithmetic operations in the fraction.rs and percent.rs test functions have been removed to improve readability. Also, in compute_price_impact.rs tests, the 'assert!' function has been replaced with 'assert_eq!' to enhance precision and clarity of the tests. * Refactor `compute_price_impact` function Simplify the `compute_price_impact` function by eliminating the need for manual error handling and using the question mark operator instead. This change also eliminates the need for clone of price impact, making the function more efficient and cleaner. * Refactor `sqrt` function for `BigInt` The square root function for BigInt has been simplified. The previous implementation used a combination of primitive sqrt for smaller values and Babylonian method for larger ones. Now, the function uses the in-built sqrt method regardless of the input size, simplifying the code and reducing potential errors.
- Loading branch information
Showing
6 changed files
with
35 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters