pub struct UtilityCallApi<'api> { /* private fields */ }
Implementations§
Source§impl<'api> UtilityCallApi<'api>
impl<'api> UtilityCallApi<'api>
Sourcepub fn batch(&self, calls: Vec<RuntimeCall>) -> Result<WrappedCall>
pub fn batch(&self, calls: Vec<RuntimeCall>) -> Result<WrappedCall>
Send a batch of dispatch calls.
May be called from any origin except None
.
calls
: The calls to be dispatched from the same origin. The number of call must not exceed the constant:batched_calls_limit
(available in constant metadata).
If origin is root then the calls are dispatched without checking origin filter. (This
includes bypassing frame_system::Config::BaseCallFilter
).
§Complexity
- O(C) where C is the number of calls to be batched.
This will return Ok
in all circumstances. To determine the success of the batch, an
event is deposited. If a call failed and the batch was interrupted, then the
BatchInterrupted
event is deposited, along with the number of successful calls made
and the error of the failed call. If all were successful, then the BatchCompleted
event is deposited.
Sourcepub fn relay_tx(
&self,
target: AccountId,
signature: MultiSignature,
call: UniqueCall<RuntimeCall>,
) -> Result<WrappedCall>
pub fn relay_tx( &self, target: AccountId, signature: MultiSignature, call: UniqueCall<RuntimeCall>, ) -> Result<WrappedCall>
Relay a call for a target from an origin
Relaying in this context refers to the ability of origin to make a call on behalf of target.
Fees are charged to origin
§Parameters
target
: Account to be relayedsignature
: Signature from target authorizing the relaycall
: Call to be relayed on behalf of target
POLYMESH: added.
Sourcepub fn batch_all(&self, calls: Vec<RuntimeCall>) -> Result<WrappedCall>
pub fn batch_all(&self, calls: Vec<RuntimeCall>) -> Result<WrappedCall>
Send a batch of dispatch calls and atomically execute them. The whole transaction will rollback and fail if any of the calls failed.
May be called from any origin except None
.
calls
: The calls to be dispatched from the same origin. The number of call must not exceed the constant:batched_calls_limit
(available in constant metadata).
If origin is root then the calls are dispatched without checking origin filter. (This
includes bypassing frame_system::Config::BaseCallFilter
).
§Complexity
- O(C) where C is the number of calls to be batched.
Sourcepub fn dispatch_as(
&self,
as_origin: OriginCaller,
call: RuntimeCall,
) -> Result<WrappedCall>
pub fn dispatch_as( &self, as_origin: OriginCaller, call: RuntimeCall, ) -> Result<WrappedCall>
Dispatches a function call with a provided origin.
The dispatch origin for this call must be Root.
§Complexity
- O(1).
Sourcepub fn force_batch(&self, calls: Vec<RuntimeCall>) -> Result<WrappedCall>
pub fn force_batch(&self, calls: Vec<RuntimeCall>) -> Result<WrappedCall>
Send a batch of dispatch calls.
Unlike batch
, it allows errors and won’t interrupt.
May be called from any origin except None
.
calls
: The calls to be dispatched from the same origin. The number of call must not exceed the constant:batched_calls_limit
(available in constant metadata).
If origin is root then the calls are dispatch without checking origin filter. (This
includes bypassing frame_system::Config::BaseCallFilter
).
§Complexity
- O(C) where C is the number of calls to be batched.
Sourcepub fn with_weight(
&self,
call: RuntimeCall,
weight: Weight,
) -> Result<WrappedCall>
pub fn with_weight( &self, call: RuntimeCall, weight: Weight, ) -> Result<WrappedCall>
Dispatch a function call with a specified weight.
This function does not check the weight of the call, and instead allows the Root origin to specify the weight of the call.
The dispatch origin for this call must be Root.
Sourcepub fn as_derivative(
&self,
index: u16,
call: RuntimeCall,
) -> Result<WrappedCall>
pub fn as_derivative( &self, index: u16, call: RuntimeCall, ) -> Result<WrappedCall>
Send a call through an indexed pseudonym of the sender.
Filter from origin are passed along. The call will be dispatched with an origin which use the same filter as the origin of this call.
The dispatch origin for this call must be Signed.
Trait Implementations§
Source§impl<'api> Clone for UtilityCallApi<'api>
impl<'api> Clone for UtilityCallApi<'api>
Source§fn clone(&self) -> UtilityCallApi<'api>
fn clone(&self) -> UtilityCallApi<'api>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl<'api> Freeze for UtilityCallApi<'api>
impl<'api> !RefUnwindSafe for UtilityCallApi<'api>
impl<'api> Send for UtilityCallApi<'api>
impl<'api> Sync for UtilityCallApi<'api>
impl<'api> Unpin for UtilityCallApi<'api>
impl<'api> !UnwindSafe for UtilityCallApi<'api>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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<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
.