pub struct BaseTransactionNetworkExecutor<Interactor: BlockchainInteractor> { /* private fields */ }Expand description
A struct representing the executor for handling transactions in a real blockchain environment.
This executor is designed to interact with a blockchain network via a specified gateway URL and a wallet
for signing transactions. It is parameterized by a type Interactor that encapsulates the blockchain interaction logic.
Implementations§
source§impl BaseTransactionNetworkExecutor<Interactor>
impl BaseTransactionNetworkExecutor<Interactor>
pub fn set_refresh_strategy(&mut self, strategy: TransactionRefreshStrategy)
pub fn set_timeout(&mut self, timeout: Duration)
source§impl<Interactor: BlockchainInteractor> BaseTransactionNetworkExecutor<Interactor>
impl<Interactor: BlockchainInteractor> BaseTransactionNetworkExecutor<Interactor>
sourcepub async fn new(
gateway_url: String,
wallet: Wallet,
) -> Result<Self, ExecutorError>
pub async fn new( gateway_url: String, wallet: Wallet, ) -> Result<Self, ExecutorError>
Creates a new instance of BaseTransactionNetworkExecutor.
This function is async because the Interactor may perform some requests, such as retrieving the network configuration. Those async operations might fail, thus the Result return type.
Trait Implementations§
source§impl<Interactor> Clone for BaseTransactionNetworkExecutor<Interactor>where
Interactor: BlockchainInteractor + Clone,
impl<Interactor> Clone for BaseTransactionNetworkExecutor<Interactor>where
Interactor: BlockchainInteractor + Clone,
Custom implementation of Clone for BaseTransactionNetworkExecutor, when Interactor is Clone.
source§impl<Interactor> Debug for BaseTransactionNetworkExecutor<Interactor>where
Interactor: BlockchainInteractor + Debug,
impl<Interactor> Debug for BaseTransactionNetworkExecutor<Interactor>where
Interactor: BlockchainInteractor + Debug,
Custom implementation of Debug for BaseTransactionNetworkExecutor, when Interactor is Debug.
The implementation is basic, it prefixes “BaseTransactionNetworkExecutor” before the Interactor’s debug implementation.
source§impl<Interactor: BlockchainInteractor> DeployExecutor for BaseTransactionNetworkExecutor<Interactor>
impl<Interactor: BlockchainInteractor> DeployExecutor for BaseTransactionNetworkExecutor<Interactor>
Implementation of the DeployExecutor trait for the BaseTransactionNetworkExecutor struct.
This implementation enables the deployment of smart contracts on the blockchain
using a specified blockchain interactor.
source§fn sc_deploy<'life0, 'async_trait, OutputManaged>(
&'life0 mut self,
bytes: Vec<u8>,
code_metadata: CodeMetadata,
egld_value: BigUint,
arguments: Vec<Vec<u8>>,
gas_limit: u64,
) -> Pin<Box<dyn Future<Output = Result<(Address, CallResult<OutputManaged::Native>), ExecutorError>> + Send + 'async_trait>>where
OutputManaged: TopDecodeMulti + NativeConvertible + Send + Sync + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
fn sc_deploy<'life0, 'async_trait, OutputManaged>(
&'life0 mut self,
bytes: Vec<u8>,
code_metadata: CodeMetadata,
egld_value: BigUint,
arguments: Vec<Vec<u8>>,
gas_limit: u64,
) -> Pin<Box<dyn Future<Output = Result<(Address, CallResult<OutputManaged::Native>), ExecutorError>> + Send + 'async_trait>>where
OutputManaged: TopDecodeMulti + NativeConvertible + Send + Sync + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
Asynchronously deploys a smart contract to the blockchain.
source§impl<Interactor: BlockchainInteractor> TransactionExecutor for BaseTransactionNetworkExecutor<Interactor>
impl<Interactor: BlockchainInteractor> TransactionExecutor for BaseTransactionNetworkExecutor<Interactor>
source§fn sc_call<'life0, 'life1, 'async_trait, OutputManaged>(
&'life0 mut self,
to: &'life1 Address,
function: String,
arguments: Vec<Vec<u8>>,
gas_limit: u64,
egld_value: BigUint,
esdt_transfers: Vec<TokenTransfer>,
) -> Pin<Box<dyn Future<Output = Result<CallResult<OutputManaged::Native>, ExecutorError>> + Send + 'async_trait>>where
OutputManaged: TopDecodeMulti + NativeConvertible + Send + Sync + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn sc_call<'life0, 'life1, 'async_trait, OutputManaged>(
&'life0 mut self,
to: &'life1 Address,
function: String,
arguments: Vec<Vec<u8>>,
gas_limit: u64,
egld_value: BigUint,
esdt_transfers: Vec<TokenTransfer>,
) -> Pin<Box<dyn Future<Output = Result<CallResult<OutputManaged::Native>, ExecutorError>> + Send + 'async_trait>>where
OutputManaged: TopDecodeMulti + NativeConvertible + Send + Sync + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Auto Trait Implementations§
impl<Interactor> Freeze for BaseTransactionNetworkExecutor<Interactor>where
Interactor: Freeze,
impl<Interactor> RefUnwindSafe for BaseTransactionNetworkExecutor<Interactor>where
Interactor: RefUnwindSafe,
impl<Interactor> Send for BaseTransactionNetworkExecutor<Interactor>
impl<Interactor> Sync for BaseTransactionNetworkExecutor<Interactor>
impl<Interactor> Unpin for BaseTransactionNetworkExecutor<Interactor>where
Interactor: Unpin,
impl<Interactor> UnwindSafe for BaseTransactionNetworkExecutor<Interactor>where
Interactor: UnwindSafe,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)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>
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 more