-
Notifications
You must be signed in to change notification settings - Fork 20
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
feat!: Set Transaction Fee Asset on New Account #476
feat!: Set Transaction Fee Asset on New Account #476
Conversation
Crate versions that have been updated:
Runtime version has been increased. |
Codecov Report
@@ Coverage Diff @@
## master #476 +/- ##
=======================================
Coverage 83.44% 83.44%
=======================================
Files 24 24
Lines 2935 2935
=======================================
Hits 2449 2449
Misses 486 486 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks ok.
I wonder where the update of event structs should be as part of standalone PR so it can be easily tracked ( because UI needs to be aware ).
(66_923_000 as Weight) | ||
.saturating_add(T::DbWeight::get().reads(4 as Weight)) | ||
.saturating_add(T::DbWeight::get().writes(3 as Weight)) | ||
(66_005_000 as Weight) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these extra reads and writes part of our change or is this unrelated orml thing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i believe it is the extra read and write of "set fee asset" handler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jep, that's why I asked to run the weights, cause I wanted us to see the impact.
…o apopiak/set-tx-fee-asset-on-new-account
Task linked: CU-2kpe21t Set Fee Asset Id on New Account |
requires #493 (and includes its changes) |
Use the types introduced in galacticcouncil/warehouse#54 to set transaction fee asset on new account (and clean up when fee asset balance reaches zero or system account is reaped).
Description
As described in #454 we want to automatically set a user's fee asset when it makes sense to do so.
We do this by implementing a new callback introduced to orml_tokens that gets triggered whenever a new account is created for a
(asset_id, account_id)
combination. If the account id does not have a fee currency set and the asset id of the new account is an accepted fee currency, we set the user's fee currency to this new asset.Notes
The weights should be rerun because this changes the costs of creating and deleting accounts.
Related Issue
Fixes: #454
How Has This Been Tested?
Checklist: