Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions xcm/pallet-xcm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1691,8 +1691,16 @@ impl<T: Config> xcm_executor::traits::Enact for UnlockTicket<T> {
locks.swap_remove(remove_index);
}
LockedFungibles::<T>::insert(&self.sovereign_account, locks);
let reasons = WithdrawReasons::all();
T::Currency::set_lock(*b"py/xcmlk", &self.sovereign_account, locked, reasons);

// A locked value of zero means we do not have any outstanding locks anymore
// in the LockedFungibles storage for this sovereign account.
// We can then remove the `xcmlk` lock from this account.
if locked.is_zero() {
T::Currency::remove_lock(*b"py/xcmlk", &self.sovereign_account);
} else {
let reasons = WithdrawReasons::all();
T::Currency::set_lock(*b"py/xcmlk", &self.sovereign_account, locked, reasons);
}
Ok(())
}
}
Expand Down