Invoke an EVM contract through RPC and print the response to STDOUT as JSON.
(
client: FendermintClient,
args: TransArgs,
contract: Address,
method: Bytes,
method_args: Bytes,
)
| 206 | |
| 207 | /// Invoke an EVM contract through RPC and print the response to STDOUT as JSON. |
| 208 | async fn fevm_invoke( |
| 209 | client: FendermintClient, |
| 210 | args: TransArgs, |
| 211 | contract: Address, |
| 212 | method: Bytes, |
| 213 | method_args: Bytes, |
| 214 | ) -> anyhow::Result<()> { |
| 215 | let calldata = Bytes::from([method, method_args].concat()); |
| 216 | broadcast_and_print( |
| 217 | client, |
| 218 | args, |
| 219 | |mut client, value, gas_params| { |
| 220 | Box::pin(async move { |
| 221 | client |
| 222 | .fevm_invoke(contract, calldata, value, gas_params) |
| 223 | .await |
| 224 | }) |
| 225 | }, |
| 226 | |data| serde_json::Value::String(hex::encode(data)), |
| 227 | ) |
| 228 | .await |
| 229 | } |
| 230 | |
| 231 | /// Call an EVM contract through RPC and print the response to STDOUT as JSON. |
| 232 | async fn fevm_call( |
nothing calls this directly
no test coverage detected