-
Notifications
You must be signed in to change notification settings - Fork 300
Events in tokens
pallet do not completely cover balance changes
#726
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
Comments
Can you point out what's missing? PR are always welcome. |
I think the only event that is missing is /// Some amount was removed from the account (e.g. for misbehavior).
Slashed { who: T::AccountId, amount: T::Balance }, @xlc I can create the PR. As I see it now the event belongs into /// Currency transfer success.
Transferred {
currency_id: CurrencyIdOf<T>,
from: T::AccountId,
to: T::AccountId,
amount: BalanceOf<T>,
},
/// Update balance success.
BalanceUpdated {
currency_id: CurrencyIdOf<T>,
who: T::AccountId,
amount: AmountOf<T>,
},
/// Deposit success.
Deposited {
currency_id: CurrencyIdOf<T>,
who: T::AccountId,
amount: BalanceOf<T>,
},
/// Withdraw success.
Withdrawn {
currency_id: CurrencyIdOf<T>,
who: T::AccountId,
amount: BalanceOf<T>,
}, emitted in |
The original idea is that events are emitted by the extrinsic pallet (currencies), not the underlying implementation (tokens) so that people can decide what event to emit. But I does see it could create some inconsistency. |
I agree we should make it that only implementations emit events, and to cover all possible balance changes. In this way ORML users don't have to worry about adding events, and are always free to add custom ones if needed while wrapping these impl. The current balance related events could be updated as:
|
orml tokens now emits events whenever balance change occurs. |
Since not every change of token balance is indicated with events, it becomes immensely difficult to correctly track tokens balances in a block indexer.
I suggest to offer a complete set of events that does indicate any changes in token balances like it's done in the balances pallet.
The text was updated successfully, but these errors were encountered: