diff --git a/contracts/ecosystem/andromeda-vault/Cargo.toml b/contracts/ecosystem/andromeda-vault/Cargo.toml index 930382ab8..318a62441 100644 --- a/contracts/ecosystem/andromeda-vault/Cargo.toml +++ b/contracts/ecosystem/andromeda-vault/Cargo.toml @@ -18,7 +18,7 @@ semver = { workspace = true } cw-utils = { workspace = true } andromeda-ecosystem = { workspace = true } -andromeda-std = { workspace = true, features = ["withdraw"] } +andromeda-std = { workspace = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] cw-multi-test = { version = "0.16.0", optional = true } diff --git a/contracts/ecosystem/andromeda-vault/src/contract.rs b/contracts/ecosystem/andromeda-vault/src/contract.rs index 0e9db1149..6e5bb780a 100644 --- a/contracts/ecosystem/andromeda-vault/src/contract.rs +++ b/contracts/ecosystem/andromeda-vault/src/contract.rs @@ -10,7 +10,7 @@ use andromeda_std::amp::{AndrAddr, Recipient}; use andromeda_std::common::context::ExecuteContext; use andromeda_std::{ ado_base::withdraw::{Withdrawal, WithdrawalType}, - ado_base::{AndromedaMsg, AndromedaQuery, InstantiateMsg as BaseInstantiateMsg}, + ado_base::{AndromedaQuery, InstantiateMsg as BaseInstantiateMsg}, error::{from_semver, ContractError}, }; @@ -313,7 +313,7 @@ pub fn withdraw_strategy( } let addr = addr_opt.unwrap(); - let withdraw_exec = to_binary(&AndromedaMsg::Withdraw { + let withdraw_exec = to_binary(&ExecuteMsg::Withdraw { recipient: Some(recipient), tokens_to_withdraw: Some(withdrawals), })?; diff --git a/contracts/ecosystem/andromeda-vault/src/testing/mod.rs b/contracts/ecosystem/andromeda-vault/src/testing/mod.rs index 369c38b2f..04ba6e92b 100644 --- a/contracts/ecosystem/andromeda-vault/src/testing/mod.rs +++ b/contracts/ecosystem/andromeda-vault/src/testing/mod.rs @@ -11,7 +11,6 @@ use andromeda_std::amp::{AndrAddr, Recipient}; use andromeda_std::testing::mock_querier::MOCK_KERNEL_CONTRACT; use andromeda_std::{ ado_base::withdraw::{Withdrawal, WithdrawalType}, - ado_base::AndromedaMsg, error::ContractError, }; use cosmwasm_std::attr; @@ -737,7 +736,7 @@ fn test_withdraw_single_strategy() { }; let res = execute(deps.as_mut(), env, info, msg).unwrap(); - let withdraw_exec = to_binary(&AndromedaMsg::Withdraw { + let withdraw_exec = to_binary(&ExecuteMsg::Withdraw { recipient: Some(Recipient::from_string("depositor")), tokens_to_withdraw: Some(withdrawals), }) diff --git a/packages/andromeda-ecosystem/src/vault.rs b/packages/andromeda-ecosystem/src/vault.rs index 36b8129b6..ac8750d6a 100644 --- a/packages/andromeda-ecosystem/src/vault.rs +++ b/packages/andromeda-ecosystem/src/vault.rs @@ -110,6 +110,16 @@ pub enum ExecuteMsg { strategy: StrategyType, address: AndrAddr, }, + // Originally was an Andromeda Msg + Withdraw { + recipient: Option, + tokens_to_withdraw: Option>, + }, + // Originally was an Andromeda Msg + Deposit { + recipient: Option<::andromeda_std::amp::AndrAddr>, + msg: Option<::cosmwasm_std::Binary>, + }, } #[andr_query] diff --git a/packages/std/Cargo.toml b/packages/std/Cargo.toml index 76b0f3419..690861cd9 100644 --- a/packages/std/Cargo.toml +++ b/packages/std/Cargo.toml @@ -7,7 +7,6 @@ description = "The standard library for creating an Andromeda Digital Object" license = "MIT" [features] -withdraw = ["andromeda-macros/withdraw"] primitive = [] modules = ["andromeda-macros/modules"] module_hooks = ["andromeda-macros/module_hooks"] diff --git a/packages/std/macros/Cargo.toml b/packages/std/macros/Cargo.toml index 5711aa459..08e054905 100644 --- a/packages/std/macros/Cargo.toml +++ b/packages/std/macros/Cargo.toml @@ -11,7 +11,6 @@ proc-macro = true [features] modules = [] -withdraw = [] module_hooks = [] [dependencies] diff --git a/packages/std/macros/src/lib.rs b/packages/std/macros/src/lib.rs index 1bf034f46..7e7bf8d46 100644 --- a/packages/std/macros/src/lib.rs +++ b/packages/std/macros/src/lib.rs @@ -77,26 +77,6 @@ pub fn andr_exec(_args: TokenStream, input: TokenStream) -> TokenStream { .into(), ) } - - #[cfg(feature = "withdraw")] - { - merged = merge_variants( - merged, - quote! { - enum Right { - Deposit { - recipient: Option<::andromeda_std::amp::AndrAddr>, - msg: Option<::cosmwasm_std::Binary>, - }, - Withdraw { - recipient: Option<::andromeda_std::amp::Recipient>, - tokens_to_withdraw: Option>, - }, - } - } - .into(), - ) - } let input = parse_macro_input!(merged); TokenStream::from(andr_exec_derive(input).into_token_stream()) } diff --git a/packages/std/src/ado_base/mod.rs b/packages/std/src/ado_base/mod.rs index 0b09e4f87..995a541b3 100644 --- a/packages/std/src/ado_base/mod.rs +++ b/packages/std/src/ado_base/mod.rs @@ -9,13 +9,9 @@ pub mod permissioning; pub mod version; pub mod withdraw; -#[cfg(feature = "withdraw")] -use crate::ado_base::withdraw::Withdrawal; -#[cfg(feature = "withdraw")] -use crate::amp::recipient::Recipient; use crate::amp::{messages::AMPPkt, AndrAddr}; use cosmwasm_schema::{cw_serde, QueryResponses}; -use cosmwasm_std::{Addr, Binary}; +use cosmwasm_std::Addr; pub use modules::Module; #[cfg(feature = "modules")] @@ -41,11 +37,6 @@ pub enum AndromedaMsg { UpdateKernelAddress { address: Addr, }, - #[cfg(feature = "withdraw")] - Withdraw { - recipient: Option, - tokens_to_withdraw: Option>, - }, #[cfg(feature = "modules")] RegisterModule { module: Module, @@ -59,10 +50,6 @@ pub enum AndromedaMsg { module_idx: Uint64, module: Module, }, - Deposit { - recipient: Option, - msg: Option, - }, #[serde(rename = "amp_receive")] AMPReceive(AMPPkt), Permissioning(PermissioningMessage), @@ -91,7 +78,6 @@ pub enum AndromedaQuery { #[cfg(feature = "modules")] #[returns(Vec)] ModuleIds {}, - #[cfg(feature = "withdraw")] #[returns(::cosmwasm_std::BalanceResponse)] Balance { address: AndrAddr }, #[returns(Vec)] diff --git a/packages/std/src/ado_contract/execute.rs b/packages/std/src/ado_contract/execute.rs index 2e66f6cfc..1989f45d3 100644 --- a/packages/std/src/ado_contract/execute.rs +++ b/packages/std/src/ado_contract/execute.rs @@ -57,11 +57,6 @@ impl<'a> ADOContract<'a> { AndromedaMsg::UpdateKernelAddress { address } => { self.update_kernel_address(ctx.deps, ctx.info, address) } - #[cfg(feature = "withdraw")] - AndromedaMsg::Withdraw { - recipient, - tokens_to_withdraw, - } => self.execute_withdraw(ctx, recipient, tokens_to_withdraw), #[cfg(feature = "modules")] AndromedaMsg::RegisterModule { module } => { self.validate_module_address(&ctx.deps.as_ref(), &module)?; @@ -83,7 +78,6 @@ impl<'a> ADOContract<'a> { } AndromedaMsg::Permissioning(msg) => self.execute_permissioning(ctx, msg), AndromedaMsg::AMPReceive(_) => panic!("AMP Receive should be handled separately"), - AndromedaMsg::Deposit { .. } => Err(ContractError::NotImplemented { msg: None }), }, _ => Err(ContractError::NotImplemented { msg: None }), } diff --git a/packages/std/src/ado_contract/mod.rs b/packages/std/src/ado_contract/mod.rs index 7cb6a79e6..777f8d563 100644 --- a/packages/std/src/ado_contract/mod.rs +++ b/packages/std/src/ado_contract/mod.rs @@ -9,7 +9,5 @@ mod ownership; pub mod permissioning; mod query; pub mod state; -#[cfg(feature = "withdraw")] -pub mod withdraw; pub use crate::ado_contract::state::ADOContract; diff --git a/packages/std/src/ado_contract/state.rs b/packages/std/src/ado_contract/state.rs index b47384d3c..54b8e20d7 100644 --- a/packages/std/src/ado_contract/state.rs +++ b/packages/std/src/ado_contract/state.rs @@ -1,8 +1,6 @@ #[cfg(feature = "modules")] use crate::ado_base::modules::Module; use cosmwasm_std::Addr; -#[cfg(feature = "withdraw")] -use cw_asset::AssetInfo; use cw_storage_plus::{Item, Map}; pub struct ADOContract<'a> { @@ -17,8 +15,6 @@ pub struct ADOContract<'a> { pub(crate) module_info: Map<'a, &'a str, Module>, #[cfg(feature = "modules")] pub(crate) module_idx: Item<'a, u64>, - #[cfg(feature = "withdraw")] - pub withdrawable_tokens: Map<'a, &'a str, AssetInfo>, } impl<'a> Default for ADOContract<'a> { @@ -35,8 +31,6 @@ impl<'a> Default for ADOContract<'a> { module_info: Map::new("andr_modules"), #[cfg(feature = "modules")] module_idx: Item::new("andr_module_idx"), - #[cfg(feature = "withdraw")] - withdrawable_tokens: Map::new("withdrawable_tokens"), } } }