-
Notifications
You must be signed in to change notification settings - Fork 857
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
Add Missing Events for Balances Pallet #7250
base: master
Are you sure you want to change the base?
Conversation
substrate/frame/balances/src/lib.rs
Outdated
/// Some balance of who is currently being held. | ||
Holding { reason: T::RuntimeHoldReason, who: T::AccountId, amount: T::Balance }, | ||
/// Some balance of who has been released. | ||
Released { reason: T::RuntimeHoldReason, who: T::AccountId, amount: T::Balance } |
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.
may be?
/// Some balance of who is currently being held. | |
Holding { reason: T::RuntimeHoldReason, who: T::AccountId, amount: T::Balance }, | |
/// Some balance of who has been released. | |
Released { reason: T::RuntimeHoldReason, who: T::AccountId, amount: T::Balance } | |
/// Some balance was placed on hold. | |
Held { reason: T::RuntimeHoldReason, who: T::AccountId, amount: T::Balance }, | |
/// Some balance was released from hold. | |
Released { reason: T::RuntimeHoldReason, who: T::AccountId, amount: T::Balance } |
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.
Done
Any update on this? |
Why draft? Is it okay to review? |
@@ -62,7 +64,7 @@ impl<B: Balance, OnDrop: HandleImbalanceDrop<B>, OppositeOnDrop: HandleImbalance | |||
{ | |||
fn drop(&mut self) { | |||
if !self.amount.is_zero() { | |||
OnDrop::handle(self.amount) | |||
OnDrop::handle(self.amount) // here. |
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.
what is here?
fn done_release(reason: &Self::Reason, who: &T::AccountId, amount: Self::Balance) { | ||
Self::deposit_event(Event::<T, I>::Released { reason: *reason, who: who.clone(), 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.
let's implement all of them no?
fn done_hold(_reason: &Self::Reason, _who: &AccountId, _amount: Self::Balance) {}
fn done_release(_reason: &Self::Reason, _who: &AccountId, _amount: Self::Balance) {}
fn done_burn_held(_reason: &Self::Reason, _who: &AccountId, _amount: Self::Balance) {}
fn done_transfer_on_hold(
_reason: &Self::Reason,
_source: &AccountId,
_dest: &AccountId,
_amount: Self::Balance,
) {
}
fn done_transfer_and_hold(
_reason: &Self::Reason,
_source: &AccountId,
_dest: &AccountId,
_transferred: Self::Balance,
) {
}
@@ -343,6 +350,20 @@ impl<T: Config<I>, I: 'static> fungible::MutateFreeze<T::AccountId> for Pallet<T | |||
} | |||
} | |||
|
|||
impl<T: Config<I>, I: 'static> HandleImbalanceDrop<T::Balance> for fungible::DecreaseIssuance<T::AccountId, 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.
Either you make fungible::DecreaseIssuance
generic over the event, or you need to recreate an implementation of HandleImbalanceDrop
here to a new type only for pallet-balances
.
Because this will not compile.
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.
We can implement for PositiveImbalance
and NegativeImbalance
Attempts to resolve #6974