Skip to content
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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Krayt78
Copy link
Contributor

@Krayt78 Krayt78 commented Mar 18, 2025

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.

Krayt78 added 3 commits March 18, 2025 09:44
…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.
Copy link
Contributor

@xlc xlc left a 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

@Krayt78
Copy link
Contributor Author

Krayt78 commented Mar 18, 2025

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

Comment on lines 446 to 449
type Currency: NamedReservableCurrency<Self::AccountId>;

/// The reserve identifier type.
type ReserveIdentifier: Get<<Self::Currency as NamedReservableCurrency<Self::AccountId>>::ReserveIdentifier> + TypeInfo + 'static;
Copy link
Member

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

Copy link
Contributor Author

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.
@paritytech-review-bot paritytech-review-bot bot requested a review from a team March 18, 2025 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants