Trait fabric_support::traits::VestingSchedule[][src]

pub trait VestingSchedule<AccountId> {
    type Moment;
    type Currency: Currency<AccountId>;
    fn vesting_balance(
        who: &AccountId
    ) -> Option<<Self::Currency as Currency<AccountId>>::Balance>;
fn add_vesting_schedule(
        who: &AccountId,
        locked: <Self::Currency as Currency<AccountId>>::Balance,
        per_block: <Self::Currency as Currency<AccountId>>::Balance,
        starting_block: Self::Moment
    ) -> DispatchResult;
fn remove_vesting_schedule(who: &AccountId); }

A vesting schedule over a currency. This allows a particular currency to have vesting limits applied to it.

Associated Types

type Moment[src]

The quantity used to denote time; usually just a BlockNumber.

type Currency: Currency<AccountId>[src]

The currency that this schedule applies to.

Loading content...

Required methods

fn vesting_balance(
    who: &AccountId
) -> Option<<Self::Currency as Currency<AccountId>>::Balance>
[src]

Get the amount that is currently being vested and cannot be transferred out of this account. Returns None if the account has no vesting schedule.

fn add_vesting_schedule(
    who: &AccountId,
    locked: <Self::Currency as Currency<AccountId>>::Balance,
    per_block: <Self::Currency as Currency<AccountId>>::Balance,
    starting_block: Self::Moment
) -> DispatchResult
[src]

Adds a vesting schedule to a given account.

If there already exists a vesting schedule for the given account, an Err is returned and nothing is updated.

Is a no-op if the amount to be vested is zero.

NOTE: This doesn’t alter the free balance of the account.

fn remove_vesting_schedule(who: &AccountId)[src]

Remove a vesting schedule for a given account.

NOTE: This doesn’t alter the free balance of the account.

Loading content...

Implementors

Loading content...