Struct pallet_escrow::pallet::Pallet
source · [−]pub struct Pallet<T>(_);
Expand description
The pallet implementing the on-chain logic.
Implementations
sourceimpl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn create_escrow(origin: OriginFor<T>) -> DispatchResult
pub fn create_escrow(origin: OriginFor<T>) -> DispatchResult
A dispatchable to create an escrow
sourcepub fn fund_escrow(
origin: OriginFor<T>,
escrow_id: T::AccountId,
amount: BalanceOf<T>
) -> DispatchResult
pub fn fund_escrow(
origin: OriginFor<T>,
escrow_id: T::AccountId,
amount: BalanceOf<T>
) -> DispatchResult
A dispatchable to fund an escrow
sourcepub fn payout_escrow(
origin: OriginFor<T>,
payee: T::AccountId,
escrow_id: T::AccountId,
amount: BalanceOf<T>
) -> DispatchResult
pub fn payout_escrow(
origin: OriginFor<T>,
payee: T::AccountId,
escrow_id: T::AccountId,
amount: BalanceOf<T>
) -> DispatchResult
A dispatchable to payout from an escrow –This functionality may be limitted to payouts from RFPs only once the RFP pallet is implemented
sourcepub fn close_escrow(
origin: OriginFor<T>,
escrow_id: T::AccountId
) -> DispatchResult
pub fn close_escrow(
origin: OriginFor<T>,
escrow_id: T::AccountId
) -> DispatchResult
A dispatchable to close an escrow
sourcepub fn enable_open_contribution(
origin: OriginFor<T>,
escrow_id: T::AccountId
) -> DispatchResult
pub fn enable_open_contribution(
origin: OriginFor<T>,
escrow_id: T::AccountId
) -> DispatchResult
Dispatchable which allows an escrow admin to open an account for contributions from non admins
sourcepub fn disable_open_contribution(
origin: OriginFor<T>,
escrow_id: T::AccountId
) -> DispatchResult
pub fn disable_open_contribution(
origin: OriginFor<T>,
escrow_id: T::AccountId
) -> DispatchResult
Dispatchable which allows an escrow admin to disable contributions from non admins to the locked escrow funds.
sourcepub fn freeze_escrow(
origin: OriginFor<T>,
escrow_id: T::AccountId
) -> DispatchResult
pub fn freeze_escrow(
origin: OriginFor<T>,
escrow_id: T::AccountId
) -> DispatchResult
Dispatchable which allows an escrow admin to freeze an escrow
sourcepub fn thaw_escrow(
origin: OriginFor<T>,
escrow_id: T::AccountId
) -> DispatchResult
pub fn thaw_escrow(
origin: OriginFor<T>,
escrow_id: T::AccountId
) -> DispatchResult
Dispatchable which allows an escrow admin to thaw an escrow
sourcepub fn add_admin(
origin: OriginFor<T>,
new_admin: T::AccountId,
escrow_id: T::AccountId
) -> DispatchResult
pub fn add_admin(
origin: OriginFor<T>,
new_admin: T::AccountId,
escrow_id: T::AccountId
) -> DispatchResult
A dispatchable to add an administrator
sourcepub fn remove_admin(
origin: OriginFor<T>,
admin_to_remove: T::AccountId,
escrow_id: T::AccountId
) -> DispatchResult
pub fn remove_admin(
origin: OriginFor<T>,
admin_to_remove: T::AccountId,
escrow_id: T::AccountId
) -> DispatchResult
A dispatchable to remove an administrator
sourceimpl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
pub fn escrow<KArg>(k: KArg) -> Option<EscrowDetails<T::AccountId, T>> where
KArg: EncodeLike<T::AccountId>,
sourceimpl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
pub fn administrator<KArg1, KArg2>(
k1: KArg1,
k2: KArg2
) -> Option<T::BlockNumber> where
KArg1: EncodeLike<T::AccountId>,
KArg2: EncodeLike<T::AccountId>,
Trait Implementations
sourceimpl<T: Config> GetStorageVersion for Pallet<T>
impl<T: Config> GetStorageVersion for Pallet<T>
sourcefn current_storage_version() -> StorageVersion
fn current_storage_version() -> StorageVersion
Returns the current storage version as supported by the pallet.
sourcefn on_chain_storage_version() -> StorageVersion
fn on_chain_storage_version() -> StorageVersion
Returns the on-chain storage version of the pallet as stored in the storage.
sourceimpl<T: Config> Hooks<<T as Config>::BlockNumber> for Pallet<T>
impl<T: Config> Hooks<<T as Config>::BlockNumber> for Pallet<T>
sourcefn on_finalize(_n: BlockNumber)
fn on_finalize(_n: BlockNumber)
The block is being finalized. Implement to have something happen.
sourcefn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
This will be run when the block is being finalized (before on_finalize
).
Implement to have something happen using the remaining weight.
Will not fire if the remaining weight is 0.
Return the weight used, the hook will subtract it from current weight used
and pass the result to the next on_idle
hook if it exists. Read more
sourcefn on_initialize(_n: BlockNumber) -> Weight
fn on_initialize(_n: BlockNumber) -> Weight
The block is being initialized. Implement to have something happen. Read more
sourcefn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
Perform a module upgrade. Read more
sourcefn try_state(_n: BlockNumber) -> Result<(), &'static str>
fn try_state(_n: BlockNumber) -> Result<(), &'static str>
Execute the sanity checks of this pallet, per block. Read more
sourcefn pre_upgrade() -> Result<(), &'static str>
fn pre_upgrade() -> Result<(), &'static str>
Execute some pre-checks prior to a runtime upgrade. Read more
sourcefn post_upgrade() -> Result<(), &'static str>
fn post_upgrade() -> Result<(), &'static str>
Execute some post-checks after a runtime upgrade. Read more
sourcefn offchain_worker(_n: BlockNumber)
fn offchain_worker(_n: BlockNumber)
Implementing this function on a module allows you to perform long-running tasks that make (by default) validators generate transactions that feed results of those long-running computations back on chain. Read more
sourcefn integrity_test()
fn integrity_test()
Run integrity test. Read more
sourceimpl<T: Config> IntegrityTest for Pallet<T>
impl<T: Config> IntegrityTest for Pallet<T>
sourcefn integrity_test()
fn integrity_test()
Run integrity test. Read more
sourceimpl<T: Config> OffchainWorker<<T as Config>::BlockNumber> for Pallet<T>
impl<T: Config> OffchainWorker<<T as Config>::BlockNumber> for Pallet<T>
sourcefn offchain_worker(n: <T as Config>::BlockNumber)
fn offchain_worker(n: <T as Config>::BlockNumber)
This function is being called after every block import (when fully synced). Read more
sourceimpl<T: Config> OnFinalize<<T as Config>::BlockNumber> for Pallet<T>
impl<T: Config> OnFinalize<<T as Config>::BlockNumber> for Pallet<T>
sourcefn on_finalize(n: <T as Config>::BlockNumber)
fn on_finalize(n: <T as Config>::BlockNumber)
The block is being finalized. Implement to have something happen. Read more
sourceimpl<T: Config> OnGenesis for Pallet<T>
impl<T: Config> OnGenesis for Pallet<T>
sourcefn on_genesis()
fn on_genesis()
Something that should happen at genesis.
sourceimpl<T: Config> OnIdle<<T as Config>::BlockNumber> for Pallet<T>
impl<T: Config> OnIdle<<T as Config>::BlockNumber> for Pallet<T>
sourcefn on_idle(n: <T as Config>::BlockNumber, remaining_weight: Weight) -> Weight
fn on_idle(n: <T as Config>::BlockNumber, remaining_weight: Weight) -> Weight
The block is being finalized.
Implement to have something happen in case there is leftover weight.
Check the passed remaining_weight
to make sure it is high enough to allow for
your pallet’s extra computation. Read more
sourceimpl<T: Config> OnInitialize<<T as Config>::BlockNumber> for Pallet<T>
impl<T: Config> OnInitialize<<T as Config>::BlockNumber> for Pallet<T>
sourcefn on_initialize(n: <T as Config>::BlockNumber) -> Weight
fn on_initialize(n: <T as Config>::BlockNumber) -> Weight
The block is being initialized. Implement to have something happen. Read more
sourceimpl<T: Config> OnRuntimeUpgrade for Pallet<T>
impl<T: Config> OnRuntimeUpgrade for Pallet<T>
sourceimpl<T: Config> PalletInfoAccess for Pallet<T>
impl<T: Config> PalletInfoAccess for Pallet<T>
sourcefn module_name() -> &'static str
fn module_name() -> &'static str
Name of the Rust module containing the pallet.
sourcefn crate_version() -> CrateVersion
fn crate_version() -> CrateVersion
Version of the crate containing the pallet.
sourceimpl<T: Config> PalletsInfoAccess for Pallet<T>
impl<T: Config> PalletsInfoAccess for Pallet<T>
sourceimpl<T: Config> StorageInfoTrait for Pallet<T>
impl<T: Config> StorageInfoTrait for Pallet<T>
fn storage_info() -> Vec<StorageInfo>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
impl<T> Eq for Pallet<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for Pallet<T> where
T: RefUnwindSafe,
impl<T> Send for Pallet<T> where
T: Send,
impl<T> Sync for Pallet<T> where
T: Sync,
impl<T> Unpin for Pallet<T> where
T: Unpin,
impl<T> UnwindSafe for Pallet<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> CheckedConversion for T
impl<T> CheckedConversion for T
sourcefn checked_from<T>(t: T) -> Option<Self> where
Self: TryFrom<T>,
fn checked_from<T>(t: T) -> Option<Self> where
Self: TryFrom<T>,
Convert from a value of T
into an equivalent instance of Option<Self>
. Read more
sourcefn checked_into<T>(self) -> Option<T> where
Self: TryInto<T>,
fn checked_into<T>(self) -> Option<T> where
Self: TryInto<T>,
Consume self to return Some
equivalent value of Option<T>
. Read more
sourceimpl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
sourcefn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>ⓘNotable traits for Box<R, Global>impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>ⓘNotable traits for Box<R, Global>impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
sourcefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
sourcefn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
sourcefn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
sourceimpl<T> DowncastSync for T where
T: Any + Send + Sync,
impl<T> DowncastSync for T where
T: Any + Send + Sync,
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T, Outer> IsWrappedBy<Outer> for T where
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
impl<T, Outer> IsWrappedBy<Outer> for T where
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
sourceimpl<U> OnRuntimeUpgradeHelpersExt for U where
U: OnRuntimeUpgrade,
impl<U> OnRuntimeUpgradeHelpersExt for U where
U: OnRuntimeUpgrade,
sourcefn storage_key(ident: &str) -> [u8; 32]
fn storage_key(ident: &str) -> [u8; 32]
Generate a storage key unique to this runtime upgrade. Read more
sourcefn get_temp_storage<T>(at: &str) -> Option<T> where
T: Decode,
fn get_temp_storage<T>(at: &str) -> Option<T> where
T: Decode,
Get temporary storage data written by Self::set_temp_storage
. Read more
sourcefn set_temp_storage<T>(data: T, at: &str) where
T: Encode,
fn set_temp_storage<T>(data: T, at: &str) where
T: Encode,
Write some temporary data to a specific storage that can be read (potentially in
post-upgrade hook) via Self::get_temp_storage
. Read more
sourceimpl<T> PalletVersionToStorageVersionHelper for T where
T: GetStorageVersion + PalletInfoAccess,
impl<T> PalletVersionToStorageVersionHelper for T where
T: GetStorageVersion + PalletInfoAccess,
fn migrate(db_weight: &RuntimeDbWeight) -> Weight
sourceimpl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
sourcefn saturated_from<T>(t: T) -> Self where
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Self where
Self: UniqueSaturatedFrom<T>,
Convert from a value of T
into an equivalent instance of Self
. Read more
sourcefn saturated_into<T>(self) -> T where
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> T where
Self: UniqueSaturatedInto<T>,
Consume self to return an equivalent value of T
. Read more
sourceimpl<S, T> UncheckedInto<T> for S where
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for S where
T: UncheckedFrom<S>,
sourcefn unchecked_into(self) -> T
fn unchecked_into(self) -> T
The counterpart to unchecked_from
.
sourceimpl<T, S> UniqueSaturatedInto<T> for S where
T: Bounded,
S: TryInto<T>,
impl<T, S> UniqueSaturatedInto<T> for S where
T: Bounded,
S: TryInto<T>,
sourcefn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
Consume self to return an equivalent value of T
.
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more