Struct noble_treasury::Module[][src]

pub struct Module<T: Config<I>, I: Instance = DefaultInstance>(_);

Implementations

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

pub fn proposal_count() -> ProposalIndex[src]

Number of proposals that have been made.

pub fn proposals<K: EncodeLike<ProposalIndex>>(
    key: K
) -> Option<Proposal<T::AccountId, BalanceOf<T, I>>>
[src]

Proposals that have been made.

pub fn approvals() -> Vec<ProposalIndex>[src]

Proposal indices that have been approved but not yet awarded.

impl<T: Config<I>, I: Instance> Module<T, I>[src]

Can also be called using Call.

pub fn propose_spend(
    origin: T::Origin,
    value: BalanceOf<T, I>,
    beneficiary: <T::Lookup as StaticLookup>::Source
) -> DispatchResult
[src]

Put forward a suggestion for spending. A deposit proportional to the value is reserved and slashed if the proposal is rejected. It is returned once the proposal is awarded.

  • Complexity: O(1)
  • DbReads: ProposalCount, origin account
  • DbWrites: ProposalCount, Proposals, origin account

NOTE: Calling this function will bypass origin filters.

pub fn reject_proposal(
    origin: T::Origin,
    proposal_id: ProposalIndex
) -> DispatchResult
[src]

Reject a proposed spend. The original deposit will be slashed.

May only be called from T::RejectOrigin.

  • Complexity: O(1)
  • DbReads: Proposals, rejected proposer account
  • DbWrites: Proposals, rejected proposer account

NOTE: Calling this function will bypass origin filters.

pub fn approve_proposal(
    origin: T::Origin,
    proposal_id: ProposalIndex
) -> DispatchResult
[src]

Approve a proposal. At a later time, the proposal will be allocated to the beneficiary and the original deposit will be returned.

May only be called from T::ApproveOrigin.

  • Complexity: O(1).
  • DbReads: Proposals, Approvals
  • DbWrite: Approvals

NOTE: Calling this function will bypass origin filters.

impl<T: Config<I>, I: Instance> Module<T, I>[src]

pub fn account_id() -> T::AccountId[src]

The account ID of the treasury pot.

This actually does computation. If you need to keep using it, then make sure you cache the value and only call this once.

pub fn spend_funds() -> Weight[src]

Spend some money! returns number of approvals before spend.

pub fn pot() -> BalanceOf<T, I>[src]

Return the amount of money in the pot.

Trait Implementations

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

type Call = Call<T, I>

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

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

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

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

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

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

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

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

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

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

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

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

impl<T: Config<I>, I: Instance> OnUnbalanced<<<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::NegativeImbalance> for Module<T, I>[src]

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

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

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

Auto Trait Implementations

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

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

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

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

impl<T, I> UnwindSafe for Module<T, I> where
    I: UnwindSafe,
    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>,