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,
)
| 110 | pub 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( |
no test coverage detected