From 7967cbf641d917c21d60489c28023013bfbd6bf7 Mon Sep 17 00:00:00 2001 From: Gianfranco Tasteri Date: Tue, 19 Dec 2023 13:32:06 -0300 Subject: [PATCH] use if let with tuple --- runtime/common/src/custom_transactor.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/runtime/common/src/custom_transactor.rs b/runtime/common/src/custom_transactor.rs index 9502583aa..b426531eb 100644 --- a/runtime/common/src/custom_transactor.rs +++ b/runtime/common/src/custom_transactor.rs @@ -94,13 +94,13 @@ impl< > { fn deposit_asset(asset: &MultiAsset, location: &MultiLocation, _context: &XcmContext) -> Result { - if let Some(amount_deposited) = AutomationPalletConfigT::matches_asset(asset){ + + if let (Some(amount_deposited), Some((length, data))) = + (AutomationPalletConfigT::matches_asset(asset), AutomationPalletConfigT::matches_beneficiary(location)) { + AutomationPalletConfigT::callback(length, data, amount_deposited); + return Ok(()); + } - if let Some((length,data)) = AutomationPalletConfigT::matches_beneficiary(location){ - AutomationPalletConfigT::callback(length, data, amount_deposited); - return Ok(()); - } - } match ( AccountIdConvert::convert_ref(location), CurrencyIdConvert::convert(asset.clone()),