Skip to content

Commit

Permalink
Reactivation of adapters
Browse files Browse the repository at this point in the history
  • Loading branch information
Kayanski committed Nov 29, 2024
1 parent 317a04a commit bd9768c
Show file tree
Hide file tree
Showing 27 changed files with 330 additions and 466 deletions.
2 changes: 1 addition & 1 deletion integrations/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
members = [
# "astroport-adapter",
"astrovault-adapter",
# "bundles/*",
"bundles/*",
"osmosis-adapter",
"wyndex-adapter",
"kujira-adapter",
Expand Down
38 changes: 21 additions & 17 deletions integrations/bundles/mockdex/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,25 @@ version = { workspace = true }


[dependencies]
cw-controllers = "2.0.0"
wyndex = { git = "https://github.com/cosmorama/wynddex.git", tag = "v1.1.2" }
wyndex-factory = { git = "https://github.com/cosmorama/wynddex.git", tag = "v1.1.2" }
wyndex-multi-hop = { git = "https://github.com/cosmorama/wynddex.git", tag = "v1.1.2" }
wyndex-pair = { git = "https://github.com/cosmorama/wynddex.git", tag = "v1.1.2" }
wyndex-stake = { git = "https://github.com/cosmorama/wynddex.git", tag = "v1.1.2" }
cw-controllers = "2.0.0"
# wyndex = { git = "https://github.com/cosmorama/wynddex.git", tag = "v1.1.2" }
# wyndex-factory = { git = "https://github.com/cosmorama/wynddex.git", tag = "v1.1.2" }
# wyndex-multi-hop = { git = "https://github.com/cosmorama/wynddex.git", tag = "v1.1.2" }
# wyndex-pair = { git = "https://github.com/cosmorama/wynddex.git", tag = "v1.1.2" }
# wyndex-stake = { git = "https://github.com/cosmorama/wynddex.git", tag = "v1.1.2" }
wyndex = { git = "https://github.com/abstractsdk/wynddex", rev = "cbe316f17c4a89d0c3938ea66747a5ff1fc5a5e9" }
wyndex-factory = { git = "https://github.com/abstractsdk/wynddex", rev = "cbe316f17c4a89d0c3938ea66747a5ff1fc5a5e9" }
wyndex-multi-hop = { git = "https://github.com/abstractsdk/wynddex", rev = "cbe316f17c4a89d0c3938ea66747a5ff1fc5a5e9" }
wyndex-pair = { git = "https://github.com/abstractsdk/wynddex", rev = "cbe316f17c4a89d0c3938ea66747a5ff1fc5a5e9" }
wyndex-stake = { git = "https://github.com/abstractsdk/wynddex", rev = "cbe316f17c4a89d0c3938ea66747a5ff1fc5a5e9" }

abstract-interface = { workspace = true, features = ["testing"] }
abstract-std = { workspace = true }
anyhow = { workspace = true }
cosmwasm-schema = { workspace = true }
cosmwasm-std = { workspace = true }
cw-asset = { workspace = true }
cw-orch = { workspace = true }
cw-plus-interface.workspace = true
cw-plus-orch = "0.25.0"
cw20 = { workspace = true }
cw20-base = { workspace = true }
abstract-interface = { workspace = true, features = ["testing"] }
abstract-std = { workspace = true }
anyhow = { workspace = true }
cosmwasm-schema = { workspace = true }
cosmwasm-std = { workspace = true }
cw-asset = { workspace = true }
cw-orch = { workspace = true }
cw-plus-orch = { workspace = true }
cw20 = { workspace = true }
cw20-base = { workspace = true }
8 changes: 2 additions & 6 deletions integrations/bundles/mockdex/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use abstract_std::{
use cosmwasm_std::{coin, Decimal, Uint128};
use cw20::Cw20Coin;
use cw_orch::prelude::*;
use cw_plus_interface::cw20_base::Cw20Base as AbstractCw20Base;
use cw_plus_orch::cw20_base::Cw20Base as AbstractCw20Base;
use wyndex::{
asset::{AssetInfo, AssetInfoExt},
factory::{DefaultStakeConfig, PartialStakeConfig},
Expand Down Expand Up @@ -164,6 +164,7 @@ impl Deploy<MockBech32> for WynDex {
min_bond: Uint128::new(1),
unbonding_periods: vec![1, 2],
max_distributions: 1,
converter: None,
})
.build(&chain);

Expand Down Expand Up @@ -443,11 +444,6 @@ impl Deploy<MockBech32> for WynDex {
Box::new(&mut self.raw_eur_lp),
]
}

// This is only a mock deploy
fn deployed_state_file_path() -> Option<String> {
None
}
}
impl WynDex {
/// registers the WynDex contracts and assets on Abstract
Expand Down
1 change: 1 addition & 0 deletions integrations/bundles/mockdex/src/suite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ impl SuiteBuilder {
min_bond: Uint128::new(1000),
unbonding_periods: vec![60 * 60 * 24 * 7, 60 * 60 * 24 * 14, 60 * 60 * 24 * 21],
max_distributions: 6,
converter: None,
},
trading_starts: None,
}
Expand Down
5 changes: 2 additions & 3 deletions integrations/bundles/mockdex/tests/abstract.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
mod abstrct {
use abstract_interface::Abstract;
use cw_orch::prelude::*;
use wyndex_bundle::WynDex;
use mockdex_bundle::WynDex;

#[test]
fn deploy() {
let mock = MockBech32::new("mock");
let owner = mock.sender_addr();

Abstract::deploy_on(mock.clone(), owner.to_string()).unwrap();
Abstract::deploy_on(mock.clone(), ()).unwrap();

let deployed = WynDex::deploy_on(mock.clone(), Empty {}).unwrap();
let loaded = WynDex::load_from(mock).unwrap();
Expand Down
9 changes: 6 additions & 3 deletions integrations/bundles/mockdex/tests/staking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@ use cosmwasm_std::{coin, from_json, Addr, Decimal, Uint128};
use wyndex::{
asset::{AssetInfo, AssetInfoExt},
factory::PartialStakeConfig,
stake::ReceiveMsg,
};
use wyndex_stake::{
msg::{QueryMsg as StakeQueryMsg, ReceiveDelegationMsg, StakedResponse},
msg::{QueryMsg as StakeQueryMsg, StakedResponse},
state::Config as WyndexStakeConfig,
};

mod staking {
use super::*;
use cw_orch::mock::MockBech32;
use cw_orch::prelude::TxHandler;
use mockdex_bundle::{suite::SuiteBuilder, WYNDEX_OWNER};
use wyndex::factory::{DefaultStakeConfig, DistributionFlow};
use wyndex_bundle::{suite::SuiteBuilder, WYNDEX_OWNER};

#[test]
fn basic() {
Expand All @@ -40,6 +41,7 @@ mod staking {
min_bond: Uint128::new(1),
unbonding_periods: vec![1, 2],
max_distributions: 1,
converter: None,
})
.build(&mock);

Expand Down Expand Up @@ -92,7 +94,7 @@ mod staking {
&pair_info.liquidity_token,
1000,
&pair_info.staking_addr,
ReceiveDelegationMsg::Delegate {
ReceiveMsg::Delegate {
unbonding_period: 1,
delegate_as: None,
},
Expand Down Expand Up @@ -190,6 +192,7 @@ mod staking {
min_bond: Uint128::new(1),
unbonding_periods: vec![1],
max_distributions: 3,
converter: None,
})
.build(&mock);

Expand Down
2 changes: 1 addition & 1 deletion integrations/bundles/mockdex/tests/swap.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use cosmwasm_std::{coin, testing::mock_env};
use cw_orch::mock::MockBech32;
use cw_orch::prelude::TxHandler;
use mockdex_bundle::suite::SuiteBuilder;
use wyndex::asset::{AssetInfo, AssetInfoExt};
use wyndex_bundle::suite::SuiteBuilder;
use wyndex_multi_hop::msg::SwapOperation;

#[test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
use abstract_framework_clone_testing::common;
use abstract_interface::{Abstract, AccountDetails, AccountI, AccountQueryFns, RegistryQueryFns};
use abstract_std::objects::AccountId;
use abstract_testing::TEST_VERSION;
use anyhow::bail;
use cw_orch::{daemon::networks::PION_1, prelude::*};
use cw_orch_clone_testing::CloneTesting;
Expand Down
2 changes: 1 addition & 1 deletion interchain/modules-clone-testing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ abstract-money-market-adapter = { workspace = true, features = [
] }
# astroport = { version = "3.11.1" }
# kujira = { version = "0.8" }
astrovault = { version = "0.1.4" }
astrovault = { version = "2.0.1" }

serde = "1"
serde_json = "1"
1 change: 0 additions & 1 deletion interchain/scripts/src/bin/manual_deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use clap::Parser;
use cw_orch::{environment::NetworkInfoOwned, prelude::*};
use cw_orch_daemon::RUNTIME;
use reqwest::Url;
use tokio::runtime::Runtime;

use cw_orch::environment::ChainKind;
use cw_orch_polytone::Polytone;
Expand Down
19 changes: 11 additions & 8 deletions modules/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,21 @@ tokio = { version = "1.4", features = ["full"] }

## crates in order of publishing ## see docs/Publishing.md

abstract-adapter = { version = "0.25.0" }
abstract-app = { version = "0.25.0" }
abstract-client = { version = "0.25.0" }
abstract-interface = { version = "0.25.0" }
abstract-macros = { version = "0.25.0" }
abstract-standalone = { version = "0.25.0" }
abstract-testing = { version = "0.25.0" }
abstract-adapter = { version = "0.25.0" }
abstract-app = { version = "0.25.0" }
abstract-client = { version = "0.25.0" }
abstract-integration-tests = { version = "0.25.0" }
abstract-interface = { version = "0.25.0" }
abstract-macros = { version = "0.25.0" }
abstract-standalone = { version = "0.25.0" }
abstract-testing = { version = "0.25.0" }

abstract-adapter-utils = { version = "0.25.0" }
abstract-dex-standard = { version = "0.25.0" }
abstract-money-market-standard = { version = "0.25.0" }
abstract-staking-standard = { version = "0.25.0" }


# Integrations
abstract-astroport-adapter = { path = "../integrations/astroport-adapter", default-features = false }
abstract-astrovault-adapter = { path = "../integrations/astrovault-adapter", default-features = false }
Expand All @@ -71,7 +73,7 @@ abstract-mars-adapter = { path = "../integrations/mars-adapter", default-f
abstract-osmosis-adapter = { path = "../integrations/osmosis-adapter", default-features = false }
abstract-wyndex-adapter = { path = "../integrations/wyndex-adapter", default-features = false }

# wyndex-bundle = { path = "../integrations/bundles/wyndex" }
mockdex-bundle = { path = "../integrations/bundles/mockdex" }

## Modules
abstract-cw-staking = { path = "./contracts/adapters/cw-staking", default-features = false }
Expand All @@ -91,6 +93,7 @@ abstract-adapter-utils = { path = "../framework/packages/standards/utils
abstract-app = { path = "../framework/packages/abstract-app" }
abstract-client = { path = "../framework/packages/abstract-client" }
abstract-dex-standard = { path = "../framework/packages/standards/dex" }
abstract-integration-tests = { path = "../framework/packages/abstract-integration-tests" }
abstract-interface = { path = "../framework/packages/abstract-interface" }
abstract-macros = { path = "../framework/packages/abstract-macros" }
abstract-money-market-standard = { path = "../framework/packages/standards/money-market" }
Expand Down
14 changes: 9 additions & 5 deletions modules/contracts/adapters/cw-staking/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -97,22 +97,26 @@ cw20 = { workspace = true, optional = true }

[dev-dependencies]
abstract-adapter = { workspace = true, features = ["test-utils"] }
abstract-integration-tests = { workspace = true }
anyhow = { workspace = true }
bip32 = { version = "0.5.2" }
clap = { workspace = true }
cw-orch = { workspace = true, features = ["daemon"] }
cw-staking = { path = ".", package = "abstract-cw-staking", features = [
# "wynd",
"osmosis",
"testing",
] }
cw20 = { workspace = true }
cw20-base = { workspace = true }
dotenv = "0.15.0"
env_logger = "0.11.3"
log = "0.4.14"
mockdex-bundle = { workspace = true }
semver = { version = "1.0" }
serde-cw-value = "0.7.0"
tokio = { version = "1.4", features = ["full"] }
# wyndex-bundle = { workspace = true }
bip32 = { version = "0.5.2" }
cw20 = { workspace = true }
cw20-base = { workspace = true }

serde-cw-value = "0.7.0"
abstract-astrovault-adapter = { workspace = true, features = ["local"] }
abstract-kujira-adapter = { workspace = true, features = ["local"] }
abstract-wyndex-adapter = { workspace = true, features = ["local"] }
12 changes: 6 additions & 6 deletions modules/contracts/adapters/cw-staking/src/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ use crate::contract::StakingResult;
/// This provides superior UX in case of an IBC execution
pub(crate) fn identify_provider(value: &str) -> Result<Box<dyn Identify>, CwStakingError> {
match value {
abstract_wyndex_adapter::WYNDEX => {
Ok(Box::<abstract_wyndex_adapter::staking::WynDex>::default())
}
// TODO: revive integrations
// abstract_wyndex_adapter::WYNDEX => {
// Ok(Box::<abstract_wyndex_adapter::staking::WynDex>::default())
// }
// abstract_astroport_adapter::ASTROPORT => {
// Ok(Box::<abstract_astroport_adapter::staking::Astroport>::default())
// }
// abstract_kujira_adapter::staking::BOW => {
// Ok(Box::<abstract_kujira_adapter::staking::Bow>::default())
// }
abstract_kujira_adapter::staking::BOW => {
Ok(Box::<abstract_kujira_adapter::staking::Bow>::default())
}
abstract_osmosis_adapter::OSMOSIS => {
Ok(Box::<abstract_osmosis_adapter::staking::Osmosis>::default())
}
Expand Down
1 change: 0 additions & 1 deletion modules/contracts/adapters/cw-staking/tests/common/mod.rs

This file was deleted.

Loading

0 comments on commit bd9768c

Please sign in to comment.