pub struct TestEsdtTransfer<'a>(pub TestTokenIdentifier<'a>, pub u64, pub u64);
Expand description
Syntactic sugar for quickly writing ESDT transfers in tests.
The fields are:
- token identifier, as TestTokenIdentifier
- nonce
- amount
The amount is represented as u64, since for most tests it is enough.
Tuple Fields§
§0: TestTokenIdentifier<'a>
§1: u64
§2: u64
Trait Implementations§
Source§impl<'a> Clone for TestEsdtTransfer<'a>
impl<'a> Clone for TestEsdtTransfer<'a>
Source§fn clone(&self) -> TestEsdtTransfer<'a>
fn clone(&self) -> TestEsdtTransfer<'a>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'a> Debug for TestEsdtTransfer<'a>
impl<'a> Debug for TestEsdtTransfer<'a>
Source§impl<'a, Api> From<TestEsdtTransfer<'a>> for EsdtTokenPayment<Api>where
Api: ManagedTypeApi,
impl<'a, Api> From<TestEsdtTransfer<'a>> for EsdtTokenPayment<Api>where
Api: ManagedTypeApi,
Source§fn from(value: TestEsdtTransfer<'a>) -> EsdtTokenPayment<Api>
fn from(value: TestEsdtTransfer<'a>) -> EsdtTokenPayment<Api>
Converts to this type from the input type.
Source§impl<'a> PartialEq for TestEsdtTransfer<'a>
impl<'a> PartialEq for TestEsdtTransfer<'a>
Source§impl<Env> TxPayment<Env> for TestEsdtTransfer<'_>where
Env: TxEnv,
impl<Env> TxPayment<Env> for TestEsdtTransfer<'_>where
Env: TxEnv,
Source§fn is_no_payment(&self, _env: &Env) -> bool
fn is_no_payment(&self, _env: &Env) -> bool
Returns true if payment indicates transfer of either non-zero EGLD or ESDT amounts.
Source§fn perform_transfer_execute(
self,
env: &Env,
to: &ManagedAddress<<Env as TxEnv>::Api>,
gas_limit: u64,
fc: FunctionCall<<Env as TxEnv>::Api>,
)
fn perform_transfer_execute( self, env: &Env, to: &ManagedAddress<<Env as TxEnv>::Api>, gas_limit: u64, fc: FunctionCall<<Env as TxEnv>::Api>, )
Transfer-execute calls have different APIs for different payments types.
This method selects between them.
Source§fn with_normalized<From, To, F, R>(
self,
env: &Env,
from: &From,
to: To,
fc: FunctionCall<<Env as TxEnv>::Api>,
f: F,
) -> Rwhere
From: TxFrom<Env>,
To: TxToSpecified<Env>,
F: FnOnce(&ManagedAddress<<Env as TxEnv>::Api>, &BigUint<<Env as TxEnv>::Api>, FunctionCall<<Env as TxEnv>::Api>) -> R,
fn with_normalized<From, To, F, R>(
self,
env: &Env,
from: &From,
to: To,
fc: FunctionCall<<Env as TxEnv>::Api>,
f: F,
) -> Rwhere
From: TxFrom<Env>,
To: TxToSpecified<Env>,
F: FnOnce(&ManagedAddress<<Env as TxEnv>::Api>, &BigUint<<Env as TxEnv>::Api>, FunctionCall<<Env as TxEnv>::Api>) -> R,
Converts an ESDT call to a built-in function call, if necessary.
Source§fn into_full_payment_data(
self,
env: &Env,
) -> FullPaymentData<<Env as TxEnv>::Api>
fn into_full_payment_data( self, env: &Env, ) -> FullPaymentData<<Env as TxEnv>::Api>
Payment data to be used by the testing framework. Will be refactored.
impl<'a> Copy for TestEsdtTransfer<'a>
impl<'a> Eq for TestEsdtTransfer<'a>
impl<'a> StructuralPartialEq for TestEsdtTransfer<'a>
Auto Trait Implementations§
impl<'a> Freeze for TestEsdtTransfer<'a>
impl<'a> RefUnwindSafe for TestEsdtTransfer<'a>
impl<'a> Send for TestEsdtTransfer<'a>
impl<'a> Sync for TestEsdtTransfer<'a>
impl<'a> Unpin for TestEsdtTransfer<'a>
impl<'a> UnwindSafe for TestEsdtTransfer<'a>
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
Compare self to
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> InterpretableFrom<&T> for Twhere
T: Clone,
impl<T> InterpretableFrom<&T> for Twhere
T: Clone,
fn interpret_from(from: &T, _context: &InterpreterContext) -> T
Source§impl<T> InterpretableFrom<T> for T
impl<T> InterpretableFrom<T> for T
fn interpret_from(from: T, _context: &InterpreterContext) -> T
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>
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 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>
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