From 2a1e58e87b14401b5b8cec16f5052f2a0041da27 Mon Sep 17 00:00:00 2001 From: bekauz Date: Fri, 14 Jul 2023 19:15:57 +0200 Subject: [PATCH] may_loading ica address in depositor tick --- contracts/depositor/src/contract.rs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/contracts/depositor/src/contract.rs b/contracts/depositor/src/contract.rs index e31d0d9e..9c93befa 100644 --- a/contracts/depositor/src/contract.rs +++ b/contracts/depositor/src/contract.rs @@ -103,12 +103,24 @@ fn try_tick(deps: ExecuteDeps, env: Env, info: MessageInfo) -> NeutronResult try_register_gaia_ica(deps, env), - ContractState::ICACreated => try_liquid_stake(deps, env, info, ica_address), - ContractState::LiquidStaked => try_receive_atom_from_ica(deps, env, info, ica_address), + ContractState::ICACreated => { + if let Some(addr) = ica_address { + try_liquid_stake(deps, env, info, addr) + } else { + Ok(Response::default()) + } + }, + ContractState::LiquidStaked => { + if let Some(addr) = ica_address { + try_receive_atom_from_ica(deps, env, info, addr) + } else { + Ok(Response::default()) + } + }, ContractState::Complete => try_completed(deps), } }