-
Notifications
You must be signed in to change notification settings - Fork 804
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactors referenda pallet to use fungible traits #1785
base: master
Are you sure you want to change the base?
Conversation
The CI pipeline was cancelled due to failure one of the required jobs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we need a migration here, so that any deposits currently 'reserved' are moved to be 'held'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
@@ -139,6 +140,7 @@ const ASSEMBLY_ID: LockIdentifier = *b"assembly"; | |||
|
|||
#[frame_support::pallet] | |||
pub mod pallet { | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
Self::deposit_event(Event::<T, I>::DepositSlashed { | ||
who, | ||
amount: amount.saturating_sub(non_slashed), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think its possible to first emit the event and use imbalance.peek()
, that makes it a bit more understandable IMHO.
{ | ||
fn on_nonzero_unbalanced(amount: Credit<<T as frame_system::Config>::AccountId, F>) { | ||
let peeked_amount = amount.peek(); | ||
let _ = F::resolve(&<Pallet<T, I>>::account_id(), amount); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this fails then the credit is just dropped correctly, or?
/// Note: replace this implementation for [`FunOnUnbalanced`] once the `Currency` traits are | ||
/// deprecated and not used anymore. | ||
impl<T: Config<I>, I: 'static> OnUnbalanced<NegativeImbalanceOf<T, I>> for Pallet<T, I> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's mark it deprecated?
Refactors the referanda pallet to use the new fungible traits.
type pallet_treasury::FunOnUnbalanced
: the treasury pallet implements a new type that handles fungible's imbalances to ensure forwards (traits::fungible
) and backwards (traits::currency
) compatibility. Once all pallets that use the treasury to handle imbalances move to fungibles, the currentimpl OnUnbalanced<NegativeImbalanceOf<T>> for Pallet
can be removed.Todo:
HoldReason
composite enum in instatiable pallets #1839: There seems to be a problem with using theHoldReason
enum composite in the context of instantiable pallets.Related to #226