pub struct MultiContractCallHandler<T: Account> {
    pub contract_calls: Vec<ContractCall>,
    pub log_decoder: LogDecoder,
    pub tx_parameters: TxParameters,
    pub account: T,
    /* private fields */
}
Expand description

Helper that handles bundling multiple calls into a single transaction

Fields§

§contract_calls: Vec<ContractCall>§log_decoder: LogDecoder§tx_parameters: TxParameters§account: T

Implementations§

source§

impl<T: Account> MultiContractCallHandler<T>

source

pub fn new(account: T) -> Self

source

pub fn add_call( &mut self, call_handler: ContractCallHandler<impl Account, impl Tokenizable> ) -> &mut Self

Adds a contract call to be bundled in the transaction Note that this is a builder method

source

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

source

pub async fn build_tx(&self) -> Result<ScriptTransaction>

Returns the script that executes the contract calls

source

pub async fn call<D: Tokenizable + Debug>( &mut self ) -> Result<FuelCallResponse<D>>

Call contract methods on the node, in a state-modifying manner.

source

pub async fn simulate<D: Tokenizable + Debug>( &mut self ) -> Result<FuelCallResponse<D>>

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.

source

pub async fn estimate_tx_dependencies( self, max_attempts: Option<u64> ) -> Result<Self>

Simulates the call and attempts to resolve missing tx dependencies. Forwards the received error if it cannot be fixed.

source

pub async fn estimate_transaction_cost( &self, tolerance: Option<f64> ) -> Result<TransactionCost>

Get a contract’s estimated cost

source

pub fn get_response<D: Tokenizable + Debug>( &self, receipts: Vec<Receipt> ) -> Result<FuelCallResponse<D>>

Create a FuelCallResponse from call receipts

Trait Implementations§

source§

impl<T: Debug + Account> Debug for MultiContractCallHandler<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> AnyDebug for Twhere T: Any + Debug,

source§

fn as_any_ref(&self) -> &(dyn Any + 'static)

Returns a reference to the underlying type as Any.
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
§

impl<T> StorageAsMut for T

§

fn storage<Type>(&mut self) -> StorageMut<'_, Self, Type>where Type: Mappable,

§

fn storage_as_mut<Type>(&mut self) -> StorageMut<'_, Self, Type>where Type: Mappable,

§

impl<T> StorageAsRef for T

§

fn storage<Type>(&self) -> StorageRef<'_, Self, Type>where Type: Mappable,

§

fn storage_as_ref<Type>(&self) -> StorageRef<'_, Self, Type>where Type: Mappable,

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
§

impl<T> IsFieldType<T> for T