pub trait TxPayment<Env>where
Env: TxEnv,{
// Required methods
fn is_no_payment(&self, env: &Env) -> bool;
fn perform_transfer_execute(
self,
env: &Env,
to: &ManagedAddress<<Env as TxEnv>::Api>,
gas_limit: u64,
fc: FunctionCall<<Env as TxEnv>::Api>,
);
fn with_normalized<From, To, F, R>(
self,
env: &Env,
from: &From,
to: To,
fc: FunctionCall<<Env as TxEnv>::Api>,
f: F,
) -> R
where 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 into_full_payment_data(
self,
env: &Env,
) -> FullPaymentData<<Env as TxEnv>::Api>;
}
Expand description
Describes a payment that is part of a transaction.
Required Methods§
Sourcefn 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.
Sourcefn 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.
Sourcefn 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.
Sourcefn 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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.