Skip to content

Commit 2ce919a

Browse files
authored
Merge pull request #25 from AbstractSDK/fix/astroport-supported-chains
Add lazy_static initialization for astroport chains
2 parents 17fbee7 + 326787a commit 2ce919a

File tree

6 files changed

+15
-12
lines changed

6 files changed

+15
-12
lines changed

framework/contracts/account/manager/tests/adapters.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ fn installing_specific_version_should_install_expected() -> AResult {
371371
fn account_install_adapter() -> AResult {
372372
let sender = Addr::unchecked(common::OWNER);
373373
let chain = Mock::new(&sender);
374-
let deployment = Abstract::deploy_on(chain.clone(), Empty {})?;
374+
let deployment = Abstract::deploy_on(chain.clone(), sender.to_string())?;
375375
let account = create_default_account(&deployment.account_factory)?;
376376

377377
deployment

framework/contracts/account/manager/tests/apps.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ fn execute_on_proxy_through_manager() -> AResult {
5959
fn account_install_app() -> AResult {
6060
let sender = Addr::unchecked(common::OWNER);
6161
let chain = Mock::new(&sender);
62-
let deployment = Abstract::deploy_on(chain.clone(), Empty {})?;
62+
let deployment = Abstract::deploy_on(chain.clone(), sender.to_string())?;
6363
let account = create_default_account(&deployment.account_factory)?;
6464

6565
deployment

framework/contracts/account/manager/tests/upgrades.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ fn update_adapter_with_authorized_addrs() -> AResult {
363363
fn upgrade_manager_last() -> AResult {
364364
let sender = Addr::unchecked(common::OWNER);
365365
let chain = Mock::new(&sender);
366-
let abstr = Abstract::deploy_on(chain.clone(), None)?;
366+
let abstr = Abstract::deploy_on(chain.clone(), sender.to_string())?;
367367
let account = create_default_account(&abstr.account_factory)?;
368368
let AbstractAccount { manager, proxy: _ } = &account;
369369

framework/packages/abstract-core/src/registry.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ pub const ICS20: &str = "ics-20";
1919

2020
// chain-id prefixes based on `https://cosmos.directory/`
2121
pub const JUNO: &[&str] = &["juno", "uni"];
22-
pub const OSMOSIS: &[&str] = &["osmosis", "osmo"];
22+
pub const OSMOSIS: &[&str] = &["osmosis", "osmo", "osmo-test"];
2323
pub const TERRA: &[&str] = &["phoenix", "pisco"];
2424
pub const KUJIRA: &[&str] = &["kaiyo", "harpoon"];
25+
pub const NEUTRON: &[&str] = &["pion", "neutron"];
2526
pub const ARCHWAY: &[&str] = &["constantine"];
2627
pub const LOCAL_CHAIN: &[&str] = &["cosmos-testnet"];
2728
/// Useful when deploying version control

integrations/astroport/packages/abstract-adapter/Cargo.toml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,7 @@ repository = "https://github.com/astroport-fi/astroport"
1010
[features]
1111
default = ["full_integration"]
1212
local = []
13-
full_integration = [
14-
"dep:cw20",
15-
"dep:cosmwasm-schema",
16-
"dep:cw-asset",
17-
"dep:cw-utils",
18-
"dep:astroport",
19-
]
13+
full_integration = ["dep:cw20", "dep:cosmwasm-schema", "dep:cw-asset", "dep:cw-utils", "dep:astroport"]
2014

2115
[dependencies]
2216
cosmwasm-std = { version = "1.1" }
@@ -31,6 +25,7 @@ cw-asset = { version = "3.0.0", optional = true }
3125
cw-utils = { version = "1.0.1", optional = true }
3226

3327
astroport = { path = "../astroport/", optional = true }
28+
lazy_static = "1.4.0"
3429

3530
[dev-dependencies]
3631
abstract-dex-adapter-traits = { path = "../../../../framework/packages/dex", features = [

integrations/astroport/packages/abstract-adapter/src/lib.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@ pub const ASTROPORT: &str = "astroport";
22
#[cfg(feature = "local")]
33
pub const AVAILABLE_CHAINS: &[&str] = abstract_sdk::core::registry::LOCAL_CHAIN;
44
#[cfg(not(feature = "local"))]
5-
pub const AVAILABLE_CHAINS: &[&str] = abstract_sdk::core::registry::TERRA;
5+
lazy_static::lazy_static! {
6+
pub static ref AVAILABLE_CHAINS: Vec<&'static str> = {
7+
let mut v = Vec::new();
8+
v.extend_from_slice(abstract_sdk::core::registry::OSMOSIS);
9+
v.extend_from_slice(abstract_sdk::core::registry::TERRA);
10+
v
11+
};
12+
}
613

714
pub mod dex;
815
pub mod staking;

0 commit comments

Comments
 (0)