Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Update frame/nis/src/lib.rs
  • Loading branch information
gavofyork authored Jan 16, 2023
commit ffb0f8d3c82b44c037c1504d136bb5ba80bb7ed3
19 changes: 12 additions & 7 deletions frame/nis/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -729,13 +729,18 @@ pub mod pallet {
//
// This will legitimately fail if there is no pot account in existance.
// There's nothing we can do about this so we just swallow the error.
/*let _ = T::Currency::repatriate_reserved_named(
&T::ReserveId::get(),
&who,
&our_account,
excess,
BalanceStatus::Free,
).defensive();*/
// This code is not ideal and could fail in the second phase leaving
// the system in an invalid state. It can be fixed properly with the
// new API in https://github.com/paritytech/substrate/pull/12951
//
// Below is what it should look like then:
// let _ = T::Currency::repatriate_reserved_named(
// &T::ReserveId::get(),
// &who,
// &our_account,
// excess,
// BalanceStatus::Free,
// ).defensive();
T::Currency::unreserve_named(&T::ReserveId::get(), &who, on_hold);
// It could theoretically be locked, so really we should be using a more
// forceful variant. But the alternative `repatriate_reserved_named` will
Expand Down