-
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 #6974
Comments
Hello @muharem As per my investigation: Hold & Release Events impl<T: Config<I>, I: 'static> fungible::MutateHold<T::AccountId> for Pallet<T, I> {
fn done_hold(reason: &Self::Reason, who: &T::AccountId, amount: Self::Balance) {
Self::deposit_event(Event::<T, I>::Holding { reason: *reason, who: who.clone(), amount });
}
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 });
}
} |
left comment in the PR. how about burn and mint? |
Burnfn done_settle(who: &T::AccountId, amount: Self::Balance, dust: &Self::Balance) {
if dust.is_zero() {
Self::deposit_event(Event::<T, I>::Burned { who: who.clone(), amount: amount.clone() });
} else {
Self::deposit_event(Event::<T, I>::BurnedWithDust { who: who.clone(), amount: amount.clone(), dust: *dust});
}
} Mintfn done_resolve(who: &T::AccountId, amount: Self::Balance) {
Self::deposit_event(Event::<T, I>::Minted { who: who.clone(), amount })
} @muharem looking for other instances of missing events. |
@Doordashcon its not correct. settle is not burn and resolve is not mint. you can do both without burning and minting. also I think it does not really matter if you burn 10 as amount and 0.1 as dust. you just burned 10.1 |
@Doordashcon let me know if something is not clear. I think these events publishing should be integrated into the on drops impls of |
This a bit unclear, if the Drops handle TotalIssuance adjustments, should the event emitted be |
in my option |
Any update on this? |
This week @Yung-Beef |
There are cases in the Balances pallet where events are missing, which might impact systems relying on balance updates for accounting. The known cases include:
fungible
trait impl forHold
/Release
operations:No events are emitted when a balance is placed on hold or released.
Burn
/Mint
Events forCredit
/Debt
dropsWhen
Credit
orDebt
fungible
types are dropped, the total issuance is adjusted, but noBurn
orMint
events are published.Please verify these cases and check if any other major events are missing in the Balances pallet.
The text was updated successfully, but these errors were encountered: