diff --git a/framework/packages/standards/staking/src/error.rs b/framework/packages/standards/staking/src/error.rs index d77cec412..2f98871c7 100644 --- a/framework/packages/standards/staking/src/error.rs +++ b/framework/packages/standards/staking/src/error.rs @@ -30,10 +30,19 @@ pub enum CwStakingError { IbcQueryNotSupported, #[error("Staking provider {0} is not a known provider on this network.")] - UnknownDex(String), + UnknownStaking(String), + + #[error( + "Staking provider {staking} is not a known provider on this network ({:?}).", + chain + )] + UnknownStakingOnThisPlatform { + staking: String, + chain: Option, + }, #[error("Staking provider {0} is not local to this network.")] - ForeignDex(String), + ForeignStaking(String), #[error("Cw1155 is unsupported.")] Cw1155Unsupported, diff --git a/modules/Cargo.toml b/modules/Cargo.toml index 140bd2da6..048abb717 100644 --- a/modules/Cargo.toml +++ b/modules/Cargo.toml @@ -49,7 +49,7 @@ semver = "1.0" cw-orch = { version = "0.27.0" } cw-orch-interchain = { version = "0.8.0" } -cw-orch-osmosis-test-tube = { version = "0.4.0" } +cw-orch-osmosis-test-tube = { version = "0.5.0" } cw-orch-neutron-test-tube = { version = "0.2.0" } tokio = { version = "1.4", features = ["full"] } diff --git a/modules/contracts/adapters/cw-staking/Cargo.toml b/modules/contracts/adapters/cw-staking/Cargo.toml index b4140a0f4..e9598b760 100644 --- a/modules/contracts/adapters/cw-staking/Cargo.toml +++ b/modules/contracts/adapters/cw-staking/Cargo.toml @@ -102,7 +102,7 @@ bip32 = { version = "0.5.2" } clap = { workspace = true } cw-orch = { workspace = true, features = ["daemon"] } cw-staking = { path = ".", package = "abstract-cw-staking", features = [ - # "wynd", + "wynd", "osmosis", "testing", ] } diff --git a/modules/contracts/adapters/cw-staking/src/resolver.rs b/modules/contracts/adapters/cw-staking/src/resolver.rs index c274cb24e..d20e5e558 100644 --- a/modules/contracts/adapters/cw-staking/src/resolver.rs +++ b/modules/contracts/adapters/cw-staking/src/resolver.rs @@ -27,7 +27,7 @@ pub(crate) fn identify_provider(value: &str) -> Result, CwStak abstract_astrovault_adapter::ASTROVAULT => { Ok(Box::::default()) } - _ => Err(CwStakingError::UnknownDex(value.to_string())), + _ => Err(CwStakingError::UnknownStaking(value.to_string())), } } @@ -56,7 +56,7 @@ pub(crate) fn resolve_local_provider( abstract_astrovault_adapter::ASTROVAULT => { Ok(Box::::default()) } - _ => Err(CwStakingError::ForeignDex(name.to_owned())), + _ => Err(CwStakingError::ForeignStaking(name.to_owned())), } } @@ -69,7 +69,10 @@ pub fn is_over_ibc(env: &Env, platform_name: &str) -> StakingResult<(String, boo let platform_id = identify_provider(&local_platform_name)?; // We verify the adapter is available on the current chain if !is_available_on(platform_id, env, chain_name.as_deref()) { - return Err(CwStakingError::UnknownDex(platform_name.to_string())); + return Err(CwStakingError::UnknownStakingOnThisPlatform { + staking: platform_name.to_string(), + chain: chain_name, + }); } Ok((local_platform_name, false)) } diff --git a/modules/contracts/adapters/cw-staking/tests/stake.rs b/modules/contracts/adapters/cw-staking/tests/stake.rs index 0ab2e5c7f..6935db423 100644 --- a/modules/contracts/adapters/cw-staking/tests/stake.rs +++ b/modules/contracts/adapters/cw-staking/tests/stake.rs @@ -26,7 +26,7 @@ fn setup_mock() -> anyhow::Result<( CwStakingAdapter, AccountI, )> { - let chain = MockBech32::new("mock"); + let chain = MockBech32::new_with_chain_id("mock", "cosmos-testnet-6"); let sender = chain.sender_addr(); let deployment = Abstract::deploy_on(chain.clone(), ())?; @@ -123,7 +123,7 @@ fn stake_lp() -> anyhow::Result<()> { } #[test] -fn stake_lp_wthout_chain() -> anyhow::Result<()> { +fn stake_lp_without_chain() -> anyhow::Result<()> { let (_, _, staking, account) = setup_mock()?; let account_addr = account.address()?;