-
Notifications
You must be signed in to change notification settings - Fork 91
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
Fees API Improvement #1623
Fees API Improvement #1623
Conversation
This PR is completed and ready for review |
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.
Sweet 🍯 👌
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.
One doc request but not blocking 🙏
/// This trait can be used by pallet to just pay fees without worring about | ||
/// the value or where the fee goes. | ||
pub trait PayFee<AccountId> { | ||
fn pay(who: &AccountId) -> DispatchResult; |
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.
Given the previous discussion, I would for sure document that who
is the account that's paying for the fees and not the account that is receiving them.
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.
+1 on that. Would also be great to rename who
to payer
.
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.
Good point! Sorry for the "auto-merge", keep in mind for a future PR where I could add this 🧠
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.
Here it goes: 2901f0e
Description
Problem
The current API provided by the traits around
pallet_fees
to handle fees has two negative points:Config
trait. i.e:Solution
We can fix these 2 points by coding the whole fee action in different types (see PR code) under a new trait
PayFee
.Pallet:
Runtime: