Skip to content

Commit

Permalink
Slpx adds InsufficientAssets event (#1233)
Browse files Browse the repository at this point in the history
  • Loading branch information
hqwangningbo authored Apr 25, 2024
1 parent b041b5a commit d7452a6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pallets/slpx/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ pub mod pallet {
OrderFailed {
order: Order<AccountIdOf<T>, CurrencyIdOf<T>, BalanceOf<T>, BlockNumberFor<T>>,
},
InsufficientAssets,
}

#[pallet::error]
Expand Down Expand Up @@ -372,11 +373,14 @@ pub mod pallet {

// Will not check results and will be sent regardless of the success of
// the burning
let _ = T::MultiCurrency::withdraw(
let result = T::MultiCurrency::withdraw(
target_fee_currency_id,
&T::TreasuryAccount::get(),
BalanceOf::<T>::unique_saturated_from(configuration.xcm_fee),
);
if result.is_err() {
Self::deposit_event(Event::InsufficientAssets);
}

configuration.last_block = n;
XcmEthereumCallConfiguration::<T>::put(configuration);
Expand Down

0 comments on commit d7452a6

Please sign in to comment.