-
Notifications
You must be signed in to change notification settings - Fork 861
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
Add deposit for setting session keys #7953
base: master
Are you sure you want to change the base?
Add deposit for setting session keys #7953
Conversation
…pallet. Update KeyDeposit type to use BalanceOf. Add tests for setting and purging keys to verify fund reservation and unreservation.
…undant storage reads and improve efficiency in the session pallet.
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.
we really need to deprecate unnamed reserves. should use names reserve instead
i wil l change to use named reserve instead then, but from what i can see i still need to use ReservableCurrency for the can_reserve function since NamedReservableCurrency doesnt seem to implement it |
substrate/frame/session/src/lib.rs
Outdated
type Currency: NamedReservableCurrency<Self::AccountId>; | ||
|
||
/// The reserve identifier type. | ||
type ReserveIdentifier: Get<<Self::Currency as NamedReservableCurrency<Self::AccountId>>::ReserveIdentifier> + TypeInfo + 'static; |
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.
We should directly use Holds
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 have just pushed a fix to replace Reserve by Hold instead
…functionality for key management. Update related types and events to reflect changes from reservation to holding of funds.
Description
this is for #1625
Implement reserved balance tracking for test accounts in the session pallet.
Update KeyDeposit type to use BalanceOf. Add tests for setting and purging keys to verify fund reservation and unreservation.
Update inner_set_keys to accept old keys as an argument to reduce redundant storage reads and improve efficiency in the session pallet.