Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Introduce OnReapAccount #4585

Merged
merged 10 commits into from
Jan 10, 2020

Conversation

shawntabrizi
Copy link
Member

When writing a FRAME pallet, I found myself wanting access to an OnReapAccount trait which signals to my module when an account is fully reaped from the system.

I could imagine that such a trait could be regularly used by other pallets (maybe even our own) to ensure that when an account is reaped, all possible storage items for that account are cleaned up.

The only main change here besides the introduction of this new trait is actually using it for cleaning up the AccountNonce in the system module. Before, we were removing AccountNonce within the balances pallet, but now we will actually clean it up properly using this trait. This may beniefit other pallet creators who want to create alternatives to our balances module.

Open to feedback about why this is a good or bad idea.

@shawntabrizi shawntabrizi added the A3-in_progress Pull request is in progress. No review needed at this stage. label Jan 9, 2020
Copy link
Member

@gavofyork gavofyork left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@shawntabrizi
Copy link
Member Author

Companion PR for Polkadot: paritytech/polkadot#748

@shawntabrizi shawntabrizi added A8-looksgood and removed A3-in_progress Pull request is in progress. No review needed at this stage. labels Jan 9, 2020
@gavofyork gavofyork merged commit f1cc671 into paritytech:master Jan 10, 2020
@shawntabrizi shawntabrizi deleted the shawntabrizi-on-reap-account branch January 10, 2020 03:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants