Skip to content

Commit

Permalink
fix: bump astroport pairtype
Browse files Browse the repository at this point in the history
  • Loading branch information
ApolloGie committed Jun 27, 2024
1 parent 647bb22 commit 1e0969e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions test-helpers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,7 @@ cw-dex-test-contract = { workspace = true }
astroport-test-contract = { workspace = true, optional = true }
cw-it = { workspace = true }
astroport = { workspace = true }
astroport_v5 = { workspace = true }
cw20 = { workspace = true }
cw20-base = { workspace = true }

16 changes: 12 additions & 4 deletions test-helpers/src/astroport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use apollo_utils::assets::separate_natives_and_cw20s;
use astroport::asset::{Asset as AstroAsset, AssetInfo as AstroAssetInfo};
use astroport::factory::PairType;
use astroport::pair::{ExecuteMsg as PairExecuteMsg, StablePoolParams};
use astroport_v5::factory::PairType as AstroportV5PairType;
use cosmwasm_std::{to_json_binary, Addr, Coin, Decimal, Uint128};
use cw20::{Cw20ExecuteMsg, MinterResponse};
use cw20_base::msg::InstantiateMsg as Cw20InstantiateMsg;
Expand Down Expand Up @@ -211,10 +212,16 @@ pub fn setup_pool_and_test_contract<'a>(
},
_ => None,
};
let (pair_addr, lp_token_addr) = create_astroport_pair(
let astroport_v5_pair_type = match &pool_type {
PairType::Xyk {} => AstroportV5PairType::Xyk {},
PairType::Stable {} => AstroportV5PairType::Stable {},
PairType::Custom(t) => AstroportV5PairType::Custom(t),

Check failure on line 218 in test-helpers/src/astroport.rs

View workflow job for this annotation

GitHub Actions / Test Suite

mismatched types
};

let (pair_addr, lp_token_addr, lp_token_denom) = create_astroport_pair(
runner,
&astroport_contracts.factory.address,
pool_type,
astroport_v5_pair_type,
[astro_asset_infos[0].clone(), astro_asset_infos[1].clone()],
init_params,
admin,
Expand Down Expand Up @@ -274,13 +281,13 @@ pub fn setup_pool_and_test_contract<'a>(
AssetInfo::cw20(Addr::unchecked(
astroport_contracts.astro_token.address.clone(),
)),
lp_token_addr.clone(),
lp_token_denom.clone(),
&accs[0],
)?;

Ok((
accs,
lp_token_addr,
lp_token_denom,
pair_addr,
contract_addr,
asset_list,
Expand Down Expand Up @@ -311,3 +318,4 @@ pub fn instantiate_test_astroport_contract<'a, R: Runner<'a>>(
.data
.address)
}

0 comments on commit 1e0969e

Please sign in to comment.