MCPcopy Create free account
hub / github.com/consensus-shipyard/ipc / fevm_call

Method fevm_call

fendermint/rpc/src/tx.rs:112–140  ·  view source on GitHub ↗

Call a method on a FEVM contract without including a transaction on the blockchain.

(
        &mut self,
        contract: Address,
        calldata: Bytes,
        value: TokenAmount,
        gas_params: GasParams,
        height: FvmQueryHeight,
    )

Source from the content-addressed store, hash-verified

110pub trait CallClient: QueryClient + BoundClient {
111 /// Call a method on a FEVM contract without including a transaction on the blockchain.
112 async fn fevm_call(
113 &mut self,
114 contract: Address,
115 calldata: Bytes,
116 value: TokenAmount,
117 gas_params: GasParams,
118 height: FvmQueryHeight,
119 ) -> anyhow::Result<CallResponse<Vec<u8>>> {
120 let msg = self
121 .message_factory_mut()
122 .fevm_call(contract, calldata, value, gas_params)?;
123
124 let response = self.call(msg, height).await?;
125
126 let return_data = if response.value.code.is_err() {
127 None
128 } else {
129 let return_data = decode_fevm_invoke(&response.value)
130 .context("error decoding data from deliver_tx in query")?;
131 Some(return_data)
132 };
133
134 let response = CallResponse {
135 response,
136 return_data,
137 };
138
139 Ok(response)
140 }
141
142 /// Estimate the gas limit of a FEVM call.
143 async fn fevm_estimate_gas(

Callers 1

fevm_estimate_gasMethod · 0.45

Implementers 1

tx.rsfendermint/rpc/src/tx.rs

Calls 4

decode_fevm_invokeFunction · 0.85
contextMethod · 0.80
message_factory_mutMethod · 0.45
callMethod · 0.45

Tested by

no test coverage detected