multiversx_sc_scenario::scenario::model

Struct TypedScCall

Source
pub struct TypedScCall<OriginalResult> {
    pub sc_call_step: ScCallStep,
    /* private fields */
}
๐Ÿ‘ŽDeprecated since 0.49.0: Please use the unified transaction syntax instead.
Expand description

SCCallStep with explicit return type.

Fieldsยง

ยงsc_call_step: ScCallStep
๐Ÿ‘ŽDeprecated since 0.49.0: Please use the unified transaction syntax instead.

Implementationsยง

Sourceยง

impl<OriginalResult> TypedScCall<OriginalResult>

Source

pub fn result<RequestedResult>( &self, ) -> Result<RequestedResult, TxResponseStatus>
where OriginalResult: TopEncodeMulti, RequestedResult: TopDecodeMulti + TypeAbiFrom<OriginalResult>,

Source

pub fn from<A>(self, address: A) -> Self
where AddressValue: From<A>,

Source

pub fn to<A>(self, address: A) -> Self
where AddressValue: From<A>,

Source

pub fn egld_value<A>(self, amount: A) -> Self
where BigUintValue: From<A>,

Source

pub fn esdt_transfer<T, N, A>( self, token_id: T, token_nonce: N, amount: A, ) -> Self

Source

pub fn function(self, expr: &str) -> Self

Source

pub fn argument<A>(self, expr: A) -> Self
where BytesValue: From<A>,

Source

pub fn gas_limit<V>(self, value: V) -> Self
where U64Value: From<V>,

Source

pub fn expect(self, expect: TxExpect) -> Self

Adds a custom expect section to the tx.

Source

pub fn no_expect(self) -> Self

Explicitly states that no tx expect section should be added and no checks should be performed.

Note: by default a basic TxExpect::ok() is added, which checks that status is 0 and nothing else.

Source

pub fn expect_value<ExpectedResult>( self, expected_value: ExpectedResult, ) -> Self
where OriginalResult: TopEncodeMulti, ExpectedResult: TypeAbiFrom<OriginalResult> + TopEncodeMulti,

Shorthand for creating a tx expect with status โ€œOkโ€ and the given value.

The given value is type-checked agains the tx return type.

Source

pub fn response(&self) -> &TxResponse

Unwraps the response, if available.

Sourceยง

impl<OriginalResult> TypedScCall<OriginalResult>
where OriginalResult: TopEncodeMulti,

Source

pub fn execute<E: TypedScCallExecutor, RequestedResult>( self, executor: &mut E, ) -> RequestedResult
where RequestedResult: TopDecodeMulti + TypeAbiFrom<OriginalResult>,

Executes the operation, on the given executor.

Trait Implementationsยง

Sourceยง

impl<OriginalResult> AsMut<ScCallStep> for TypedScCall<OriginalResult>

Sourceยง

fn as_mut(&mut self) -> &mut ScCallStep

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<OriginalResult: Debug> Debug for TypedScCall<OriginalResult>

Sourceยง

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Sourceยง

impl<OriginalResult: Default> Default for TypedScCall<OriginalResult>

Sourceยง

fn default() -> TypedScCall<OriginalResult>

Returns the โ€œdefault valueโ€ for a type. Read more
Sourceยง

impl<OriginalResult> From<ScCallStep> for TypedScCall<OriginalResult>

Sourceยง

fn from(untyped: ScCallStep) -> Self

Converts to this type from the input type.
Sourceยง

impl<OriginalResult> From<TypedScCall<OriginalResult>> for ScCallStep

Sourceยง

fn from(typed: TypedScCall<OriginalResult>) -> Self

Converts to this type from the input type.

Auto Trait Implementationsยง

ยง

impl<OriginalResult> Freeze for TypedScCall<OriginalResult>

ยง

impl<OriginalResult> RefUnwindSafe for TypedScCall<OriginalResult>
where OriginalResult: RefUnwindSafe,

ยง

impl<OriginalResult> Send for TypedScCall<OriginalResult>
where OriginalResult: Send,

ยง

impl<OriginalResult> Sync for TypedScCall<OriginalResult>
where OriginalResult: Sync,

ยง

impl<OriginalResult> Unpin for TypedScCall<OriginalResult>
where OriginalResult: Unpin,

ยง

impl<OriginalResult> UnwindSafe for TypedScCall<OriginalResult>
where OriginalResult: UnwindSafe,

Blanket Implementationsยง

Sourceยง

impl<T> Any for T
where T: 'static + ?Sized,

Sourceยง

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Sourceยง

impl<T> Borrow<T> for T
where T: ?Sized,

Sourceยง

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Sourceยง

impl<T> BorrowMut<T> for T
where T: ?Sized,

Sourceยง

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Sourceยง

impl<T> From<T> for T

Sourceยง

fn from(t: T) -> T

Returns the argument unchanged.

Sourceยง

impl<T> InterpretableFrom<T> for T

Sourceยง

fn interpret_from(from: T, _context: &InterpreterContext) -> T

Sourceยง

impl<T, U> Into<U> for T
where U: From<T>,

Sourceยง

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Sourceยง

impl<T> IntoEither for T

Sourceยง

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Sourceยง

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Sourceยง

impl<T> ReconstructableFrom<T> for T

Sourceยง

impl<T> Same for T

Sourceยง

type Output = T

Should always be Self
Sourceยง

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Sourceยง

type Error = Infallible

The type returned in the event of a conversion error.
Sourceยง

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Sourceยง

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Sourceยง

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Sourceยง

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Sourceยง

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

Sourceยง

fn vzip(self) -> V