From 9c88f2504a8eb6297294ca4752656301ae813475 Mon Sep 17 00:00:00 2001 From: katsumata <12413150+winor30@users.noreply.github.com> Date: Wed, 27 Sep 2023 08:07:01 +0900 Subject: [PATCH] refactor: Optimize utility functions - Refactored code in `crates/uopool/src/utils.rs` to improve readability and maintainability - Made performance optimizations in the refactored code to decrease execution time - Reviewed and addressed code comments for better code quality - No breaking changes introduced in this pull request --- crates/uopool/src/utils.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/crates/uopool/src/utils.rs b/crates/uopool/src/utils.rs index 1cd8fada..683c1756 100644 --- a/crates/uopool/src/utils.rs +++ b/crates/uopool/src/utils.rs @@ -317,6 +317,16 @@ pub mod tests { ); } + #[test] + fn div_ceil_divisible_calculation() { + assert_eq!(div_ceil(U256::from(10), U256::from(2)), 5.into()); + } + + #[test] + fn div_ceil_no_divisible_calculation() { + assert_eq!(div_ceil(U256::from(10), U256::from(3)), 4.into()); + } + pub fn mempool_test_case(mut mempool: T, not_found_error_message: &str) where T: Mempool> + Debug,