Skip to content

Commit

Permalink
remove unecessary checks
Browse files Browse the repository at this point in the history
  • Loading branch information
JanKuczma committed Sep 25, 2024
1 parent eff301a commit b02cb14
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions amm/contracts/router_v2/stable_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use ink::{
prelude::vec::Vec,
primitives::AccountId,
};
use traits::{RouterV2Error, StablePool as StablePoolTrait, StablePoolError};
use traits::{RouterV2Error, StablePool as StablePoolTrait};

use crate::utils::{
check_timestamp, psp22_approve, psp22_transfer, psp22_transfer_from, transfer_native, withdraw,
Expand Down Expand Up @@ -69,10 +69,6 @@ impl StablePool {
wnative: Option<AccountId>,
) -> Result<(u128, u128), RouterV2Error> {
check_timestamp(deadline)?;
ensure!(
self.tokens.len() == amounts.len(),
RouterV2Error::StablePoolError(StablePoolError::IncorrectAmountsCount)
);
let native_received = transferred_value::<Env>();
let (wnative_idx, native_surplus) = match wnative {
Some(wnative) => {
Expand Down Expand Up @@ -116,10 +112,6 @@ impl StablePool {
wnative: Option<AccountId>,
) -> Result<(u128, u128), RouterV2Error> {
check_timestamp(deadline)?;
ensure!(
self.tokens.len() == amounts.len(),
RouterV2Error::StablePoolError(StablePoolError::IncorrectAmountsCount)
);
psp22_transfer_from(
self.id,
caller::<Env>(),
Expand Down Expand Up @@ -161,10 +153,6 @@ impl StablePool {
wnative: Option<AccountId>,
) -> Result<Vec<u128>, RouterV2Error> {
check_timestamp(deadline)?;
ensure!(
self.tokens.len() == min_amounts.len(),
RouterV2Error::StablePoolError(StablePoolError::IncorrectAmountsCount)
);
psp22_transfer_from(self.id, caller::<Env>(), account_id::<Env>(), share_amount)?;
match wnative {
Some(wnative) => {
Expand Down

0 comments on commit b02cb14

Please sign in to comment.