pub struct MultiContractCallHandler {
pub contract_calls: Vec<ContractCall>,
pub log_decoder: LogDecoder,
pub tx_parameters: TxParameters,
pub wallet: WalletUnlocked,
}
Expand description
Helper that handles bundling multiple calls into a single transaction
Fields§
§contract_calls: Vec<ContractCall>
§log_decoder: LogDecoder
§tx_parameters: TxParameters
§wallet: WalletUnlocked
Implementations§
Source§impl MultiContractCallHandler
impl MultiContractCallHandler
pub fn new(wallet: WalletUnlocked) -> Self
Sourcepub fn add_call<D: Tokenizable>(
&mut self,
call_handler: ContractCallHandler<D>,
) -> &mut Self
pub fn add_call<D: Tokenizable>( &mut self, call_handler: ContractCallHandler<D>, ) -> &mut Self
Adds a contract call to be bundled in the transaction Note that this is a builder method
Sourcepub fn tx_params(&mut self, params: TxParameters) -> &mut Self
pub fn tx_params(&mut self, params: TxParameters) -> &mut Self
Sets the transaction parameters for a given transaction. Note that this is a builder method
Sourcepub async fn get_executable_call(&self) -> Result<ExecutableFuelCall, Error>
pub async fn get_executable_call(&self) -> Result<ExecutableFuelCall, Error>
Returns the script that executes the contract calls
Sourcepub async fn call<D: Tokenizable + Debug>(
&self,
) -> Result<FuelCallResponse<D>, Error>
pub async fn call<D: Tokenizable + Debug>( &self, ) -> Result<FuelCallResponse<D>, Error>
Call contract methods on the node, in a state-modifying manner.
Sourcepub async fn simulate<D: Tokenizable + Debug>(
&self,
) -> Result<FuelCallResponse<D>, Error>
pub async fn simulate<D: Tokenizable + Debug>( &self, ) -> Result<FuelCallResponse<D>, Error>
Call contract methods on the node, in a simulated manner, meaning the state of the
blockchain is not modified but simulated.
It is the same as the call
method because the API is more user-friendly this way.
Sourcepub async fn estimate_tx_dependencies(
self,
max_attempts: Option<u64>,
) -> Result<Self, Error>
pub async fn estimate_tx_dependencies( self, max_attempts: Option<u64>, ) -> Result<Self, Error>
Simulates the call and attempts to resolve missing tx dependencies. Forwards the received error if it cannot be fixed.
Sourcepub async fn estimate_transaction_cost(
&self,
tolerance: Option<f64>,
) -> Result<TransactionCost, Error>
pub async fn estimate_transaction_cost( &self, tolerance: Option<f64>, ) -> Result<TransactionCost, Error>
Get a contract’s estimated cost
Sourcepub fn get_response<D: Tokenizable + Debug>(
&self,
receipts: Vec<Receipt>,
) -> Result<FuelCallResponse<D>, Error>
pub fn get_response<D: Tokenizable + Debug>( &self, receipts: Vec<Receipt>, ) -> Result<FuelCallResponse<D>, Error>
Create a FuelCallResponse
from call receipts
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MultiContractCallHandler
impl RefUnwindSafe for MultiContractCallHandler
impl Send for MultiContractCallHandler
impl Sync for MultiContractCallHandler
impl Unpin for MultiContractCallHandler
impl UnwindSafe for MultiContractCallHandler
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> 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> 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