Skip to content

Commit

Permalink
Revert "feat: add recipient to pool"
Browse files Browse the repository at this point in the history
This reverts commit 46db747.
  • Loading branch information
ApolloGie committed Aug 15, 2024
1 parent 46db747 commit 835756e
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 10 deletions.
3 changes: 1 addition & 2 deletions cw-dex-astroport/src/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ impl Pool for AstroportPool {
env: &Env,
assets: AssetList,
min_out: Uint128,
recipient: Option<String>,
) -> Result<Response, CwDexError> {
let (funds, cw20s) = separate_natives_and_cw20s(&assets);

Expand Down Expand Up @@ -187,7 +186,7 @@ impl Pool for AstroportPool {
assets: assets_vec.iter().map(asset_to_astroport_v5_asset).collect(),
slippage_tolerance: Some(Decimal::from_str(MAX_ALLOWED_SLIPPAGE)?),
auto_stake: Some(false),
receiver: recipient,
receiver: None,
min_lp_to_receive: Some(min_out),
})?,
funds,
Expand Down
1 change: 0 additions & 1 deletion cw-dex-osmosis/src/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ impl Pool for OsmosisPool {
env: &Env,
assets: AssetList,
min_out: Uint128,
_recipient: Option<String>,
) -> Result<Response, CwDexError> {
let mut assets = assets;

Expand Down
3 changes: 1 addition & 2 deletions cw-dex/src/implementations/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,9 @@ impl PoolTrait for Pool {
env: &Env,
assets: AssetList,
min_out: Uint128,
recipient: Option<String>,
) -> Result<Response, CwDexError> {
self.as_trait()
.provide_liquidity(deps, env, assets, min_out, recipient)
.provide_liquidity(deps, env, assets, min_out)
}

fn withdraw_liquidity(
Expand Down
1 change: 0 additions & 1 deletion cw-dex/src/traits/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ pub trait Pool {
env: &Env,
assets: AssetList,
min_out: Uint128,
recipient: Option<String>,
) -> Result<Response, CwDexError>;

/// Get the LP token for this pool
Expand Down
5 changes: 2 additions & 3 deletions test-contracts/astroport-test-contract/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub fn execute(
) -> Result<Response, ContractError> {
match msg {
ExecuteMsg::ProvideLiquidity { assets, min_out } => {
execute_provide_liquidity(deps, env, info, assets, min_out, None)
execute_provide_liquidity(deps, env, info, assets, min_out)
}
ExecuteMsg::WithdrawLiquidity { amount, min_out } => {
execute_withdraw_liquidity(deps, env, info, amount, min_out)
Expand All @@ -66,11 +66,10 @@ pub fn execute_provide_liquidity(
_info: MessageInfo,
assets: AssetList,
min_out: Uint128,
recipient: Option<String>,
) -> Result<Response, ContractError> {
let pool = POOL.load(deps.storage)?;

Ok(pool.provide_liquidity(deps.as_ref(), &env, assets, min_out, recipient)?)
Ok(pool.provide_liquidity(deps.as_ref(), &env, assets, min_out)?)
}

pub fn execute_withdraw_liquidity(
Expand Down
2 changes: 1 addition & 1 deletion test-contracts/osmosis-test-contract/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ pub fn execute_provide_liquidity(
) -> Result<Response, ContractError> {
let pool = POOL.load(deps.storage)?;

Ok(pool.provide_liquidity(deps.as_ref(), &env, assets, min_out, None)?)
Ok(pool.provide_liquidity(deps.as_ref(), &env, assets, min_out)?)
}

pub fn execute_withdraw_liquidity(
Expand Down

0 comments on commit 835756e

Please sign in to comment.