Struct noble_vesting::Module[][src]

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

Vesting module declaration.

Implementations

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

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

Information regarding the vesting of a given account.

impl<T: Config> 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 Config>::Currency as Currency<<T as Config>::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]

NOTE: Calling this function will bypass origin filters.

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

Force a vested transfer.

The dispatch origin for this call must be Root.

  • source: The account whose funds should be transferred.
  • 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: 4 Reads, 4 Writes
    • Reads: Vesting Storage, Balances Locks, Target Account, Source Account
    • Writes: Vesting Storage, Balances Locks, Target Account, Source Account

NOTE: Calling this function will bypass origin filters.

Trait Implementations

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

type Call = Call<T>

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

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

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

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

impl<T: Config> GetNobleVersion for Module<T>[src]

impl<T: Config> IntegrityTest for Module<T>[src]

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

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

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

impl<T: Config> OnGenesis for Module<T>[src]

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

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

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

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

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

impl<T: Config> VestingSchedule<<T as Config>::AccountId> for Module<T> where
    <<T as Config>::Currency as Currency<<T as Config>::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 Config>::Currency as Currency<<T as Config>::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 Config>::Currency as Currency<<T as Config>::AccountId>>::Balance,
    per_block: <<T as Config>::Currency as Currency<<T as Config>::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> Downcast for T where
    T: Any

impl<T> DowncastSync for T where
    T: Any + Send + Sync

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

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

impl<T> Instrument for T[src]

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

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

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

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

Get a reference to the inner from the outer.

pub 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 + Send + Sync + Debug + Eq + PartialEq<T> + Clone
[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
    T: Bounded,
    S: TryInto<T>, 

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