[][src]Struct pallet_vesting::Module

pub struct Module<T: Trait>(_);

Methods

impl<T: Trait + 'static> Module<T>[src]

pub fn vesting<K: EncodeLike<T::AccountId>>(
    key: K
) -> Option<VestingInfo<<<T as Trait>::Currency as Currency<<T as Trait>::AccountId>>::Balance, T::BlockNumber>>
[src]

Information regarding the vesting of a given account.

impl<T: Trait> Module<T>[src]

Can also be called using Call.

pub fn vested_transfer(
    origin: T::Origin,
    target: <T::Lookup as StaticLookup>::Source,
    schedule: VestingInfo<<<T as Trait>::Currency as Currency<<T as Trait>::AccountId>>::Balance, T::BlockNumber>
) -> DispatchResult
[src]

Create a vested transfer.

The dispatch origin for this call must be Signed.

  • target: The account that should be transferred the vested funds.
  • amount: The amount of funds to transfer and will be vested.
  • schedule: The vesting schedule attached to the transfer.

Emits VestingCreated.

  • O(1).
  • DbWeight: 3 Reads, 3 Writes
    • Reads: Vesting Storage, Balances Locks, Target Account, [Sender Account]
    • Writes: Vesting Storage, Balances Locks, Target Account, [Sender Account]
  • Benchmark: 100.3 + .365 * l µs (min square analysis)
  • Using 100 µs fixed. Assuming less than 50 locks on any user, else we may want factor in number of locks.

Trait Implementations

impl<T: Trait> Callable<T> for Module<T>[src]

type Call = Call<T>

impl<T: Clone + Trait> Clone for Module<T>[src]

impl<T: Copy + Trait> Copy for Module<T>[src]

impl<T: Trait> Debug for Module<T> where
    T: Debug
[src]

impl<T: Eq + Trait> Eq for Module<T>[src]

impl<T: Trait> ModuleErrorMetadata for Module<T>[src]

impl<T: Trait> OffchainWorker<<T as Trait>::BlockNumber> for Module<T>[src]

impl<T: Trait> OnFinalize<<T as Trait>::BlockNumber> for Module<T>[src]

impl<T: Trait> OnInitialize<<T as Trait>::BlockNumber> for Module<T>[src]

impl<T: Trait> OnRuntimeUpgrade for Module<T>[src]

impl<T: PartialEq + Trait> PartialEq<Module<T>> for Module<T>[src]

impl<T: Trait> StructuralEq for Module<T>[src]

impl<T: Trait> StructuralPartialEq for Module<T>[src]

impl<T: Trait> VestingSchedule<<T as Trait>::AccountId> for Module<T> where
    <<T as Trait>::Currency as Currency<<T as Trait>::AccountId>>::Balance: MaybeSerializeDeserialize + Debug
[src]

type Moment = T::BlockNumber

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

type Currency = T::Currency

The currency that this schedule applies to.

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

Get the amount that is currently being vested and cannot be transferred out of this account.

fn add_vesting_schedule(
    who: &T::AccountId,
    locked: <<T as Trait>::Currency as Currency<<T as Trait>::AccountId>>::Balance,
    per_block: <<T as Trait>::Currency as Currency<<T as Trait>::AccountId>>::Balance,
    starting_block: T::BlockNumber
) -> 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.

On success, a linearly reducing amount of funds will be locked. In order to realise any reduction of the lock over time as it diminishes, the account owner must use vest or vest_other.

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

fn remove_vesting_schedule(who: &T::AccountId)[src]

Remove a vesting schedule for a given account.

Auto Trait Implementations

impl<T> RefUnwindSafe for Module<T> where
    T: RefUnwindSafe

impl<T> Send for Module<T> where
    T: Send

impl<T> Sync for Module<T> where
    T: Sync

impl<T> Unpin for Module<T> where
    T: Unpin

impl<T> UnwindSafe for Module<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> CheckedConversion for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, Outer> IsWrappedBy<Outer> for T where
    Outer: AsRef<T> + AsMut<T> + From<T>,
    T: From<Outer>, 

fn from_ref(outer: &Outer) -> &T

Get a reference to the inner from the outer.

fn from_mut(outer: &mut Outer) -> &mut T

Get a mutable reference to the inner from the outer.

impl<T> MaybeDebug for T where
    T: Debug

impl<T> MaybeDebug for T where
    T: Debug

impl<T> MaybeRefUnwindSafe for T where
    T: RefUnwindSafe

impl<T> Member for T where
    T: 'static + Clone + PartialEq<T> + Eq + Send + Sync + Debug
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> SaturatedConversion for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<S, T> UncheckedInto<T> for S where
    T: UncheckedFrom<S>, 

impl<T, S> UniqueSaturatedInto<T> for S where
    S: TryInto<T>,
    T: Bounded

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,