@@ -2,7 +2,8 @@ use candid::Principal;
22use did:: block:: { BlockResult , ExeResult } ;
33use did:: error:: Result ;
44use did:: {
5- BasicAccount , Block , BlockNumber , Bytes , Transaction , TransactionReceipt , H160 , H256 , U256 ,
5+ BasicAccount , Block , BlockNumber , Bytes , EstimateGasRequest , Transaction , TransactionReceipt ,
6+ H160 , H256 , U256 ,
67} ;
78use ic_canister_client:: { CanisterClient , CanisterClientResult } ;
89
@@ -329,29 +330,15 @@ impl<C: CanisterClient> EvmCanisterClient<C> {
329330 ///
330331 /// # Arguments
331332 ///
332- /// * `from` - The address of the caller
333- /// * `to` - The address of the contract to call
334- /// * `gas_limit` - The gas limit for the call
335- /// * `value` - The value to send to the contract
336- /// * `input` - The data to send to the contract
337- ///
333+ /// * `request` - The request to estimate the gas for the call
338334 /// # Returns
339335 ///
340336 /// The estimated gas for the call
341337 pub async fn eth_estimate_gas (
342338 & self ,
343- from : H160 ,
344- to : Option < H160 > ,
345- gas_limit : u64 ,
346- value : U256 ,
347- input : Bytes ,
339+ request : EstimateGasRequest ,
348340 ) -> CanisterClientResult < EvmResult < U256 > > {
349- self . client
350- . query (
351- "eth_estimate_gas" ,
352- ( from, to, gas_limit, value, gas_limit, input) ,
353- )
354- . await
341+ self . client . query ( "eth_estimate_gas" , ( request, ) ) . await
355342 }
356343
357344 /// Get the transaction count at a given block hash
0 commit comments