Introduce OnNewTokenAccount and OnKilledTokenAccount Callbacks#754
Introduce OnNewTokenAccount and OnKilledTokenAccount Callbacks#754shaunxw merged 12 commits intoopen-web3-stack:masterfrom
OnNewTokenAccount and OnKilledTokenAccount Callbacks#754Conversation
|
Aside: I was confused I had to include the changes in 34f50fc as they did not seem to have anything to do with this PR. Broken |
Update your Cargo.toml. That's due to bumping Substrate version |
traits/src/currency.rs
Outdated
| } | ||
|
|
||
| /// Handler for a newly created account | ||
| pub trait OnNewTokenAccount<AccountId, CurrencyId> { |
There was a problem hiding this comment.
I don't really like the idea of bunch different traits for each individual purposes.
I think we can just reuse Happened<(&AccountId, CurrencyId)> instead.
Otherwise we can have trait OnAccountUpdated { fn updated }
There was a problem hiding this comment.
Have a look. Not sure how I would get around the who.clone() induced by the change to Happened
|
can you revert the |
This reverts commit 34f50fc.
…le-library into apopiak/on-new-account
|
CI failed, Blocked: paritytech/substrate#11608 |
|
@apopiak please merge master to fix the CI. |
…le-library into apopiak/on-new-account
…ime-module-library into apopiak/on-new-account
It would be useful for some features to be able to react to account creation in the tokens pallet that includes the currency for which an account was created.
This PR thus introduces an
OnNewTokenAccount(and correspondingOnKilledTokenAccount) callback to the pallet for other pallets to integrate with.