This PR introduces account lifecycle callbacks to pallet-assets.
This allows reacting to the combination of asset and account id individually as opposed to the general account lifecycle of frame_system.
This is an exploratory PR to solicit feedback. Happy to adjust, fix tests and write a companion if this can move forward.
In order to use pallet-assets we would need similar hooks there.
Checklist
Polkadot companion: (if applicable)
Cumulus companion: (if applicable)
[ ] My PR includes a detailed description as outlined in the "Description" section above
[ ] My PR follows the labeling requirements of this project (at minimum one label for each A, B, C and D required)
[ ] I have made corresponding changes to the documentation (if applicable)
[x] I have added tests that prove my fix is effective or that my feature works (if applicable)
[ ] If this PR alters any external APIs or interfaces used by Polkadot, the corresponding Polkadot PR is ready as well as the corresponding Cumulus PR (optional)
This PR introduces account lifecycle callbacks to pallet-assets. This allows reacting to the combination of asset and account id individually as opposed to the general account lifecycle of
frame_system
.This is an exploratory PR to solicit feedback. Happy to adjust, fix tests and write a companion if this can move forward.
Motivation
We use orml-tokens mutation hooks to take actions on created and killed accounts, triggered here: https://github.com/open-web3-stack/open-runtime-module-library/blob/73b4ee04e402f240f270bfe83f59fc2837dbaf51/tokens/src/lib.rs#L791-L795)
in HydraDX: https://github.com/galacticcouncil/HydraDX-node/blob/24823f0e91d2dbe2bb7743404d7763d9296d7412/pallets/transaction-multi-payment/src/lib.rs#L467-L477
In order to use pallet-assets we would need similar hooks there.
Checklist
Polkadot companion: (if applicable)
Cumulus companion: (if applicable)
A
,B
,C
andD
required)