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>) -> Self
fn from(value: TestEsdtTransfer<'a>) -> Self
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::Api>,
gas_limit: u64,
fc: FunctionCall<Env::Api>,
)
fn perform_transfer_execute( self, env: &Env, to: &ManagedAddress<Env::Api>, gas_limit: u64, fc: FunctionCall<Env::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::Api>,
f: F,
) -> Rwhere
From: TxFrom<Env>,
To: TxToSpecified<Env>,
F: FnOnce(&ManagedAddress<Env::Api>, &BigUint<Env::Api>, FunctionCall<Env::Api>) -> R,
fn with_normalized<From, To, F, R>(
self,
env: &Env,
from: &From,
to: To,
fc: FunctionCall<Env::Api>,
f: F,
) -> Rwhere
From: TxFrom<Env>,
To: TxToSpecified<Env>,
F: FnOnce(&ManagedAddress<Env::Api>, &BigUint<Env::Api>, FunctionCall<Env::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::Api>
fn into_full_payment_data(self, env: &Env) -> FullPaymentData<Env::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