Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
JanKuczma committed Sep 3, 2024
1 parent 4adf0f9 commit a3be0c5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion amm/contracts/router_v2/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ pub mod router_v2 {
if let Some(pool) = self.cached_stable_pools.get(pool_id) {
return Ok(Pool::StablePool(pool));
}
if let Some(pair) = self.get_pair(pair.0, pair.1).ok() {
if let Ok(pair) = self.get_pair(pair.0, pair.1) {
ensure!(pair.pool_id() == pool_id, RouterV2Error::PoolNotFound);
return Ok(Pool::Pair(pair));
}
Expand Down
10 changes: 5 additions & 5 deletions amm/drink-tests/src/router_v2_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ fn test_simple_swap(mut session: Session) {
bob(),
BOB,
);
let _ice_wood_pair: pair_contract::Instance =
let ice_wood_pair: pair_contract::Instance =
factory::get_pair(&mut session, factory.into(), ice.into(), wood.into());

_ = router_v2::add_pair_liquidity(
Expand All @@ -146,7 +146,7 @@ fn test_simple_swap(mut session: Session) {
bob(),
BOB,
);
let _ice_usdt_pair: pair_contract::Instance =
let ice_usdt_pair: pair_contract::Instance =
factory::get_pair(&mut session, factory.into(), ice.into(), usdt);

// increase gas limit (swaps with more than 3 tokens require more gas)
Expand All @@ -167,15 +167,15 @@ fn test_simple_swap(mut session: Session) {
vec![
Step {
token_in: wood.into(),
pool_id: None,
pool_id: ice_wood_pair.into(),
},
Step {
token_in: ice.into(),
pool_id: None,
pool_id: ice_usdt_pair.into(),
},
Step {
token_in: usdt.into(),
pool_id: Some(usdt_usdc_pool),
pool_id: usdt_usdc_pool.into(),
},
],
usdc.into(),
Expand Down

0 comments on commit a3be0c5

Please sign in to comment.