From e8f2a52d96c4124e6c667ca1efa12db15a99706b Mon Sep 17 00:00:00 2001 From: adairrr <32375605+adairrr@users.noreply.github.com> Date: Sat, 7 Oct 2023 10:52:28 +0300 Subject: [PATCH] Delete unused handlers --- framework/scripts/src/bin/full_deploy.rs | 2 +- .../apps/betting/src/handlers/instantiate.rs | 37 +--------------- .../apps/betting/src/handlers/mod.rs | 3 -- .../apps/betting/src/handlers/receive.rs | 43 ------------------- .../apps/betting/src/handlers/reply.rs | 27 ------------ .../contracts/apps/etf/src/handlers/mod.rs | 4 -- 6 files changed, 2 insertions(+), 114 deletions(-) delete mode 100644 modules/contracts/apps/betting/src/handlers/receive.rs delete mode 100644 modules/contracts/apps/betting/src/handlers/reply.rs diff --git a/framework/scripts/src/bin/full_deploy.rs b/framework/scripts/src/bin/full_deploy.rs index 682b8ffa24..4ebf0fe03f 100644 --- a/framework/scripts/src/bin/full_deploy.rs +++ b/framework/scripts/src/bin/full_deploy.rs @@ -10,6 +10,7 @@ use abstract_interface::{Abstract, VersionControl}; use abstract_interface_scripts::{assert_wallet_balance, DeploymentStatus, SUPPORTED_CHAINS}; use clap::Parser; +use cw_orch::daemon::{ChainKind, NetworkInfo}; use cw_orch::{ deploy::Deploy, prelude::{ @@ -17,7 +18,6 @@ use cw_orch::{ *, }, }; -use cw_orch::daemon::{ChainKind, NetworkInfo}; use tokio::runtime::Runtime; pub const ABSTRACT_VERSION: &str = env!("CARGO_PKG_VERSION"); diff --git a/modules/contracts/apps/betting/src/handlers/instantiate.rs b/modules/contracts/apps/betting/src/handlers/instantiate.rs index 405489ac50..f9af2422bd 100644 --- a/modules/contracts/apps/betting/src/handlers/instantiate.rs +++ b/modules/contracts/apps/betting/src/handlers/instantiate.rs @@ -11,7 +11,7 @@ pub const INSTANTIATE_REPLY_ID: u64 = 1u64; pub fn instantiate_handler( deps: DepsMut, - env: Env, + _env: Env, _info: MessageInfo, app: BetApp, msg: BetInstantiateMsg, @@ -26,40 +26,5 @@ pub fn instantiate_handler( config.validate(deps.as_ref())?; CONFIG.save(deps.storage, &config)?; - - // let lp_token_name: String = msg - // .token_name - // .unwrap_or_else(|| String::from(DEFAULT_LP_TOKEN_NAME)); - // - // let lp_token_symbol: String = msg - // .token_symbol - // .unwrap_or_else(|| String::from(DEFAULT_LP_TOKEN_SYMBOL)); - - // RAKE.save(deps.storage, &Fee::new(msg.fee)?)?; Ok(app.tag_response(Response::new(), "instantiate")) - - // Ok(Response::new().add_submessage(SubMsg { - // // Create LP token - // msg: WasmMsg::Instantiate { - // admin: None, - // code_id: msg.token_code_id, - // msg: to_binary(&TokenInstantiateMsg { - // name: lp_token_name.clone(), - // symbol: lp_token_symbol, - // decimals: 6, - // initial_balances: vec![], - // mint: Some(MinterResponse { - // minter: env.contract.address.to_string(), - // cap: None, - // }), - // marketing: None, - // })?, - // funds: vec![], - // label: format!("Abstract ETF Shares: {}", lp_token_name), - // } - // .into(), - // gas_limit: None, - // id: INSTANTIATE_REPLY_ID, - // reply_on: ReplyOn::Success, - // })) } diff --git a/modules/contracts/apps/betting/src/handlers/mod.rs b/modules/contracts/apps/betting/src/handlers/mod.rs index d340b3757a..9fdeee53c6 100644 --- a/modules/contracts/apps/betting/src/handlers/mod.rs +++ b/modules/contracts/apps/betting/src/handlers/mod.rs @@ -5,10 +5,7 @@ pub mod execute; pub mod instantiate; pub mod query; -pub mod receive; -pub mod reply; pub use crate::handlers::{ execute::execute_handler, instantiate::instantiate_handler, query::query_handler, - // receive::receive_cw20, reply::*, }; diff --git a/modules/contracts/apps/betting/src/handlers/receive.rs b/modules/contracts/apps/betting/src/handlers/receive.rs deleted file mode 100644 index 0b7d15dada..0000000000 --- a/modules/contracts/apps/betting/src/handlers/receive.rs +++ /dev/null @@ -1,43 +0,0 @@ -// use crate::contract::{BetApp, EtfResult}; -// use crate::error::BetError; -// use crate::handlers::execute; -// use crate::msg::Cw20HookMsg; -// use crate::state::{State, STATE}; -// use cosmwasm_std::from_binary; -// use cosmwasm_std::DepsMut; -// use cosmwasm_std::{Env, MessageInfo}; -// use cw20::Cw20ReceiveMsg; -// use cw_asset::Asset; -// use cw_asset::AssetInfo; -// -// /// handler function invoked when the vault dapp contract receives -// /// a transaction. In this case it is triggered when either a LP tokens received -// /// by the contract or when the deposit asset is a cw20 asset. -// pub fn receive_cw20( -// deps: DepsMut, -// env: Env, -// msg_info: MessageInfo, -// dapp: BetApp, -// cw20_msg: Cw20ReceiveMsg, -// ) -> EtfResult { -// match from_binary(&cw20_msg.msg)? { -// Cw20HookMsg::Claim {} => { -// let state: State = STATE.load(deps.storage)?; -// if msg_info.sender != state.share_token_address { -// return Err(BetError::NotLPToken { -// token: msg_info.sender.to_string(), -// }); -// } -// let sender = deps.as_ref().api.addr_validate(&cw20_msg.sender)?; -// execute::try_withdraw_liquidity(deps, env, dapp, sender, cw20_msg.amount) -// } -// Cw20HookMsg::Deposit {} => { -// // Construct deposit asset -// let asset = Asset { -// info: AssetInfo::Cw20(msg_info.sender.clone()), -// amount: cw20_msg.amount, -// }; -// execute::try_provide_liquidity(deps, msg_info, dapp, asset, Some(cw20_msg.sender)) -// } -// } -// } diff --git a/modules/contracts/apps/betting/src/handlers/reply.rs b/modules/contracts/apps/betting/src/handlers/reply.rs deleted file mode 100644 index 12ddf3d503..0000000000 --- a/modules/contracts/apps/betting/src/handlers/reply.rs +++ /dev/null @@ -1,27 +0,0 @@ -// use crate::contract::{BetApp, EtfResult}; -// use crate::response::MsgInstantiateContractResponse; -// use crate::state::STATE; -// use abstract_sdk::features::AbstractResponse; -// use cosmwasm_std::{DepsMut, Env, Reply, Response, StdError, StdResult}; -// use protobuf::Message; -// -// pub fn instantiate_reply(deps: DepsMut, _env: Env, etf: BetApp, reply: Reply) -> EtfResult { -// let data = reply.result.unwrap().data.unwrap(); -// let res: MsgInstantiateContractResponse = -// Message::parse_from_bytes(data.as_slice()).map_err(|_| { -// StdError::parse_err("MsgInstantiateContractResponse", "failed to parse data") -// })?; -// let share_token_address = res.get_contract_address(); -// -// let api = deps.api; -// STATE.update(deps.storage, |mut meta| -> StdResult<_> { -// meta.share_token_address = api.addr_validate(share_token_address)?; -// Ok(meta) -// })?; -// -// Ok(etf.custom_tag_response( -// Response::default(), -// "instantiate_reply", -// vec![("share_token_address", share_token_address)], -// )) -// } diff --git a/modules/contracts/apps/etf/src/handlers/mod.rs b/modules/contracts/apps/etf/src/handlers/mod.rs index a96f05edef..574fc8f5e4 100644 --- a/modules/contracts/apps/etf/src/handlers/mod.rs +++ b/modules/contracts/apps/etf/src/handlers/mod.rs @@ -1,7 +1,3 @@ -// pub mod execute; -// pub mod instantiate; -// pub mod migrate; -// pub mod query; pub mod execute; pub mod instantiate; pub mod query;