pub struct ScriptCallHandler<D> {
pub script_call: ScriptCall,
pub tx_parameters: TxParameters,
pub wallet: WalletUnlocked,
pub provider: Provider,
pub output_param: ParamType,
pub datatype: PhantomData<D>,
pub log_decoder: LogDecoder,
}
Expand description
Helper that handles submitting a script call to a client and formatting the response
Fields§
§script_call: ScriptCall
§tx_parameters: TxParameters
§wallet: WalletUnlocked
§provider: Provider
§output_param: ParamType
§datatype: PhantomData<D>
§log_decoder: LogDecoder
Implementations§
Source§impl<D> ScriptCallHandler<D>where
D: Tokenizable + Debug,
impl<D> ScriptCallHandler<D>where
D: Tokenizable + Debug,
pub fn new( script_binary: Vec<u8>, encoded_args: UnresolvedBytes, wallet: WalletUnlocked, provider: Provider, output_param: ParamType, log_decoder: LogDecoder, ) -> Self
Sourcepub fn tx_params(self, params: TxParameters) -> Self
pub fn tx_params(self, params: TxParameters) -> Self
Sets the transaction parameters for a given transaction. Note that this is a builder method, i.e. use it as a chain:
ⓘ
let params = TxParameters { gas_price: 100, gas_limit: 1000000 };
instance.main(...).tx_params(params).call()
pub fn with_outputs(self, outputs: Vec<Output>) -> Self
pub fn with_inputs(self, inputs: Vec<Input>) -> Self
Sourcepub async fn call(self) -> Result<FuelCallResponse<D>, Error>
pub async fn call(self) -> Result<FuelCallResponse<D>, Error>
Call a script on the node, in a state-modifying manner.
Sourcepub async fn simulate(self) -> Result<FuelCallResponse<D>, Error>
pub async fn simulate(self) -> Result<FuelCallResponse<D>, Error>
Call a script 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 fn get_response(
&self,
receipts: Vec<Receipt>,
) -> Result<FuelCallResponse<D>, Error>
pub fn get_response( &self, receipts: Vec<Receipt>, ) -> Result<FuelCallResponse<D>, Error>
Create a FuelCallResponse
from call receipts
Trait Implementations§
Auto Trait Implementations§
impl<D> Freeze for ScriptCallHandler<D>
impl<D> RefUnwindSafe for ScriptCallHandler<D>where
D: RefUnwindSafe,
impl<D> Send for ScriptCallHandler<D>where
D: Send,
impl<D> Sync for ScriptCallHandler<D>where
D: Sync,
impl<D> Unpin for ScriptCallHandler<D>where
D: Unpin,
impl<D> UnwindSafe for ScriptCallHandler<D>where
D: 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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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