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

pallet vesting / update to use fungible #1760

Draft
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

gilescope
Copy link
Contributor

@gilescope gilescope commented Sep 29, 2023

This updates the vesting pallet to use the new fungible traits rather than the now deprecated Currency and ReserveCurrency traits ( paritytech/substrate#12951 ). Partial fix of #226.

TODO:

  • before fees/tips could be paid from unvested funds.
  • add_locks in benchmark needs a rethink because RuntimeFreezeReasons isn't a [u8;8]
  • migrations

@gilescope gilescope added the T2-pallets This PR/Issue is related to a particular pallet. label Sep 29, 2023
Moment = BlockNumberFor<Self>,
Fungible = Self::Fungible,
>;
type Fungible: fungible::Inspect<Self::AccountId, Balance = Self::Balance>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
type Fungible: fungible::Inspect<Self::AccountId, Balance = Self::Balance>
type Currency: fungible::Inspect<Self::AccountId, Balance = Self::Balance>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or type NativeToken, as suggested in #226 (comment)


/// A vesting schedule over a fungible. This allows a particular fungible to have vesting limits
/// applied to it.
pub trait VestingSchedule<AccountId>: Sized {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this moved?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At a later date Currency is likely to be removed. At that point it's going to be all alone in the traits::tokens::currency namespace. Is there a better namespace for it to migrate to or should we leave it where it is for now even though it now takes a Fungible?

@JuaniRios
Copy link
Contributor

JuaniRios commented Jun 20, 2024

Any update on this? #3951 is almost merged, and if we merge this I think we can finally have vesting of pallet-assets tokens on AssetHub, which would bring a lot of added value to AssetHub

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T2-pallets This PR/Issue is related to a particular pallet.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants