Skip to content

Commit

Permalink
fix: bump cw-it, use create_astroport_pair
Browse files Browse the repository at this point in the history
  • Loading branch information
ApolloGie committed Jul 3, 2024
1 parent f15b1bc commit e75718a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
3 changes: 1 addition & 2 deletions Cargo.lock

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

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ serde = { version = "1.0.145", default-features = false, features = ["derive"] }
thiserror = { version = "1.0.31" }
apollo-cw-asset = "0.1.1"
osmosis-std = "0.22.0"
cw-it = "0.4.0-rc.1"
cw-it = { git = "https://github.com/apollodao/cw-it.git", branch = "dev/astroport-native-lp-tokens"}
apollo-utils = "0.1.0"
astroport = "2.9.0"
astroport_v5 = { package = "astroport", version = "5.1.0" }
Expand All @@ -50,3 +50,4 @@ lto = true
opt-level = 3
overflow-checks = true
rpath = false

7 changes: 5 additions & 2 deletions cw-dex-astroport/tests/astroport_tests.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
mod tests {
use std::str::FromStr;

use apollo_cw_asset::{Asset, AssetInfo, AssetInfoBase, AssetList};
use apollo_utils::assets::separate_natives_and_cw20s;
use apollo_utils::coins::coin_from_str;
use apollo_utils::submessages::{find_event, parse_attribute_value};
use astroport::factory::PairType;
use astroport_v5::asset::Asset as AstroportAsset;
use cosmwasm_std::{assert_approx_eq, coin, coins, Addr, Coin, SubMsgResponse, Uint128};
use cw_it::cw_multi_test::{StargateKeeper, StargateMessageHandler};
use cw_dex_test_contract::msg::{AstroportExecuteMsg, ExecuteMsg, QueryMsg};
use cw_dex_test_helpers::astroport::setup_pool_and_test_contract;
use cw_dex_test_helpers::{cw20_balance_query, cw20_transfer, query_asset_balance};
use cw_it::astroport::utils::AstroportContracts;
use cw_it::cw_multi_test::{StargateKeeper, StargateMessageHandler};
use cw_it::helpers::Unwrap;
use cw_it::multi_test::modules::TokenFactory;
use cw_it::multi_test::MultiTestRunner;
Expand All @@ -27,7 +29,7 @@ mod tests {
#[cfg(feature = "osmosis-test-tube")]
use cw_it::osmosis_test_tube::OsmosisTestApp;

pub const DENOM_CREATION_FEE: &str = "0uosmo";
pub const DENOM_CREATION_FEE: &str = "10000000uosmo";
const TOKEN_FACTORY: &TokenFactory =
&TokenFactory::new("factory", 32, 16, 59 + 16, DENOM_CREATION_FEE);
pub fn get_test_runner<'a>() -> OwnedTestRunner<'a> {
Expand Down Expand Up @@ -66,6 +68,7 @@ mod tests {
initial_liquidity,
2,
TEST_CONTRACT_WASM_FILE_PATH,
&[Coin::from_str(DENOM_CREATION_FEE).unwrap()],
)
}

Expand Down
3 changes: 3 additions & 0 deletions test-helpers/src/astroport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ pub fn setup_pool_and_test_contract<'a>(
initial_liquidity: Vec<(&str, u64)>,
native_denom_count: usize,
wasm_file_path: &str,
denom_creation_fee: &[Coin],
) -> RunnerResult<(
Vec<SigningAccount>,
String,
Expand Down Expand Up @@ -226,6 +227,7 @@ pub fn setup_pool_and_test_contract<'a>(
init_params,
admin,
None,
denom_creation_fee,
);

// Increase allowance of CW20's for Pair contract
Expand Down Expand Up @@ -318,3 +320,4 @@ pub fn instantiate_test_astroport_contract<'a, R: Runner<'a>>(
.data
.address)
}

0 comments on commit e75718a

Please sign in to comment.