From fc81eda4f30607abe9272811da433f5916ee1eea Mon Sep 17 00:00:00 2001 From: Artur Abliazimov Date: Sat, 30 Sep 2023 19:58:35 +0300 Subject: [PATCH] Refactor price_provider --- contracts/pool/src/types/price_provider.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/contracts/pool/src/types/price_provider.rs b/contracts/pool/src/types/price_provider.rs index 14d98920..0041699c 100644 --- a/contracts/pool/src/types/price_provider.rs +++ b/contracts/pool/src/types/price_provider.rs @@ -36,7 +36,6 @@ impl<'a> PriceProvider<'a> { FixedI128::from_inner(price) .mul_int(amount) .and_then(|a| FixedI128::from_rational(a, 10i128.pow(config.asset_decimals))) - .filter(|_| *asset != self.base_asset.address) .and_then(|a| a.to_precision(self.base_asset.decimals)) .ok_or(Error::InvalidAssetPrice) } @@ -52,7 +51,6 @@ impl<'a> PriceProvider<'a> { FixedI128::from_inner(price) .recip_mul_int(amount) .and_then(|a| FixedI128::from_rational(a, 10i128.pow(self.base_asset.decimals))) - .filter(|_| *asset != self.base_asset.address) .and_then(|a| a.to_precision(config.asset_decimals)) .ok_or(Error::InvalidAssetPrice) }