pub enum Call<T: Config<I>, I: 'static = ()> {
report_awesome {
reason: Vec<u8>,
who: <<T as Config>::Lookup as StaticLookup>::Source,
},
retract_tip {
hash: T::Hash,
},
tip_new {
reason: Vec<u8>,
who: <<T as Config>::Lookup as StaticLookup>::Source,
tip_value: BalanceOf<T, I>,
},
tip {
hash: T::Hash,
tip_value: BalanceOf<T, I>,
},
close_tip {
hash: T::Hash,
},
slash_tip {
hash: T::Hash,
},
// some variants omitted
}Expand description
Contains a variant per dispatchable extrinsic that this pallet has.
Variants§
report_awesome
Report something reason that deserves a tip and claim any eventual the finder’s fee.
The dispatch origin for this call must be Signed.
Payment: TipReportDepositBase will be reserved from the origin account, as well as
DataDepositPerByte for each byte in reason.
reason: The reason for, or the thing that deserves, the tip; generally this will be a UTF-8-encoded URL.who: The account which should be credited for the tip.
Emits NewTip if successful.
§Complexity
O(R)whereRlength ofreason.- encoding and hashing of ‘reason’
retract_tip
Retract a prior tip-report from report_awesome, and cancel the process of tipping.
If successful, the original deposit will be unreserved.
The dispatch origin for this call must be Signed and the tip identified by hash
must have been reported by the signing account through report_awesome (and not
through tip_new).
hash: The identity of the open tip for which a tip value is declared. This is formed as the hash of the tuple of the original tipreasonand the beneficiary account ID.
Emits TipRetracted if successful.
§Complexity
O(1)- Depends on the length of
T::Hashwhich is fixed.
- Depends on the length of
tip_new
Give a tip for something new; no finder’s fee will be taken.
The dispatch origin for this call must be Signed and the signing account must be a
member of the Tippers set.
reason: The reason for, or the thing that deserves, the tip; generally this will be a UTF-8-encoded URL.who: The account which should be credited for the tip.tip_value: The amount of tip that the sender would like to give. The median tip value of active tippers will be given to thewho.
Emits NewTip if successful.
§Complexity
O(R + T)whereRlength ofreason,Tis the number of tippers.O(T): decodingTippervec of lengthT.Tis charged as upper bound given byContainsLengthBound. The actual cost depends on the implementation ofT::Tippers.O(R): hashing and encoding of reason of lengthR
Fields
who: <<T as Config>::Lookup as StaticLookup>::Sourcetip
Declare a tip value for an already-open tip.
The dispatch origin for this call must be Signed and the signing account must be a
member of the Tippers set.
hash: The identity of the open tip for which a tip value is declared. This is formed as the hash of the tuple of the hash of the original tipreasonand the beneficiary account ID.tip_value: The amount of tip that the sender would like to give. The median tip value of active tippers will be given to thewho.
Emits TipClosing if the threshold of tippers has been reached and the countdown period
has started.
§Complexity
-
O(T)whereTis the number of tippers. decodingTippervec of lengthT, insert tip and check closing,Tis charged as upper bound given byContainsLengthBound. The actual cost depends on the implementation ofT::Tippers.Actually weight could be lower as it depends on how many tips are in
OpenTipbut it is weighted as if almost full i.e of lengthT-1.
close_tip
Close and payout a tip.
The dispatch origin for this call must be Signed.
The tip identified by hash must have finished its countdown period.
hash: The identity of the open tip for which a tip value is declared. This is formed as the hash of the tuple of the original tipreasonand the beneficiary account ID.
§Complexity
- :
O(T)whereTis the number of tippers. decodingTippervec of lengthT.Tis charged as upper bound given byContainsLengthBound. The actual cost depends on the implementation ofT::Tippers.
slash_tip
Remove and slash an already-open tip.
May only be called from T::RejectOrigin.
As a result, the finder is slashed and the deposits are lost.
Emits TipSlashed if successful.
§Complexity
- O(1).
Implementations§
Source§impl<T: Config<I>, I: 'static> Call<T, I>
impl<T: Config<I>, I: 'static> Call<T, I>
Sourcepub fn new_call_variant_report_awesome(
reason: Vec<u8>,
who: <<T as Config>::Lookup as StaticLookup>::Source,
) -> Self
pub fn new_call_variant_report_awesome( reason: Vec<u8>, who: <<T as Config>::Lookup as StaticLookup>::Source, ) -> Self
Create a call with the variant report_awesome.
Sourcepub fn new_call_variant_retract_tip(hash: T::Hash) -> Self
pub fn new_call_variant_retract_tip(hash: T::Hash) -> Self
Create a call with the variant retract_tip.
Sourcepub fn new_call_variant_tip_new(
reason: Vec<u8>,
who: <<T as Config>::Lookup as StaticLookup>::Source,
tip_value: BalanceOf<T, I>,
) -> Self
pub fn new_call_variant_tip_new( reason: Vec<u8>, who: <<T as Config>::Lookup as StaticLookup>::Source, tip_value: BalanceOf<T, I>, ) -> Self
Create a call with the variant tip_new.
Sourcepub fn new_call_variant_tip(hash: T::Hash, tip_value: BalanceOf<T, I>) -> Self
pub fn new_call_variant_tip(hash: T::Hash, tip_value: BalanceOf<T, I>) -> Self
Create a call with the variant tip.
Sourcepub fn new_call_variant_close_tip(hash: T::Hash) -> Self
pub fn new_call_variant_close_tip(hash: T::Hash) -> Self
Create a call with the variant close_tip.
Sourcepub fn new_call_variant_slash_tip(hash: T::Hash) -> Self
pub fn new_call_variant_slash_tip(hash: T::Hash) -> Self
Create a call with the variant slash_tip.
Trait Implementations§
Source§impl<T: Config<I>, I: 'static> Authorize for Call<T, I>
impl<T: Config<I>, I: 'static> Authorize for Call<T, I>
Source§impl<T: Config<I>, I: 'static> CheckIfFeeless for Call<T, I>
impl<T: Config<I>, I: 'static> CheckIfFeeless for Call<T, I>
Source§type Origin = <T as Config>::RuntimeOrigin
type Origin = <T as Config>::RuntimeOrigin
Source§fn is_feeless(&self, origin: &Self::Origin) -> bool
fn is_feeless(&self, origin: &Self::Origin) -> bool
#[pallet::feeless_if]Source§impl<T: Config<I>, I: 'static> Decode for Call<T, I>
impl<T: Config<I>, I: 'static> Decode for Call<T, I>
Source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy,
) -> Result<Self, Error>
fn decode<__CodecInputEdqy: Input>( __codec_input_edqy: &mut __CodecInputEdqy, ) -> Result<Self, Error>
Source§fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>,
) -> Result<DecodeFinished, Error>where
I: Input,
fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>,
) -> Result<DecodeFinished, Error>where
I: Input,
Source§impl<T: Config<I>, I: 'static> Encode for Call<T, I>
impl<T: Config<I>, I: 'static> Encode for Call<T, I>
Source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
Source§fn encode_to<__CodecOutputEdqy: Output + ?Sized>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy,
)
fn encode_to<__CodecOutputEdqy: Output + ?Sized>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy, )
Source§fn using_encoded<R, F>(&self, f: F) -> R
fn using_encoded<R, F>(&self, f: F) -> R
Source§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
Source§impl<T: Config<I>, I: 'static> GetCallIndex for Call<T, I>
impl<T: Config<I>, I: 'static> GetCallIndex for Call<T, I>
Source§fn get_call_index(&self) -> u8
fn get_call_index(&self) -> u8
Source§fn get_call_indices() -> &'static [u8] ⓘ
fn get_call_indices() -> &'static [u8] ⓘ
GetCallName.Source§impl<T: Config<I>, I: 'static> GetCallName for Call<T, I>
impl<T: Config<I>, I: 'static> GetCallName for Call<T, I>
Source§fn get_call_name(&self) -> &'static str
fn get_call_name(&self) -> &'static str
Source§fn get_call_names() -> &'static [&'static str]
fn get_call_names() -> &'static [&'static str]
GetCallIndex.Source§impl<T: Config<I>, I: 'static> GetDispatchInfo for Call<T, I>
impl<T: Config<I>, I: 'static> GetDispatchInfo for Call<T, I>
Source§fn get_dispatch_info(&self) -> DispatchInfo
fn get_dispatch_info(&self) -> DispatchInfo
DispatchInfo, containing relevant information of this dispatch. Read moreSource§impl<T, I> TypeInfo for Call<T, I>where
PhantomData<(T, I)>: TypeInfo + 'static,
<<T as Config>::Lookup as StaticLookup>::Source: TypeInfo + 'static,
T::Hash: TypeInfo + 'static,
BalanceOf<T, I>: HasCompact,
T: Config<I> + 'static,
I: 'static,
impl<T, I> TypeInfo for Call<T, I>where
PhantomData<(T, I)>: TypeInfo + 'static,
<<T as Config>::Lookup as StaticLookup>::Source: TypeInfo + 'static,
T::Hash: TypeInfo + 'static,
BalanceOf<T, I>: HasCompact,
T: Config<I> + 'static,
I: 'static,
Source§impl<T: Config<I>, I: 'static> UnfilteredDispatchable for Call<T, I>
impl<T: Config<I>, I: 'static> UnfilteredDispatchable for Call<T, I>
Source§type RuntimeOrigin = <T as Config>::RuntimeOrigin
type RuntimeOrigin = <T as Config>::RuntimeOrigin
frame_system::Config::RuntimeOrigin).Source§fn dispatch_bypass_filter(
self,
origin: Self::RuntimeOrigin,
) -> DispatchResultWithPostInfo
fn dispatch_bypass_filter( self, origin: Self::RuntimeOrigin, ) -> DispatchResultWithPostInfo
impl<T: Config<I>, I: 'static> DecodeWithMemTracking for Call<T, I>where
<<T as Config>::Lookup as StaticLookup>::Source: DecodeWithMemTracking,
T::Hash: DecodeWithMemTracking,
BalanceOf<T, I>: HasCompact,
<BalanceOf<T, I> as HasCompact>::Type: DecodeWithMemTracking,
impl<T: Config<I>, I: 'static> EncodeLike for Call<T, I>
impl<T: Config<I>, I: 'static> Eq for Call<T, I>
Auto Trait Implementations§
impl<T, I> Freeze for Call<T, I>
impl<T, I> RefUnwindSafe for Call<T, I>where
<T as Config>::RuntimeEvent: Sized,
<<T as Config>::Lookup as StaticLookup>::Source: RefUnwindSafe,
<T as Config>::Hash: RefUnwindSafe,
<<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance: RefUnwindSafe,
T: RefUnwindSafe,
I: RefUnwindSafe,
impl<T, I> Send for Call<T, I>where
<T as Config>::RuntimeEvent: Sized,
<<T as Config>::Lookup as StaticLookup>::Source: Send,
T: Send,
I: Send,
impl<T, I> Sync for Call<T, I>where
<T as Config>::RuntimeEvent: Sized,
<<T as Config>::Lookup as StaticLookup>::Source: Sync,
T: Sync,
I: Sync,
impl<T, I> Unpin for Call<T, I>
impl<T, I> UnwindSafe for Call<T, I>where
<T as Config>::RuntimeEvent: Sized,
<<T as Config>::Lookup as StaticLookup>::Source: UnwindSafe,
<T as Config>::Hash: UnwindSafe,
<<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance: UnwindSafe,
T: UnwindSafe,
I: UnwindSafe,
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)Source§impl<T> DecodeLimit for Twhere
T: Decode,
impl<T> DecodeLimit for Twhere
T: Decode,
Source§impl<T> DecodeWithMemLimit for Twhere
T: DecodeWithMemTracking,
impl<T> DecodeWithMemLimit for Twhere
T: DecodeWithMemTracking,
Source§impl<T, U> DefensiveTruncateInto<U> for Twhere
U: DefensiveTruncateFrom<T>,
impl<T, U> DefensiveTruncateInto<U> for Twhere
U: DefensiveTruncateFrom<T>,
Source§fn defensive_truncate_into(self) -> U
fn defensive_truncate_into(self) -> U
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
impl<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
fn into_tuple(self) -> Dest
Source§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
Source§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
Source§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
Source§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
T. Read moreSource§impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
type Error = <U as TryFromKey<T>>::Error
fn try_into_key(self) -> Result<U, <U as TryFromKey<T>>::Error>
Source§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
Source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from.Source§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
Source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T.